handle error
This commit is contained in:
		
							
								
								
									
										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: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user