Closed Podidiving closed 4 years ago
Hey there! Thanks for the good words. Try using @bot.default
decorator, instead of @bot.handle("text")
, it should do what you want. Note that default
passes you the whole json payload, so to extract text do something like:
@bot.default
def echo(chat, message):
return chat.reply(message["text"])
Thanks! Now it's working :)
Hi! I think, this framework is great, and I use it sometimes. Now I'm facing with next problem: I want my bot to have default text handler and also to have special handler for some commands For example, I have next code:
Now, if I'm sending my bot command
/start
, but instead ofhandle_start_command
callback, it will executehandle_text
callback. What's the problem, and how to overcome it?