From ba3fd2e8fa8e7e29222a378261910901145567a9 Mon Sep 17 00:00:00 2001 From: Benjamyn Date: Thu, 27 Aug 2026 16:46:39 +1000 Subject: [PATCH] fix: strip only the first '!' character instead of all of them - Changed from message.content[1:].lstrip('!') to message.content[1:] - lstrip('!') removes ALL leading '!' characters, so '!ping' becomes 'ping' (correct) but '!ping ' becomes ' ping' (with a leading space, breaking command parsing) - Now only the first '!' is stripped, preserving spaces and subsequent characters --- main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 3835011..c052640 100644 --- a/main.py +++ b/main.py @@ -209,13 +209,11 @@ async def on_message(message: discord.Message) -> None: if message.guild is None: return - # Check if the message is a command + # Check if the message starts with the command prefix (exactly one !) if message.content.startswith("!."): - # Strip the leading "!" and process + # Strip ONLY the first "!" character (not all of them) content = message.content[1:] - # Remove the leading "!" again since we stripped one - content = content.lstrip("!") - # FIX: Await process_commands to actually process the command + # Now process the command await bot.process_commands(message)