Add error logging and fix some things

This commit is contained in:
Robert Miles 2018-12-02 06:01:17 +00:00
parent 08e34bdd94
commit 2aa2a60a2f
1 changed files with 4 additions and 4 deletions

8
bot.py
View File

@ -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=""):