Browse Source
Add bot.listen() suggestion to on_message faq
pull/5839/head
PikalaxALT
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
0 deletions
-
docs/faq.rst
|
|
@ -344,6 +344,15 @@ Overriding the default provided ``on_message`` forbids any extra commands from r |
|
|
|
|
|
|
|
await bot.process_commands(message) |
|
|
|
|
|
|
|
Alternatively, you can place your ``on_message`` logic into a **listener**. In this setup, you should not |
|
|
|
manually call ``bot.process_commands()``. This also allows you to do multiple things asynchronously in response |
|
|
|
to a message. Example:: |
|
|
|
|
|
|
|
@bot.listen('on_message') |
|
|
|
async def whatever_you_want_to_call_it(message): |
|
|
|
# do stuff here |
|
|
|
# do not process commands here |
|
|
|
|
|
|
|
Why do my arguments require quotes? |
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
|
|
|
|
|
|