Compare commits
2 Commits
c239aadfaf
...
cf3906be94
Author | SHA1 | Date | |
---|---|---|---|
cf3906be94 | |||
64cf863437 |
1
bot.py
1
bot.py
@ -78,6 +78,7 @@ class BotClient(discord.Client):
|
|||||||
calc = await self._calculate(args)
|
calc = await self._calculate(args)
|
||||||
await message.reply(content=calc.strip())
|
await message.reply(content=calc.strip())
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
_log.exception("running calculation")
|
||||||
await message.reply(
|
await message.reply(
|
||||||
content="```\n" + str(e) + "\n```", delete_after=30
|
content="```\n" + str(e) + "\n```", delete_after=30
|
||||||
)
|
)
|
||||||
|
7
calc.js
7
calc.js
@ -121,9 +121,7 @@ function* iterate(arr) {
|
|||||||
function unwrapToken(type, token) {
|
function unwrapToken(type, token) {
|
||||||
assert(
|
assert(
|
||||||
token.tokenType.name == type,
|
token.tokenType.name == type,
|
||||||
"expected token %s, got %s",
|
`expected token ${type}, got ${token.tokenType.name}`,
|
||||||
type,
|
|
||||||
token.tokenType.name
|
|
||||||
);
|
);
|
||||||
return token.image;
|
return token.image;
|
||||||
}
|
}
|
||||||
@ -218,6 +216,9 @@ function parseAndCalculate(line) {
|
|||||||
case "Item":
|
case "Item":
|
||||||
opts().item = unwrapToken("Item", item);
|
opts().item = unwrapToken("Item", item);
|
||||||
break;
|
break;
|
||||||
|
case "Ability":
|
||||||
|
opts().ability = unwrapToken("Ability", item);
|
||||||
|
break;
|
||||||
case "Pokemon":
|
case "Pokemon":
|
||||||
{
|
{
|
||||||
let name = unwrapToken("Pokemon", item);
|
let name = unwrapToken("Pokemon", item);
|
||||||
|
Loading…
Reference in New Issue
Block a user