Don't show disabled commands.

This commit is contained in:
rainyday 2010-11-22 13:28:45 +08:00 committed by rmmh
parent d81aa6d7fb
commit 4d0d730a75
1 changed files with 7 additions and 6 deletions

View File

@ -8,16 +8,17 @@ def help(inp, bot=None, pm=None):
".help [command] -- gives a list of commands/help for a command"
funcs = {}
disabled = bot.config.get('disabled_plugins', [])
for command, (func, args) in bot.commands.iteritems():
fn = re.match(r'^plugins.(.+).py$', func._filename)
disabled = bot.config.get('disabled_plugins', [])
if fn.group(1).lower() not in disabled:
if func.__doc__ is not None:
if func in funcs:
if len(funcs[func]) < len(command):
if command not in bot.config.get('disabled_commands', []):
if func.__doc__ is not None:
if func in funcs:
if len(funcs[func]) < len(command):
funcs[func] = command
else:
funcs[func] = command
else:
funcs[func] = command
commands = dict((value, key) for key, value in funcs.iteritems())