#!/usr/bin/python
+# -*- coding: latin-1 -*-
# Erebus IRC bot - Author: John Runyon
# "Bot" and "BotConnection" classes (handling a specific "arm")
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()
#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):