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