From 611e38516fac4312e6cff1b4d728a36a7d8d079d Mon Sep 17 00:00:00 2001 From: Benjamyn Date: Thu, 27 Aug 2026 17:04:25 +1000 Subject: [PATCH] revert: await bot.process_commands(message) is correct in discord.py 2.7.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 6450d4c..0d68294 100644 --- a/main.py +++ b/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