def handle_list(bot, ievent): """ list [<plugin>] .. list loaded plugins or list commands provided by \ plugin. """ try: what = ievent.args[0] except: # no arguments given .. show plugins ievent.reply('\002loaded plugins:\002 ', plugins.list()) return # show commands of <what> plugin result = [] for i, j in cmnds.items(): if what == j.plugname: txt = "" alias = aliasreverse(i) if alias: txt += "%s (%s)" % (i, alias) else: txt = i if txt: result.append(txt) if result: result.sort() ievent.reply('%s has the following commands: ' % what, result) else: ievent.reply('no commands found for plugin %s' % what)
def handle_available(bot, ievent): """ available .. show what plugins are available. """ l = Set(plugins.list()) ondisk = Set(plugins.available()) diff = list(ondisk - l) diff.sort() ievent.reply('\002available plugins:\002 (reload to enable): ', diff)