Handle exception for unprivileged commands
This change prevents the bot from crashing on unprivileged commands. Change-Id: Ib855550aaccfdaca6b8997611de19603ecff72e2
This commit is contained in:
parent
4c31332e23
commit
52bf62acc6
|
@ -361,11 +361,15 @@ class BaseStatusBot(irc.bot.SingleServerIRCBot):
|
|||
nick = e.source.split('!')[0]
|
||||
msg = e.arguments[0]
|
||||
# Unprivileged commands
|
||||
if msg.startswith('#success'):
|
||||
self.handle_success_command(e.target, nick, msg)
|
||||
return
|
||||
if msg.startswith('#thanks'):
|
||||
self.handle_thanks_command(e.target, nick, msg)
|
||||
try:
|
||||
if msg.startswith('#success'):
|
||||
self.handle_success_command(e.target, nick, msg)
|
||||
return
|
||||
if msg.startswith('#thanks'):
|
||||
self.handle_thanks_command(e.target, nick, msg)
|
||||
return
|
||||
except Exception:
|
||||
self.log.exception("Exception handling command %s" % msg)
|
||||
return
|
||||
# Privileged commands
|
||||
if not msg.startswith('#status'):
|
||||
|
|
Loading…
Reference in New Issue