chiark / gitweb /
new trouts from adam
[irc.git] / commands.py
index f015b89a59754789d7f586e918f5a37323c2d5c6..38769876bff1ff5a4a730f78f6f95c729952475c 100755 (executable)
@@ -62,7 +62,7 @@ def fish_quota(pond):
         pond.quotatime=time.time()
 
 # List of things the bot might be called to work round the self-trouting code
-synonyms=["itself","the bot"]
+synonyms=["itself","the bot","themself"]
 
 # trout someone, or flirt with them
 def troutq(bot, cmd, nick, conn, public, cfg):
@@ -256,7 +256,7 @@ def currencyq(bot, cmd, nick, conn, public):
     targ = ("http://www.xe.com/ucc/convert.cgi?From=%s&To=%s" % (args[0], args[1]))
     try:
         currencypage = urllib.urlopen(targ).read()
-        match = re.search(r"(1 %s = [\d\.]+ %s)" % (args[0],args[1]),currencypage,re.MULTILINE)
+        match = re.search(r"(1 %s = [\d\.]+ %s)" % (args[0].upper(),args[1].upper()),currencypage,re.MULTILINE)
         if match == None:
             bot.automsg(public,nick,"Dear Chief Secretary, there is no money.")
         else:
@@ -440,7 +440,6 @@ def urlq(bot, cmd, nick, conn, public,urldb):
         conn.privmsg(bot.channel,"%s remarks: %s" % (nick," ".join(cmd.split()[1:])))
       else:
         conn.privmsg(bot.channel,"(via %s) %s"%(nick," ".join(cmd.split()[1:])))
-      bot.automsg(False,nick,"That URL was unique; I have posted it into IRC")
     urldb[url]=UrlLog(url,nick)
 
 ### Deal with URLs spotted in channel
@@ -506,7 +505,7 @@ def getTweet(urlstring,twitapi):
   tweetID = parts[-1]
   try:
     status = twitapi.GetStatus(tweetID)
-    print status, type(status), status=={}
+    #print status, type(status), status=={}
     if status == {}:
         return "twitapi.GetStatus returned nothing :-("
     if status.user == None and status.text == None: