Fix bot restarting twice because of /halt.

Fix antirtl kicks ending with error.
This commit is contained in:
topkecleon 2016-02-22 15:53:17 -05:00
parent 69de75bf72
commit aa7e16013d
3 changed files with 4 additions and 11 deletions

View File

@ -187,22 +187,13 @@ local commands = {
-- antisquig Strict -- antisquig Strict
if group.flags[3] == true then 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) kick_user(msg.from.id, msg.chat.id)
sendMessage(msg.from.id, flags[3].kicked:gsub('GROUPNAME', msg.chat.title)) sendMessage(msg.from.id, flags[3].kicked:gsub('GROUPNAME', msg.chat.title))
return return
end end
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 end
if msg.new_chat_participant then if msg.new_chat_participant then

View File

@ -24,7 +24,7 @@ local action = function(msg)
end end
str = str:match('<img src="(.*)">') str = str:match('<img src="(.*)">')
local output = '[]('..str..')' local output = '[Cat!]('..str..')'
sendMessage(msg.chat.id, output, false, nil, true) sendMessage(msg.chat.id, output, false, nil, true)

View File

@ -9,6 +9,8 @@ local action = function(msg)
return return
end end
if msg.date < os.time() - 1 then return end
if msg.text:match('^/reload') then if msg.text:match('^/reload') then
bot_init() bot_init()
sendReply(msg, 'Bot reloaded!') sendReply(msg, 'Bot reloaded!')