This commit is contained in:
Mylloon 2022-08-14 19:00:11 +02:00
parent 86b661c9c9
commit 76fffd0269
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

17
main.py
View file

@ -107,22 +107,26 @@ class Listener(StreamingClient):
if tweet.id != tweet.conversation_id:
if keys["VERBOSE"]:
print("Thread...", end=" ")
base_tweet = self.client.get_tweet(id=tweet.conversation_id, tweet_fields="author_id", user_auth=True).data
base_tweet = self.client.get_tweet(
id=tweet.conversation_id, tweet_fields="author_id", user_auth=True).data
# Sometimes Twitter don't give what we want
if hasattr(base_tweet, 'author_id'):
base_author = self._get_user(base_tweet.author_id)
# Check if account is in private mode
if base_author.protected:
if keys["VERBOSE"]:
print("Auteur du premier tweet en privé, pas de réponses.")
print(
"Auteur du premier tweet en privé, pas de réponses.")
return
else:
if keys["VERBOSE"]:
print("Auteur du premier tweet en publique...", end=" ")
print(
"Auteur du premier tweet en publique...", end=" ")
else:
# Can't check the status of the first tweet in the thread, ignoring for safety
if keys["VERBOSE"]:
print("Impossible de vérifier le status de l'auteur du fil.")
print(
"Impossible de vérifier le status de l'auteur du fil.")
return
else:
# Can't check if we're in a thread or not
@ -471,7 +475,10 @@ if __name__ == "__main__":
"oui": createBaseAnswers("stiti")
+ createBaseAnswers("fi"),
"non": createBaseAnswers("bril"),
"non": createBaseAnswers("bril")
+ [
"bril (-liant)"
],
"nan": createBaseAnswers("cy"),