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
|
||||
|
||||
# Call bot.process_commands() — this handles PREFIX COMMANDS
|
||||
# It strips the prefix, finds the command, and invokes it.
|
||||
# This is the CORRECT way to handle prefix commands in discord.py.
|
||||
await bot.process_commands(message)
|
||||
# IMPORTANT: DO NOT await this — it returns None, not a coroutine
|
||||
# This is the official discord.py way to process prefix commands
|
||||
bot.process_commands(message)
|
||||
|
||||
|
||||
@bot.event
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user