diff options
| author | PikalaxALT <[email protected]> | 2020-09-20 00:15:10 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-09-20 00:15:10 -0400 |
| commit | e7b4bbe2f69d96a55ed30b1db41c8ac680c618e8 (patch) | |
| tree | 384b52ea788d65da71dcfe3f05ecbe23d3a4ec5f /docs | |
| parent | Fix allowed_mentions when sending files (diff) | |
| download | discord.py-e7b4bbe2f69d96a55ed30b1db41c8ac680c618e8.tar.xz discord.py-e7b4bbe2f69d96a55ed30b1db41c8ac680c618e8.zip | |
Add bot.listen() suggestion to on_message faq
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/faq.rst | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/faq.rst b/docs/faq.rst index 41931d41..55a65239 100644 --- a/docs/faq.rst +++ b/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? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |