From ee0a54addf415940f731fb229d5afb025acf5fe4 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 4 Aug 2021 17:38:15 +0200 Subject: [PATCH] new quoi and remove @ --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 5bef5f6..0851284 100644 --- a/main.py +++ b/main.py @@ -34,8 +34,8 @@ 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+", "", status._json["text"].lower()) - lastWord = tweetText.split()[-1:][0].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: answer = feur @@ -125,7 +125,7 @@ if __name__ == '__main__': errorMessage = "Error happens!" # error message # words to detect - quoiBase = ["quoi", "koi"] + quoiBase = ["quoi", "koi", "quoient"] ouiBase = ["oui", "ui"] nonBase = ["non", "nn"] universalBase = createBaseTrigger(quoiBase, ouiBase, nonBase)