mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-10-15 19:46:34 +00:00
Add bot.listen() suggestion to on_message faq
This commit is contained in:
@@ -344,6 +344,15 @@ Overriding the default provided ``on_message`` forbids any extra commands from r
|
|||||||
|
|
||||||
await bot.process_commands(message)
|
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?
|
Why do my arguments require quotes?
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user