retweetbot worx again!
This commit is contained in:
parent
8ad4696179
commit
3fa47de34e
|
@ -194,6 +194,6 @@ if __name__ == "__main__":
|
|||
try:
|
||||
while True:
|
||||
bot.flow()
|
||||
sleep(3)
|
||||
sleep(6)
|
||||
except:
|
||||
bot.shutdown()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue