diff --git a/plugins/moderation.lua b/plugins/moderation.lua index 6257974..3b97aef 100755 --- a/plugins/moderation.lua +++ b/plugins/moderation.lua @@ -219,13 +219,13 @@ local commands = { local userid = msg.text:input() local usernm = userid + if msg.reply_to_message then + userid = tostring(msg.reply_to_message.from.id) + usernm = msg.reply_to_message.from.first_name + end + if not userid then - if msg.reply_to_message then - userid = tostring(msg.reply_to_message.from.id) - usernm = msg.reply_to_message.from.first_name - else - return 'Kicks must be done via reply or specification of a user/bot\'s ID or username.' - end + return 'Kicks must be done via reply or specification of a user/bot\'s ID or username.' end if moddat[msg.chat.id_str][userid] or config.moderation.admins[userid] then @@ -255,13 +255,13 @@ local commands = { local userid = msg.text:input() local usernm = userid + if msg.reply_to_message then + userid = tostring(msg.reply_to_message.from.id) + usernm = msg.reply_to_message.from.first_name + end + if not userid then - if msg.reply_to_message then - userid = tostring(msg.reply_to_message.from.id) - usernm = msg.reply_to_message.from.first_name - else - return 'Bans must be done via reply or specification of a user/bot\'s ID or username.' - end + return 'Kicks must be done via reply or specification of a user/bot\'s ID or username.' end if moddat[msg.chat.id_str][userid] or config.moderation.admins[userid] then