forked from MTSR/telegram
Use telegram's standard command format with /command@botname
This commit is contained in:
parent
602de99529
commit
f7f7a4d90a
4
init.lua
4
init.lua
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user