Skip to content

Commit

Permalink
Don't show disabled commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
rainyday authored and rmmh committed Nov 25, 2010
1 parent d81aa6d commit 4d0d730
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions plugins/help.py
Expand Up @@ -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())

Expand Down

0 comments on commit 4d0d730

Please sign in to comment.