another go at fixing intermittent disconnections
This commit is contained in:
4
bot.py
4
bot.py
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user