chiark / gitweb /
google now talks to the channel if it finds a page
[irc.git] / acrobat-chiark-0.2.py
index 6cb3bfdccd46b113185aa336dadbf095112fd4a5..640694042f32906a42fe38300d0b328bd90174f4 100755 (executable)
@@ -182,9 +182,7 @@ class Acrobat(SingleServerIRCBot):
                     target = nick
                 if public == 0:
                     if random.random() <= 0.25:
-                        trout_msg+= ' (at the instigation of '
-                        trout_msg+=nick
-                        trout_msg+= ')'
+                        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?")
@@ -250,17 +248,17 @@ class Acrobat(SingleServerIRCBot):
                 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):