def handle_perm(bot, ievent): """ arguments: <cmnd> - get permission of command. """ try:cmnd = ievent.args[0] except IndexError: ievent.missing("<cmnd>") return try: perms = cmnds.perms(cmnd) except KeyError: ievent.reply("no %sw command registered") return if perms: ievent.reply("%s command needs %s permission" % (cmnd, perms)) else: ievent.reply("can't find perm for %s" % cmnd)
def handle_help(bot, event): """ arguments: [<cmndname or plugname>] - show help. """ if not event.args: event.reply("documentation for tl can be found at http:///docs/tl") event.reply('see !list for loaded plugins and "!help plugin" for help on the plugin.') return t = event.args[0] logging.warn("help target is %s" % t) cmnds.reloadcheck(bot, event, t) where = cmnds.whereis(t) cmndhelp = cmnds.gethelp(t) if not cmndhelp: handle_helpplug(bot, event) ; return try: ex = examples[t].example except KeyError: ex = None p = cmnds.perms(t) res = "permissions: %s - location: %s - examples: %s" % (", ".join(p), where, ex) event.reply('help on %s command: %s' % (event.rest, cmndhelp), res.split(" - "), dot="<br>")