When a command is called, for example /hello, it gets treated twice. Once in bot.onUpdate(handler) and the second time in bot.onCommand("hello", greatingCb). How should I go about executing only a piece of code?
I'd like to execute the related code for each command by calling .onCommand and deal with all other things with .onUpdate. Now I'm not sure this is the right way of dealing with new messages so please tell me if I'm wrong.
When a command is called, for example
/hello
, it gets treated twice. Once inbot.onUpdate(handler)
and the second time inbot.onCommand("hello", greatingCb)
. How should I go about executing only a piece of code?I'd like to execute the related code for each command by calling
.onCommand
and deal with all other things with.onUpdate
. Now I'm not sure this is the right way of dealing with new messages so please tell me if I'm wrong.