]> jfr.im git - erebus.git/commitdiff
bugfix for PMs with first argument beginning with #
authorJohn Runyon <redacted>
Tue, 4 Feb 2014 12:37:03 +0000 (06:37 -0600)
committerJohn Runyon <redacted>
Tue, 4 Feb 2014 12:37:03 +0000 (06:37 -0600)
bot.py

diff --git a/bot.py b/bot.py
index ec471e3dbd549d39c880e8925c9de165ddd79bd9..44181f4f293bb8b4f8037a45e96eee5ce03ae40f 100644 (file)
--- a/bot.py
+++ b/bot.py
@@ -89,7 +89,8 @@ class Bot(object):
                                chanword = pieces[1]
                                if chanword[0] == '#':
                                        chan = self.parent.channel(chanword)
-                                       pieces.pop(1)
+                                       if chan is not None: #if chan is still none, there's no bot on "chanword", and chanword is used as a parameter.
+                                               pieces.pop(1)
 
                else: # message was sent to a channel
                        chan = self.parent.channel(target) #TODO check if bot's on channel --- in Erebus.channel() maybe?