From 4f191ac57a6de5b0197e46e4664308be658b62d3 Mon Sep 17 00:00:00 2001 From: topkecleon Date: Thu, 26 Nov 2015 18:40:01 -0500 Subject: [PATCH] /modkick and /modban can now be used with reasons without failing to kick. --- plugins/moderation.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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