fix calculator help
This commit is contained in:
parent
53ece70381
commit
e3dc7301e4
17
bot.py
17
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.
|
||||
"""
|
||||
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(
|
||||
|
Loading…
Reference in New Issue
Block a user