From 9d47e527822d26cc2c5daba82c94dd19b9cb06fe Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 4 Aug 2021 15:27:23 +0200 Subject: [PATCH] handle spam for the "ui" word ("uiiii") --- main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.py b/main.py index e3cd10b..f4539c1 100644 --- a/main.py +++ b/main.py @@ -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+| +?\?|\?| +?\!| ?\!|-|~', '', status._json["text"]) + tweetText = sub(r'https?:\/\/\S+| +?\?|\?| +?\!| ?\!|-|~', '', sub(r'(?<=ui)i+', '', status._json["text"].lower())) lastWord = tweetText.split()[-1:][0].lower() if lastWord in universalBase: if lastWord in quoiBase: