From 10fcdd5753b6b3f8753055eb29e8eb7f89a866af Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Thu, 07 May 2009 22:51:33 +0000 Subject: add listmeetings and savemeetings commands - they both do exactly what it sounds like. Limited to bot owner for now. darcs-hash:20090507225133-82ea9-bd070c90914e452658c4788edc6cfdeed059901a.gz --- (limited to 'plugin.py') diff --git a/plugin.py b/plugin.py index 255f0b1..4563cac 100644 --- a/plugin.py +++ b/plugin.py @@ -98,6 +98,25 @@ class MeatBot(callbacks.Plugin): #M.save() # now do_endmeeting in M calls the save functions del self.Meetings[Mkey] + def listmeetings(self, irc, msg, args): + """List all currently-active meetings.""" + reply = "" + reply = ", ".join(str(x) for x in sorted(self.Meetings.keys()) ) + if reply.strip() == '': + irc.reply("No currently active meetings.") + else: + irc.reply(reply) + listmeetings = wrap(listmeetings, ['private', 'owner']) + + def savemeetings(self, irc, msg, args): + """Save all currently active meetings.""" + numSaved = 0 + for M in self.Meetings: + M.save() + irc.reply("Saved %d meetings."%numSaved) + savemeetings = wrap(savemeetings, ['owner']) + + Class = MeatBot -- cgit v0.9.1