From 3fa47de34e760038d7ab31dce80fe7d9a416dc56 Mon Sep 17 00:00:00 2001 From: b3yond Date: Sun, 25 Jun 2017 23:50:58 +0200 Subject: [PATCH] retweetbot worx again! --- retweetbot.py | 2 +- trigger.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/retweetbot.py b/retweetbot.py index 8467221..b082558 100644 --- a/retweetbot.py +++ b/retweetbot.py @@ -194,6 +194,6 @@ if __name__ == "__main__": try: while True: bot.flow() - sleep(3) + sleep(6) except: bot.shutdown() diff --git a/trigger.py b/trigger.py index a88993e..ffe3bee 100644 --- a/trigger.py +++ b/trigger.py @@ -23,7 +23,7 @@ class Trigger(object): for pattern in listfile: pattern = pattern.strip() if pattern: - self.goodlist.append(re.compile(pattern)) + self.goodlist.append(re.compile(pattern, re.IGNORECASE)) try: blacklistpath = config['trigger']['blacklist_path'] @@ -47,12 +47,11 @@ class Trigger(object): :return: If the string passes the test """ for pattern in self.goodlist: - if pattern.match(message): + if pattern.search(message) is not None: break else: # no pattern matched return False - for word in message.lower().split(): if word in self.blacklist: return False