diff --git a/main.py b/main.py index 0851284..2155377 100644 --- a/main.py +++ b/main.py @@ -34,7 +34,7 @@ class Listener(StreamListener): if status._json["user"]["id"] in self.listOfFriendsID: # verification of the author of the tweet if seniority(status._json["created_at"]): # verification of the age of the tweet # recovery of the last "usable" word of the tweet - tweetText = sub(r"https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~|(?<=ui)i+|@\S+", "", status._json["text"].lower()) + tweetText = sub(r"https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~|(?<=ui)i+|@\S+|\.+", "", status._json["text"].lower()) lastWord = tweetText.split()[-1:][0] if lastWord in universalBase: # check if the last word found is a supported word if lastWord in quoiBase: @@ -125,7 +125,7 @@ if __name__ == '__main__': errorMessage = "Error happens!" # error message # words to detect - quoiBase = ["quoi", "koi", "quoient"] + quoiBase = ["quoi", "koi", "quoient", "q u o i"] ouiBase = ["oui", "ui"] nonBase = ["non", "nn"] universalBase = createBaseTrigger(quoiBase, ouiBase, nonBase) @@ -135,7 +135,7 @@ if __name__ == '__main__': # creation of answers feur = createBaseAnswers("feur") - feur.extend(["https://twitter.com/shukuzi62/status/1422611919538724868/video/1", "feur (-isson)"]) # add a message in addition to the default answers + feur.extend(["https://twitter.com/shukuzi62/status/1422611919538724868/video/1", "feur (-isson)", "https://twitter.com/antoinelae/status/1422943594403581957/video/1"]) # add a message in addition to the default answers stiti = createBaseAnswers("stiti") bril = createBaseAnswers("bril")