h/plugins/help.py

18 lines
473 B
Python
Raw Normal View History

from util import hook
@hook.command
2010-02-02 04:42:34 +00:00
def help(inp, bot=None, pm=None):
".help [command] -- gives a list of commands/help for a command"
funcs = {}
for csig, func, args in bot.plugs['command']:
if args['hook'] != r'(.*)':
if func.__doc__ is not None:
funcs[csig[1]] = func
2010-02-02 04:42:34 +00:00
if not inp:
pm('available commands: ' + ' '.join(sorted(funcs)))
else:
2010-02-02 04:42:34 +00:00
if inp in funcs:
pm(funcs[inp].__doc__)