Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugin.py
diff options
context:
space:
mode:
authorRichard Darst <rkd@zgib.net>2009-06-16 02:17:16 (GMT)
committer Richard Darst <rkd@zgib.net>2009-06-16 02:17:16 (GMT)
commit45e106a7306ec7df2f4374ec3f9d9624223e1304 (patch)
tree2941fec2131c30641a32d8db408058e044e3652a /plugin.py
parentc271ffa81abfa97340a9183c18b3862a5735e287 (diff)
Updates to some bot owner commands
- Added commands: deletemeeting, addchair (existing commands: listmeetings savemeetings) - Change to anyone with the "admin" capability being able to run these. - These commands are designed so that the bot owner or admin can manage/ rescue/save meetings on other channels, even if the owner was not involved in starting the meeting. - These *are* regular supybot commands. They aren't designed for normal users. darcs-hash:20090616021716-82ea9-da24d54daac46c7929c0a577cb4c0fb29170ea4d.gz
Diffstat (limited to 'plugin.py')
-rw-r--r--plugin.py38
1 files changed, 35 insertions, 3 deletions
diff --git a/plugin.py b/plugin.py
index 839278d..2a43dad 100644
--- a/plugin.py
+++ b/plugin.py
@@ -106,6 +106,8 @@ class MeetBot(callbacks.Plugin):
#M.save() # now do_endmeeting in M calls the save functions
del meeting_cache[Mkey]
+ # These are admin commands, for use by the bot owner when there
+ # are many channels which may need to be independently managed.
def listmeetings(self, irc, msg, args):
"""List all currently-active meetings."""
reply = ""
@@ -114,15 +116,45 @@ class MeetBot(callbacks.Plugin):
irc.reply("No currently active meetings.")
else:
irc.reply(reply)
- listmeetings = wrap(listmeetings, ['private', 'owner'])
-
+ listmeetings = wrap(listmeetings, ['admin'])
def savemeetings(self, irc, msg, args):
"""Save all currently active meetings."""
numSaved = 0
for M in meeting_cache:
M.save()
irc.reply("Saved %d meetings."%numSaved)
- savemeetings = wrap(savemeetings, ['owner'])
+ savemeetings = wrap(savemeetings, ['admin'])
+ def addchair(self, irc, msg, args, channel, network, nick):
+ """<channel> <network> <nick>
+
+ Add a nick as a chair to the meeting."""
+ Mkey = (channel,network)
+ M = meeting_cache.get(Mkey, None)
+ if not M:
+ irc.reply("Meeting on channel %s, network %s not found"%(
+ channel, network))
+ return
+ M.chairs.setdefault(nick, True)
+ irc.reply("Chair added: %s on (%s, %s)."%(nick, channel, network))
+ addchair = wrap(addchair, ['admin', "channel", "something", "nick"])
+ def deletemeeting(self, irc, msg, args, channel, network, save):
+ """<channel> <network> <saveit=True>
+
+ Delete a meeting from the cache. If save is given, save the
+ meeting first, defaults to saving."""
+ Mkey = (channel,network)
+ if Mkey not in meeting_cache:
+ irc.reply("Meeting on channel %s, network %s not found"%(
+ channel, network))
+ return
+ if save:
+ M = meeting_cache.get(Mkey, None)
+ import time
+ M.endtime = time.localtime()
+ M.save()
+ irc.reply("Deleted: meeting on (%s, %s)."%(channel, network))
+ deletemeeting = wrap(deletemeeting, ['admin', "channel", "something",
+ optional("boolean", True)])
def pingall(self, irc, msg, args, message):
"""Send a broadcast ping to all users on the channel.