G
G
GayLord632019-01-15 12:40:54
Node.js
GayLord63, 2019-01-15 12:40:54

How to “override” the methods of responding to messages when developing in Node.js for a telegram bot?

Hello. Tell me please. Let's say I have bot.onText(/\/hello/,...), respectively, handles the reception of the /hello command and there is bot.on('message',...), which processes all incoming messages. Now, when the user enters /hello, 2 handlers will work at once (for hello and for all messages). How to make it work only for hello?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Just A Bit, 2019-01-16
@justabit

Add to message a check like if(message.text != "hello") ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question