Compare commits

..

2 Commits

Author SHA1 Message Date
cf3906be94
support abilities in calc 2023-04-27 11:24:17 +10:00
64cf863437
fix logging 2023-04-27 11:23:48 +10:00
2 changed files with 5 additions and 3 deletions

1
bot.py
View File

@ -78,6 +78,7 @@ class BotClient(discord.Client):
calc = await self._calculate(args)
await message.reply(content=calc.strip())
except Exception as e:
_log.exception("running calculation")
await message.reply(
content="```\n" + str(e) + "\n```", delete_after=30
)

View File

@ -121,9 +121,7 @@ function* iterate(arr) {
function unwrapToken(type, token) {
assert(
token.tokenType.name == type,
"expected token %s, got %s",
type,
token.tokenType.name
`expected token ${type}, got ${token.tokenType.name}`,
);
return token.image;
}
@ -218,6 +216,9 @@ function parseAndCalculate(line) {
case "Item":
opts().item = unwrapToken("Item", item);
break;
case "Ability":
opts().ability = unwrapToken("Ability", item);
break;
case "Pokemon":
{
let name = unwrapToken("Pokemon", item);