From 1c27ed17cfda82fd100f3bcad819b476c8d3ef3d Mon Sep 17 00:00:00 2001 From: Benjamyn Date: Thu, 27 Aug 2026 16:43:35 +1000 Subject: [PATCH] fix: await bot.process_commands(message) in on_message - The on_message handler was calling process_commands() without await - Without await, the coroutine returned immediately and the command never ran - Now the command is properly processed and a response is sent --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 2b4e8b5..3835011 100644 --- a/main.py +++ b/main.py @@ -140,7 +140,7 @@ async def hello_command(ctx: commands.Context, name: str = "World") -> None: await ctx.send(f"Hello, {name}!") @bot.command(name="list-commands", description="List all available commands.") -async def help_command(ctx: commands.Context) -> None: +async def list_commands(ctx: commands.Context) -> None: """List all available commands.""" # Get all registered commands (both prefix and slash) cmds = list(bot.commands.values()) @@ -180,7 +180,7 @@ async def on_command_error(ctx: commands.Context, error: commands.CommandError) """Global error handler for all commands.""" logger.debug(f"Command error for {ctx.author.name} ({ctx.author.id}): {error}") if isinstance(error, commands.CommandNotFound): - await ctx.send("Command not found. Type `!help` for a list of commands.") + await ctx.send("Command not found. Type `!list-commands` for a list of commands.") elif isinstance(error, commands.CheckFailure): await ctx.send("You do not have permission to use this command.") elif isinstance(error, commands.MissingPermissions): @@ -215,6 +215,7 @@ async def on_message(message: discord.Message) -> None: content = message.content[1:] # Remove the leading "!" again since we stripped one content = content.lstrip("!") + # FIX: Await process_commands to actually process the command await bot.process_commands(message)