From aa7e16013d084b5efdce91e8d9ee7711ac74875f Mon Sep 17 00:00:00 2001 From: topkecleon Date: Mon, 22 Feb 2016 15:53:17 -0500 Subject: [PATCH] Fix bot restarting twice because of /halt. Fix antirtl kicks ending with error. --- plugins/administration.lua | 11 +---------- plugins/cats.lua | 2 +- plugins/control.lua | 2 ++ 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/plugins/administration.lua b/plugins/administration.lua index 29808fd..3a6c1b6 100644 --- a/plugins/administration.lua +++ b/plugins/administration.lua @@ -187,22 +187,13 @@ local commands = { -- antisquig Strict if group.flags[3] == true then - if msg.from.name:match('[\216-\219][\128-\191]') then + if msg.from.name:match('[\216-\219][\128-\191]') or msg.from.name:match('‮') then kick_user(msg.from.id, msg.chat.id) sendMessage(msg.from.id, flags[3].kicked:gsub('GROUPNAME', msg.chat.title)) return end end - -- antirtl - if group.flags[3] == true then - if msg.from.name:match('‮') then - kick_user(msg.from.id, msg.chat.id) - sendMessage(msg.from.id, flags[4].kicked:gsub('GROUPNAME', msg.chat.title)) - return - end - end - end if msg.new_chat_participant then diff --git a/plugins/cats.lua b/plugins/cats.lua index 5048a6a..4d80e85 100755 --- a/plugins/cats.lua +++ b/plugins/cats.lua @@ -24,7 +24,7 @@ local action = function(msg) end str = str:match('') - local output = '[​]('..str..')' + local output = '[Cat!]('..str..')' sendMessage(msg.chat.id, output, false, nil, true) diff --git a/plugins/control.lua b/plugins/control.lua index c59c59b..e0a0a0f 100644 --- a/plugins/control.lua +++ b/plugins/control.lua @@ -9,6 +9,8 @@ local action = function(msg) return end + if msg.date < os.time() - 1 then return end + if msg.text:match('^/reload') then bot_init() sendReply(msg, 'Bot reloaded!')