From a926461f8fd2cf643d449737bdc1b3de52b71cd3 Mon Sep 17 00:00:00 2001 From: xeals Date: Wed, 26 Apr 2023 17:06:33 +1000 Subject: [PATCH] fix args --- bot.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index aa65f6e..b609cd0 100755 --- a/bot.py +++ b/bot.py @@ -72,10 +72,9 @@ class BotClient(discord.Client): return message.content.startswith("%") async def on_command(self, message: discord.Message): - command = message.content.split(" ")[0] - match command: - case "%calc": - reply = await self._calculate(command[1:]) + match message.content.split(" "): + case ["%calc", *args]: + reply = await self._calculate(args) await message.reply(content=reply) case _: _log.info(f"Unrecognised command {command}")