diff --git a/bot.py b/bot.py index 1177ba4..578d47b 100755 --- a/bot.py +++ b/bot.py @@ -73,7 +73,7 @@ class BotClient(discord.Client): async def on_command(self, message: discord.Message): match re.split(" +", message.content): - case ["%calc?"], ["%calc", "?"]: + case ["%calc?"] | ["%calc", "?"]: await message.reply(content=self._help_calculate()) case ["%calc", *args]: try: @@ -85,15 +85,16 @@ class BotClient(discord.Client): content="```\n" + str(e) + "\n```", delete_after=10 ) case _: - _log.info(f"Unrecognised command {command}") + _log.info(f"Unrecognised command {message.content}") + await message.reply(content="Unrecognised command.") - async def _help_calculate(self) -> str: - return """ - Run Showdown damage calculations. - Example format: - ` %calc -2 8 SpA Choice Specs Torkoal Overheat vs. 252 HP / 4+ SpD Assault Vest Abomasnow in Sun through Light Screen` - Supported: attacker/defender boosts, EVs, item, species; attacker ability; weather/terrain; screens. - """ + def _help_calculate(self) -> str: + return ( + "Run Showdown damage calculations.\n" + "Example format:\n" + "` %calc -2 8 SpA Choice Specs Torkoal Overheat vs. 252 HP / 4+ SpD Assault Vest Abomasnow in Sun through Light Screen`\n" + "Supported: attacker/defender boosts, EVs, item, species; attacker ability; weather/terrain; screens." + ) async def _calculate(self, args: list[str]) -> str: proc = sp.run(