1
0
forked from MTSR/telegram

Use telegram's standard command format with /command@botname

This commit is contained in:
neko259 2019-01-20 17:40:22 +02:00
parent 602de99529
commit f7f7a4d90a

View File

@ -91,7 +91,9 @@ function telegram.send_message(chat_id, text)
end
function telegram.on_text_receive(msg)
local command = COMMANDS[msg.text]
local comm, bot_name = string.match(msg.text, "/(%a+)@(.+)")
-- TODO Check the bot name
local command = COMMANDS[comm]
if command then
command(msg)
else