Commit 67e2dc42 authored by Jonathan Harker's avatar Jonathan Harker

Some bug fixes.

parent b3c4eb05
...@@ -180,7 +180,8 @@ class LolBot(irc.IRCClient): ...@@ -180,7 +180,8 @@ class LolBot(irc.IRCClient):
print "Joined %s." % (channel,) print "Joined %s." % (channel,)
def privmsg(self, user, channel, msg): def privmsg(self, user, channel, msg):
if channel != self.channel: user = user.split('!')[0]
if channel == self.nickname:
# Private /msg from a user # Private /msg from a user
self.do_command(msg, user) self.do_command(msg, user)
else: else:
...@@ -203,12 +204,12 @@ class LolBot(irc.IRCClient): ...@@ -203,12 +204,12 @@ class LolBot(irc.IRCClient):
def say_public(self, text): def say_public(self, text):
"Print TEXT into public channel, for all to see." "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) self.log_event(self.nickname, text)
def say_private(self, nick, text): def say_private(self, nick, text):
"Send private message of TEXT to NICK." "Send private message of TEXT to NICK."
self.msg(nick, text) self.notice(nick, text)
def reply(self, text, to_private=None): def reply(self, text, to_private=None):
"Send TEXT to either public channel or TO_PRIVATE nick (if defined)." "Send TEXT to either public channel or TO_PRIVATE nick (if defined)."
...@@ -231,8 +232,6 @@ class LolBot(irc.IRCClient): ...@@ -231,8 +232,6 @@ class LolBot(irc.IRCClient):
private message addressed to the bot. (e.g. "bot: blah"). private message addressed to the bot. (e.g. "bot: blah").
""" """
target = target.strip()
try: try:
if cmd == 'help': if cmd == 'help':
self.reply(self.helptext, target) self.reply(self.helptext, target)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment