Skip to content
Advertisement

Can’t return the first function from Bot.event on_message

Code


Here’s (a little part) of my code:

JavaScript

There’s no error raised with my code.

Problem

return makes the Spy command end, but events keep running.

Question

Do you know how to make all the events (on_typing and on_message aren’t the only ones) end with the return?
Thanks in advance!

Advertisement

Answer

Answer


Maybe I found the answer to my own question:
I have to put on_message as the first event in the function, and then use End bool to end all the others.

Edit


As @Łukasz Kwieciński explained me, I should use the Bot.wait_for() method.

JavaScript

Easier and much shorter than my previous solution.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement