fix: remove await from bot.process_commands() call
bot.process_commands() is a synchronous function that returns None, not a coroutine. Using 'await' on it is incorrect and causes the command dispatch to be silently ignored. The fix is to call bot.process_commands(message) without await, which allows prefix commands (like !join) to be properly dispatched to their @bot.command() handlers.
This commit is contained in:
parent
59bde86d20
commit
c37e940e86
6
main.py
6
main.py
@ -209,9 +209,9 @@ async def on_message(message: discord.Message) -> None:
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Call bot.process_commands() — this handles PREFIX COMMANDS
|
# Call bot.process_commands() — this handles PREFIX COMMANDS
|
||||||
# It strips the prefix, finds the command, and invokes it.
|
# IMPORTANT: DO NOT await this — it returns None, not a coroutine
|
||||||
# This is the CORRECT way to handle prefix commands in discord.py.
|
# This is the official discord.py way to process prefix commands
|
||||||
await bot.process_commands(message)
|
bot.process_commands(message)
|
||||||
|
|
||||||
|
|
||||||
@bot.event
|
@bot.event
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user