L
L
legion_lex2020-01-02 05:16:14
Node.js
legion_lex, 2020-01-02 05:16:14

I use vk-io, adding setHearFallbackHandler to an unknown command, the bot responds with an infinite number of messages, how to fix it?

Adding:
updates.setHearFallbackHandler(async (context, next) => {
await context.send('No such command :(');
});
Result:
No such command :('
No such command :(' No
such command : ('
There is no such command :('
There is no such command :('
...
There is no such command :('
How can I make the answer only once?
Preferably with a simple example, thanks...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
drikor, 2020-10-16
@drikor

I do not know if the question is relevant, but it is related to the fact that the bot replies to its message. Just add sender verification
if (context.senderId === сюда айди группы) return;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question