|
|
@ -39,7 +39,7 @@ def on_privmsg(cli, rawnick, chan, msg): |
|
|
|
if botconfig.DEBUG_MODE: |
|
|
|
if botconfig.DEBUG_MODE: |
|
|
|
raise e |
|
|
|
raise e |
|
|
|
else: |
|
|
|
else: |
|
|
|
traceback.print_exc() |
|
|
|
logging.error(traceback.format_exc()) |
|
|
|
cli.msg(chan, "An error has occurred.") |
|
|
|
cli.msg(chan, "An error has occurred.") |
|
|
|
else: |
|
|
|
else: |
|
|
|
for x in wolfgame.PM_COMMANDS.keys(): |
|
|
|
for x in wolfgame.PM_COMMANDS.keys(): |
|
|
@ -57,7 +57,7 @@ def on_privmsg(cli, rawnick, chan, msg): |
|
|
|
if botconfig.DEBUG_MODE: |
|
|
|
if botconfig.DEBUG_MODE: |
|
|
|
raise e |
|
|
|
raise e |
|
|
|
else: |
|
|
|
else: |
|
|
|
traceback.print_exc() |
|
|
|
logging.error(traceback.format_exc()) |
|
|
|
cli.msg(chan, "An error has occurred.") |
|
|
|
cli.msg(chan, "An error has occurred.") |
|
|
|
|
|
|
|
|
|
|
|
def __unhandled__(cli, prefix, cmd, *args): |
|
|
|
def __unhandled__(cli, prefix, cmd, *args): |
|
|
@ -74,9 +74,10 @@ def __unhandled__(cli, prefix, cmd, *args): |
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
def main(): |
|
|
|
if not botconfig.DEBUG_MODE: |
|
|
|
if not botconfig.DEBUG_MODE: |
|
|
|
logging.basicConfig(level=logging.WARNING) |
|
|
|
logging.basicConfig(filename='errors.log', filemode='w', level=logging.WARNING) |
|
|
|
else: |
|
|
|
else: |
|
|
|
logging.basicConfig(level=logging.DEBUG) |
|
|
|
logging.basicConfig(level=logging.DEBUG) |
|
|
|
|
|
|
|
|
|
|
|
cli = IRCClient( |
|
|
|
cli = IRCClient( |
|
|
|
{"privmsg":on_privmsg, |
|
|
|
{"privmsg":on_privmsg, |
|
|
|
"":__unhandled__}, |
|
|
|
"":__unhandled__}, |
|
|
|