else:
# We assume google has truncated the definition for us so this
# won't flood the channel with text...
- defn = " ".join(match.group(1).split("\n"));
+ defn = " ".join(match.group(1).split("\n"))
bot.automsg(public,nick,defn)
except IOError: # if the connection times out. This blocks. :(
bot.automsg(public,nick,"The web's broken. Waah!")
bot.disconnect(msg="Be right back.")
### list keys of a dictionary
-def listkeysq(bot, cmd, nick, conn, public, dict):
- bot.automsg(public,nick,string.join(dict.keys()))
+def listkeysq(bot, cmd, nick, conn, public, dict, sort=False):
+ d=dict.keys()
+ if sort:
+ d.sort()
+ bot.automsg(public,nick,string.join(d))
### rot13 text (yes, I could have typed out the letters....)
### also "foo".encode('rot13') would have worked