X-Git-Url: https://jfr.im/git/erebus.git/blobdiff_plain/5c32be87f37301597b66c63560eb021c8c208105..ea3909b57e527c81e9a0b8eea98ab92e026a99d5:/bot.py diff --git a/bot.py b/bot.py index 94a12ab..2a4dd14 100644 --- a/bot.py +++ b/bot.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# -*- coding: latin-1 -*- # Erebus IRC bot - Author: John Runyon # "Bot" and "BotConnection" classes (handling a specific "arm") @@ -88,10 +89,10 @@ class Bot(object): def parsemsg(self, user, target, msg): chan = None - try: - triggerused = msg[0] == self.parent.trigger - except IndexError: # Fix if you feel like it /BiohZn - triggerused = False + if len(msg) == 0: + return + + triggerused = msg[0] == self.parent.trigger if triggerused: msg = msg[1:] pieces = msg.split() @@ -180,7 +181,7 @@ class BotConnection(object): #TODO: rewrite send() to queue def send(self, line): - print self.parent.nick, '[O]', line + print self.parent.nick, '[O]', str(line) self.write(line) def write(self, line):