From 608427e4c6f0f4568751dd660829a1b81652ea32 Mon Sep 17 00:00:00 2001 From: muskit <15199219+muskit@users.noreply.github.com> Date: Sun, 27 Aug 2023 02:57:20 -0700 Subject: [PATCH] fix ttweet's quote tweet if trying again after rate limit --- src/twapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/twapi.py b/src/twapi.py index c7afa1a..42e52b6 100644 --- a/src/twapi.py +++ b/src/twapi.py @@ -94,9 +94,9 @@ class TwAPI: return tweet except tweepy.TooManyRequests as e: wait_for = abs(float(e.response.headers["x-rate-limit-reset"]) - datetime.datetime.now().timestamp()) + 1 - print(f'\thit rate limit -- attempting to create Tweet again in {wait_for} seconds...') + print(f'\thit rate limit: trying again in {wait_for}s...') await asyncio.sleep(wait_for) - return await self.post_tweet(text=text, media_ids=media_ids, reply_to_tweet=reply_to_tweet) + return await self.post_tweet(text=text, media_ids=media_ids, reply_to_tweet=reply_to_tweet, quote_tweet_id=quote_tweet_id) async def get_ttweet_image_media_id(self, ttweet): img = await util.create_ttweet_image(ttweet)