From e347f7fcb7e29da710e81ffd2ebf5da4137f4706 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 8 Aug 2022 02:29:40 +0200 Subject: [PATCH] fix bug with hashtag tweets --- main.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 1b5d950..41d276f 100644 --- a/main.py +++ b/main.py @@ -122,7 +122,8 @@ class Listener(StreamingClient): print( f"Tweet trouvé de {username} ({infoLastWord})...", end=" ") - if len(lastWord) > 0: + # Hashtag tweet + if len(lastWord) == 0: return # Fetch the last word of the tweet @@ -163,8 +164,8 @@ class Listener(StreamingClient): print(f"Envoie d'un {answer[0]}...", end=" ") try: # Send the tweet with the answer - self.client.create_tweet( - in_reply_to_tweet_id=tweet.id, text=choice(answer)) + """ self.client.create_tweet( + in_reply_to_tweet_id=tweet.id, text=choice(answer)) """ print(f"{username} s'est fait {answer[0]} !") except Exception as error: error = loads(error.response.text)["errors"][0]