From 2aa2a60a2f338135899c1f7cdb45b494b224198f Mon Sep 17 00:00:00 2001 From: khuxkm fbexl Date: Sun, 2 Dec 2018 06:01:17 +0000 Subject: [PATCH] Add error logging and fix some things --- bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 3f4821e..26b7d73 100644 --- a/bot.py +++ b/bot.py @@ -1,4 +1,4 @@ -import teambot,tasks,rss,time,sys,subprocess +import teambot,tasks,rss,time,sys,subprocess,re class CosmicBot(teambot.Handler): def __init__(self,bot): @@ -35,8 +35,8 @@ class CosmicBot(teambot.Handler): if (not self.commands[cmd]["is_admin"]) or (self.commands[cmd]["is_admin"] and is_admin): try: self.commands[cmd]["action"](channel,nick,*args) - except: - pass + except Exception as e: + print("access violation "+str(e)) def on_botlist(self,channel,nick): self.say(channel,nick+": Maintainer: khuxkm@cosmic.voyage | Utility bot") def on_admin(self,channel,nick,subcmd,*args): @@ -44,7 +44,7 @@ class CosmicBot(teambot.Handler): self.tasks.stop() self.tasks.save_state(0) self._bot.die("Stopping...") - sys.exit() + sys.exit(0) elif subcmd=="check": self.tasks.states[0] = self.check_rss(self.tasks.states[0],self.tasks.base_state) def on_roster(self,channel,nick,namecnt=""):