Add error handling to listeners
This commit is contained in:
parent
d6bc5867dc
commit
7c8016e33e
6
bot.py
6
bot.py
|
@ -31,7 +31,11 @@ class MinerbotPhoenix(teambot.Handler):
|
|||
pass
|
||||
def on_pubmsg(self,channel,nick,message):
|
||||
for listener in plugin.listeners:
|
||||
plugin.listeners[listener](self,channel,nick,message)
|
||||
try:
|
||||
plugin.listeners[listener](self,channel,nick,message)
|
||||
except:
|
||||
print("On listener `{}`:".format(listener))
|
||||
traceback.print_exc()
|
||||
if not message.startswith(self.prefix): return
|
||||
self.is_admin = self.event.source.userhost == BOTOP
|
||||
args = message[len(self.prefix):].split(" ")
|
||||
|
|
Loading…
Reference in New Issue