From 4c3cb0c9b75108ee89acbb42098a78c6aea40362 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Thu, 24 Apr 2014 14:15:58 -0700 Subject: [PATCH] allow nick blacklisting --- core/main.py | 8 ++++---- plugins/sieve.py | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/main.py b/core/main.py index bf93f9c..b8fa3d2 100644 --- a/core/main.py +++ b/core/main.py @@ -19,18 +19,18 @@ class Input(dict): def reply(msg): if chan == nick: # PMs don't need prefixes - conn.msg(chan, msg) + self.say(msg) else: - conn.msg(chan, nick + ': ' + msg) + self.say(nick + ': ' + msg) - def pm(msg): + def pm(msg, nick=nick): conn.msg(nick, msg) def set_nick(nick): conn.set_nick(nick) def me(msg): - conn.msg(chan, "\x01%s %s\x01" % ("ACTION", msg)) + self.say("\x01%s %s\x01" % ("ACTION", msg)) def notice(msg): conn.cmd('NOTICE', [nick, msg]) diff --git a/plugins/sieve.py b/plugins/sieve.py index 542d0a9..5685298 100644 --- a/plugins/sieve.py +++ b/plugins/sieve.py @@ -40,6 +40,9 @@ def sieve_suite(bot, input, func, kind, args): if 'blacklist' in acl: if func.__name__ in acl['whitelist']: return None + if 'blacklist-nicks' in acl: + if input.nick.lower() in acl['blacklist-nicks']: + return None if args.get('adminonly', False): admins = bot.config.get('admins', [])