Skip to content

Commit

Permalink
Add help text
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Nov 27, 2012
1 parent a21ffeb commit 80a5510
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugins/Helpers/plugin.py
Expand Up @@ -78,6 +78,8 @@ def _calledByOwner(self, irc, msg, args):
return False

def add(self, irc, msg, args, channel, op):
"""<op>
Add user <op> to the helpers list"""
if self._calledByOwner(irc, msg, args):
if op in self._ops(channel):
irc.error("%s is already listed as a %s helper" % (op, channel), prefixNick=False)
Expand All @@ -89,6 +91,8 @@ def add(self, irc, msg, args, channel, op):
add = wrap(add, ['channeldb', 'nick'])

def remove(self, irc, msg, args, channel, op):
"""<op>
Remove user <op> from the helpers list"""
if self._calledByOwner(irc, msg, args):
ids = [r.id for r in self.db.select(channel, lambda r: r.op == op)]
if len(ids) == 0:
Expand All @@ -99,7 +103,9 @@ def remove(self, irc, msg, args, channel, op):
irc.reply("The operation suceeded.", prefixNick=False)
remove = wrap(remove, ['channeldb', 'nick'])

def helpers(self, irc, msg, args, opts, channel):
def list(self, irc, msg, args, opts, channel):
"""[--all]
List channel members who are available to help navigate channel/conference/mailing list difficulties"""
ops = self._ops(channel)
if len(ops) == 0:
irc.reply("No channel helpers listed for %s" % channel)
Expand All @@ -121,7 +127,8 @@ def helpers(self, irc, msg, args, opts, channel):
else:
irc.reply("%s: %s" % (prefix, ", ".join(ops)), prefixNick=False)

helpers = wrap(helpers, [getopts({'all':''}),'channeldb'])
list = wrap(list, [getopts({'all':''}),'channeldb'])
helpers = list

def janitors(self, irc, msg, args, channel):
if channel == '#code4lib':
Expand Down

0 comments on commit 80a5510

Please sign in to comment.