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:
Benjamyn 2026-08-27 17:04:25 +10:00
parent c37e940e86
commit 611e38516f

View File

@ -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
# IMPORTANT: DO NOT await this — it returns None, not a coroutine # Note: In discord.py 2.7.x, process_commands() is a coroutine
# This is the official discord.py way to process prefix commands # and MUST be awaited.
bot.process_commands(message) await bot.process_commands(message)
@bot.event @bot.event