another go at fixing intermittent disconnections

master
mutantmonkey 2011-09-23 00:39:58 -04:00
parent 2f2d365113
commit 6ee5c6dae7
1 changed files with 2 additions and 2 deletions

4
bot.py
View File

@ -13,7 +13,7 @@ import irc
home = os.getcwd() home = os.getcwd()
def decode(bytes): def decode(bytes):
if not bytes or type(bytes) == str: if type(bytes) == str:
return bytes return bytes
try: try:
text = bytes.decode('utf-8') text = bytes.decode('utf-8')
@ -205,7 +205,7 @@ class Phenny(irc.Bot):
def dispatch(self, origin, args): def dispatch(self, origin, args):
bytes, event, args = args[0], args[1], args[2:] bytes, event, args = args[0], args[1], args[2:]
text = str(bytes) text = decode(bytes)
event = decode(event) event = decode(event)
if origin.nick in self.config.ignore: if origin.nick in self.config.ignore: