handle error
This commit is contained in:
parent
a926461f8f
commit
648deb83db
4
bot.py
4
bot.py
@ -81,7 +81,9 @@ class BotClient(discord.Client):
|
||||
|
||||
async def _calculate(self, args: list[str]) -> str:
|
||||
proc = sp.run(["node", "calc_main.js", "--"] + args)
|
||||
msg = proc.stdout
|
||||
if proc.returncode != 0:
|
||||
_log.error(f"running calculator: {proc.stderr}")
|
||||
msg = proc.stdout or ""
|
||||
return msg.strip()
|
||||
|
||||
def is_replay(self, message: discord.Message) -> bool:
|
||||
|
Loading…
Reference in New Issue
Block a user