From c60cd56dfde85012f0e78c0a90aa131dd9586701 Mon Sep 17 00:00:00 2001 From: Lucy Joshua <43093984+notBscalE@users.noreply.github.com> Date: Sat, 25 Feb 2023 00:27:10 +0200 Subject: [PATCH] Error Handling (#5) * Update BotYamPoster.py Error handler * Update main.py * Update BotYamPoster.py lol --- src/BotYamPoster.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BotYamPoster.py b/src/BotYamPoster.py index 1cfd605..d057015 100644 --- a/src/BotYamPoster.py +++ b/src/BotYamPoster.py @@ -13,11 +13,11 @@ def post_reply(conn, victim_bank, tweet, words, reply_text_bank, postcounter): # Post reply try: if tweet.data['author_id'] in victim_bank['author_id'] and not "@FromBotYam" in tweet.data['text']: - reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text - res = conn.api.create_tweet( + reply_text = victim_bank['reply'][random.randint(0,2)] + "\nו" + reply_text + res = conn.api.create_tweet( text=reply_text, in_reply_to_tweet_id=tweet["id"] - ) + ) except tweepy.errors.TwitterServerError as e: print("ERROR: An error occured, we'll try again in a few minutes. The error: " + str(e)) try: