Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/core/config.py b/core/config.py
- index 1b2cacb..f99d024 100644
- --- a/core/config.py
- +++ b/core/config.py
- @@ -21,6 +21,8 @@ if not os.path.exists('config'):
- },
- "disabled_plugins": [],
- "disabled_commands": [],
- + "enabled_commands": [],
- + "enabled_commands_propagate": 0,
- "acls": {},
- "api_keys": {},
- "censored_strings":
- diff --git a/plugins/help.py b/plugins/help.py
- index 5ff9992..bf44565 100644
- --- a/plugins/help.py
- +++ b/plugins/help.py
- @@ -10,16 +10,27 @@ def help(inp, bot=None, pm=None):
- funcs = {}
- disabled = bot.config.get('disabled_plugins', [])
- disabled_comm = bot.config.get('disabled_commands', [])
- + enabled_commands = bot.config.get('enabled_commands', [])
- + enabled_commands_propagate = bot.config.get('enabled_commands_propagate')
- for command, (func, args) in bot.commands.iteritems():
- fn = re.match(r'^plugins.(.+).py$', func._filename)
- if fn.group(1).lower() not in disabled:
- if command not in disabled_comm:
- - if func.__doc__ is not None:
- - if func in funcs:
- - if len(funcs[func]) < len(command):
- - funcs[func] = command
- - else:
- - funcs[func] = command
- + if enabled_commands_propagate:
- + if command in enabled_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:
- + if func.__doc__ is not None:
- + if func in funcs:
- + if len(funcs[func]) < len(command):
- + funcs[func] = command
- + else:
- + funcs[func] = command
- commands = dict((value, key) for key, value in funcs.iteritems())
- diff --git a/plugins/sieve.py b/plugins/sieve.py
- index 108390e..46824b6 100644
- --- a/plugins/sieve.py
- +++ b/plugins/sieve.py
- @@ -12,6 +12,9 @@ def sieve_suite(bot, input, func, kind, args):
- if kind == "command":
- if input.trigger in bot.config.get('disabled_commands', []):
- return None
- + if bot.config.get('enabled_commands_propagate'):
- + if input.trigger not in bot.config.get('enabled_commands', []):
- + return None
- ignored = bot.config.get('ignored', [])
- if input.host in ignored or input.nick in ignored:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement