better regex

This commit is contained in:
Mylloon 2021-08-04 15:40:46 +02:00
parent 9d47e52782
commit fc78ca46f0

View file

@ -33,7 +33,7 @@ class Listener(StreamListener):
"""Answer to tweets."""
if status._json["user"]["id"] in self.listOfFriendsID:
if seniority(status._json["created_at"]):
tweetText = sub(r'https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~', '', sub(r'(?<=ui)i+', '', status._json["text"].lower()))
tweetText = sub(r"https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~|(?<=ui)i+", "", status._json["text"].lower())
lastWord = tweetText.split()[-1:][0].lower()
if lastWord in universalBase:
if lastWord in quoiBase: