2010-01-17 04:24:36 +00:00
|
|
|
from util import hook
|
|
|
|
|
|
|
|
@hook.command
|
|
|
|
def help(bot, input):
|
|
|
|
".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-01-17 23:07:08 +00:00
|
|
|
if not input.inp:
|
2010-01-17 04:24:36 +00:00
|
|
|
input.pm('available commands: ' + ' '.join(sorted(funcs)))
|
|
|
|
else:
|
|
|
|
if input.inp in funcs:
|
|
|
|
input.pm(funcs[input.inp].__doc__)
|