Update plugins/sieve.py

This commit is contained in:
lukeroge 2012-03-29 11:23:20 +13:00
parent 36d7d0a1cc
commit 67d0eb1b2f

View file

@ -6,17 +6,13 @@ from util import hook
@hook.sieve
def sieve_suite(bot, input, func, kind, args):
if input.command == 'PRIVMSG' and \
input.nick.lower()[-3:] == 'bot' and args.get('ignorebots', True):
input.nick.endswith('bot') and args.get('ignorebots', True):
return None
if kind == "command":
if input.trigger in bot.config.get('disabled_commands', []):
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)
disabled = bot.config.get('disabled_plugins', [])
if fn and fn.group(1).lower() in disabled:
@ -36,8 +32,7 @@ def sieve_suite(bot, input, func, kind, args):
if args.get('adminonly', False):
admins = bot.config.get('admins', [])
if input.mask not in admins and input.nick not in admins:
return None
return input
return input