From 29f6f1fdaa627c8579e4b88587edf953ace136e6 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Thu, 18 Aug 2016 22:24:04 +0100 Subject: [PATCH] spammer: triggers don't have to be lowercase anymore Also add "allah is doing" --- tipbot/modules/spammer.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tipbot/modules/spammer.py b/tipbot/modules/spammer.py index f27b2a5..72205ea 100644 --- a/tipbot/modules/spammer.py +++ b/tipbot/modules/spammer.py @@ -44,6 +44,13 @@ def OnUserJoined(event,*args,**kwargs): if nick=="lbft" or nick=="lbft_": Ban(link) +triggers=[l.lower() for l in [ + "astounding!", "triple your btc", "pm me to begin", "hatt uu", + "accelerate the blockchain", "u stappid", "me a message to begin", + "the ops have confirmed", "expanding technology", "exploding technology", + "allah is doing" +]] + def OnMessage(event,*args,**kwargs): line=kwargs['message'] if not line: @@ -54,11 +61,7 @@ def OnMessage(event,*args,**kwargs): line=line.lower().strip() log_info("Testing: " + line) - for expr in [ - "astounding!", "triple your btc", "pm me to begin", "hatt uu", - "accelerate the blockchain", "u stappid", "me a message to begin", - "the ops have confirmed", "expanding technology", "exploding technology" - ]: + for expr in triggers: if re.match(".*"+expr+".*",line): link=kwargs['link'] Ban(link)