From: matthew Date: Thu, 7 Feb 2002 01:05:09 +0000 (+0000) Subject: Added the 'list' command X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~matthewv/git?p=irc.git;a=commitdiff_plain;h=382a17c507ce0a040f7e7b3ed9e7219eae5f10e1 Added the 'list' command --- diff --git a/acrobat-chiark-0.2.py b/acrobat-chiark-0.2.py index 2c6b85c..7098c49 100755 --- a/acrobat-chiark-0.2.py +++ b/acrobat-chiark-0.2.py @@ -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)