29 lines
451 B
Lua
29 lines
451 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() 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
|
|
}
|
|
|