diff --git a/lolbot.py b/lolbot.py old mode 100644 new mode 100755 index 65d840b..42d6394 --- a/lolbot.py +++ b/lolbot.py @@ -180,7 +180,8 @@ class LolBot(irc.IRCClient): print "Joined %s." % (channel,) def privmsg(self, user, channel, msg): - if channel != self.channel: + user = user.split('!')[0] + if channel == self.nickname: # Private /msg from a user self.do_command(msg, user) else: @@ -203,12 +204,12 @@ class LolBot(irc.IRCClient): def say_public(self, text): "Print TEXT into public channel, for all to see." - self.msg(self.channel, text) + self.notice(self.channel, text) self.log_event(self.nickname, text) def say_private(self, nick, text): "Send private message of TEXT to NICK." - self.msg(nick, text) + self.notice(nick, text) def reply(self, text, to_private=None): "Send TEXT to either public channel or TO_PRIVATE nick (if defined)." @@ -231,8 +232,6 @@ class LolBot(irc.IRCClient): private message addressed to the bot. (e.g. "bot: blah"). """ - target = target.strip() - try: if cmd == 'help': self.reply(self.helptext, target)