Cleaned up sieve.py a little.

This commit is contained in:
rainyday 2010-11-26 08:37:04 +08:00 committed by rmmh
parent 68f2680b54
commit b21c3e432f
1 changed files with 5 additions and 6 deletions

View File

@ -12,6 +12,11 @@ def sieve_suite(bot, input, func, kind, args):
if kind == "command": if kind == "command":
if input.trigger in bot.config.get('disabled_commands', []): if input.trigger in bot.config.get('disabled_commands', []):
return None return None
ignored = bot.config.get('ignored', []);
if input.host in ignored or input.nick in ignored:
return None
fn = re.match(r'^plugins.(.+).py$', func._filename) fn = re.match(r'^plugins.(.+).py$', func._filename)
disabled = bot.config.get('disabled_plugins', []) disabled = bot.config.get('disabled_plugins', [])
@ -35,10 +40,4 @@ def sieve_suite(bot, input, func, kind, args):
if input.host not in admins and input.nick not in admins: if input.host not in admins and input.nick not in admins:
return None return None
if kind == "command":
ignored = bot.config.get('ignored', []);
if input.host in ignored or input.nick in ignored:
return None
return input return input