From b84d1304f2b9bc3a2803d042c477431b972af128 Mon Sep 17 00:00:00 2001 From: jiangzhuo Date: Tue, 8 Oct 2024 19:03:35 +0900 Subject: [PATCH] Fix: Correct handling of note tweets in create_tweet method - Fixed the conditional check for `is_note_tweet` in the `create_tweet` method to ensure proper handling of note tweets. --- twikit/client/client.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/twikit/client/client.py b/twikit/client/client.py index 1f865f4d..797831a8 100644 --- a/twikit/client/client.py +++ b/twikit/client/client.py @@ -1238,7 +1238,10 @@ async def create_tweet( reply_to, attachment_url, community_id, share_with_followers, richtext_options, edit_tweet_id, limit_mode ) - _result = response['data']['create_tweet']['tweet_results'] + if is_note_tweet: + _result = response['data']['notetweet_create']['tweet_results'] + else: + _result = response['data']['create_tweet']['tweet_results'] if not _result: raise_exceptions_from_response(response['errors']) raise CouldNotTweet(