This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot-2/plugins/control.lua
topkecleon aa7e16013d Fix bot restarting twice because of /halt.
Fix antirtl kicks ending with error.
2016-02-22 15:53:17 -05:00

29 lines
455 B
Lua

local triggers = {
'^/reload[@'..bot.username..']*',
'^/halt[@'..bot.username..']*'
}
local action = function(msg)
if msg.from.id ~= config.admin then
return
end
if msg.date < os.time() - 1 then return end
if msg.text:match('^/reload') then
bot_init()
sendReply(msg, 'Bot reloaded!')
elseif msg.text:match('^/halt') then
is_started = false
sendReply(msg, 'Stopping bot!')
end
end
return {
action = action,
triggers = triggers
}