and (irc_lower(a[0]) == irc_lower(self.connection.get_nickname())
or irc_lower(a[0])[:-1] == irc_lower(self.connection.get_nickname())):
- self.do_command(self.channel, string.strip(a[1]), public = 1)
+ self.do_command(nm_to_n(evt.source()), string.strip(a[1]), public = 1)
if a[0].endswith("++"):
self.karmaup(a[0])
if a[0].endswith("--"):
self.karmadown(a[0])
if payload[0] == "!" and len(payload)>1:
- self.do_command(self.channel, string.strip(payload[1:]), public=1)
+ self.do_command(nm_to_n(evt.source()), string.strip(payload[1:]), public=1)
if payload[0] == "~" and len(payload)>1:
- self.do_command(self.channel, string.strip(payload[1:]), public=1)
+ self.do_command(nm_to_n(evt.source()), string.strip(payload[1:]), public=1)
# And now bot commands;
# ...and touchy.
if me.lower() == target.lower():
target = nick
- conn.action(self.channel, trout_msg % target)
if public == 0:
- if random.random() <= 0.1:
- conn.action(self.channel, "notes %s is conducting a whispering campaign" % nick)
+ if random.random() <= 0.25:
+ trout_msg+= ' (at the instigation of %s)' % nick
+ conn.action(self.channel, trout_msg % target)
except IndexError:
conn.notice(nick, "Who do you wish me to trout?")
if public == 0:
conn.notice(nick, str(gsearch))
else: # we haven't found anything.
- conn.privmsg(nick, str(gsearch))
+ conn.privmsg(self.channel, str(gsearch))
else:
if public == 0:
conn.notice(nick, "No pages found.")
else:
- conn.privmsg(nick, "No pages found.")
+ conn.privmsg(self.channel, "No pages found.")
except IOError: # if the connection times out. This blocks. :(
if public == 0:
conn,notice(nick, "The web's broken. Waah!")
else:
- conn.privmsg(nick, "The web's broken. Waah!")
+ conn.privmsg(self.channel, "The web's broken. Waah!")
# General query handler
def do_command(self, nick, cmd, public=0):