chiark / gitweb /
Added the 'list' command
authormatthew <matthew>
Thu, 7 Feb 2002 01:05:09 +0000 (01:05 +0000)
committermatthew <matthew>
Thu, 7 Feb 2002 01:05:09 +0000 (01:05 +0000)
acrobat-chiark-0.2.py

index 2c6b85c..7098c49 100755 (executable)
@@ -50,6 +50,8 @@ class Acrobat(SingleServerIRCBot):
         self.channel = channel
         self.owner = owner
         self.quotatime = time.time()
+        #List of known !commands we respond to
+        self.known =['karma','trout','info','die','quiet','list','google','say','do']
         #Configurable stuff - how often do we add how many fish?
         self.cur_fish=5
         self.max_fish=5       #Maximum of 5 fish
@@ -159,6 +161,10 @@ class Acrobat(SingleServerIRCBot):
             conn.notice(nick, "My owner is %s; I have karma on %s items." %
                         (self.owner, len(self.karma.dict.keys())))
 
+    # list know commands
+    def listq(self, cmd, nick, conn, public):
+        conn.notice(nick, "%s" % string.join(self.known))
+
     # trout someone
     def troutq(self, cmd, nick, conn, public):
         self.fish_quota()
@@ -281,6 +287,9 @@ class Acrobat(SingleServerIRCBot):
         if cmd == "info":
             self.infoq(cmd, nick, conn, public)
 
+        # Known commands
+        if cmd == "list":
+            self.listq(cmd, nick, conn, public)
         # weaponry
         if cmd.split()[0] == "trout":
             self.troutq(cmd, nick, conn, public)