]> jfr.im git - erebus.git/blobdiff - bot.py
Fixed "db has gone away"
[erebus.git] / bot.py
diff --git a/bot.py b/bot.py
index 44181f4f293bb8b4f8037a45e96eee5ce03ae40f..1c8aa02a4b26c8bf68355e24e75859c2f270b4d0 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -61,8 +61,7 @@ class Bot(object):
                        qt = pieces[3]
                        nick = pieces[4]
                        auth = pieces[5]
-                       if auth != '0':
-                               self.parent.user(nick).authed(auth)
+                       self.parent.user(nick).authed(auth)
 
                elif pieces[1] == "JOIN":
                        nick = pieces[0].split('!')[0][1:]
@@ -114,10 +113,10 @@ class Bot(object):
                                        cbret = callback(self, user, chan, target, *pieces[1:])
                                        if cbret is NotImplemented:
                                                self.msg(user, "Command not implemented.")
-               else:
-                       self.msg(user, "No such command.")
 
        def msg(self, target, msg):
+               if target is None or msg is None: return
+
                if isinstance(target, self.parent.User): self.conn.send("NOTICE %s :%s" % (target.nick, msg))
                elif isinstance(target, self.parent.Channel): self.conn.send("PRIVMSG %s :%s" % (target.name, msg))
                elif isinstance(target, basestring):