diff --git a/bot.py b/bot.py index b609cd0..0ae9000 100755 --- a/bot.py +++ b/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: