chiark / gitweb /
new slash from rjk
[irc.git] / Servus-chiark.py
index 37cccf93d35915a55171008ae67183096a55bbae..647bce0768ea12910d6fef9d234c98f9b338e8cd 100644 (file)
@@ -168,7 +168,7 @@ commands = {"karma": (c.karmaq,karmadb),
            "die": quit,
            "define": c.defineq,
             "google": c.googleq,
-#          "url": (c.urlq,urldb),
+           "url": (c.urlq,urldb),
            "units": c.unitq,
            "help": c.helpq,
 #          "game": (c.gameq,game),
@@ -183,6 +183,7 @@ triggers = ("!", "~") # what character should the bot be invoked by:
                       # eg !trout, ~trout etc.
 
 def command(bot, cmd, nick, conn, public):
+    global urldb,lastexp,expirelen,expirevery
     ours=0
     try:
            if public and cmd[0] in triggers:
@@ -199,10 +200,10 @@ def command(bot, cmd, nick, conn, public):
            c.urlexpire(urldb,expirelen)
            lastexp=t
 
-#    if public:
-#      if c.urlre.search(cmd):
-#        c.dourl(bot,conn,nick,cmd,urldb)
-         
+    if public:
+      if c.urlre.search(cmd) and command.lower()!="url":
+        c.dourl(bot,conn,nick,cmd,urldb)
+
     # karma: up
     if command.endswith("++"):
         karma(cmd,1)