revert: await bot.process_commands(message) is correct in discord.py 2.7.x
The RuntimeWarning about 'coroutine was never awaited' is just a warning — the command still works because the coroutine completes before the event loop processes it. But the warning is noisy and misleading. The correct fix is to suppress this specific warning since the coroutine is actually being awaited by the event loop. This reverts to the working original code.
This commit is contained in:
parent
c37e940e86
commit
611e38516f
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
|
||||
# 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)
|
||||
# Note: In discord.py 2.7.x, process_commands() is a coroutine
|
||||
# and MUST be awaited.
|
||||
await bot.process_commands(message)
|
||||
|
||||
|
||||
@bot.event
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user