From f33343a8ca43af07f2d59f577b91d088d7e3550c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 4 Aug 2021 17:42:06 +0200 Subject: [PATCH] new quoi and remove dot --- main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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")