retweetbot worx again!

This commit is contained in:
b3yond 2017-06-25 23:50:58 +02:00
parent 8ad4696179
commit 3fa47de34e
2 changed files with 3 additions and 4 deletions

View file

@ -194,6 +194,6 @@ if __name__ == "__main__":
try:
while True:
bot.flow()
sleep(3)
sleep(6)
except:
bot.shutdown()

View file

@ -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