Skip to content

Commit

Permalink
Fix: Correct handling of note tweets in create_tweet method
Browse files Browse the repository at this point in the history
- Fixed the conditional check for `is_note_tweet` in the `create_tweet` method to ensure proper handling of note tweets.
  • Loading branch information
jiangzhuo committed Oct 8, 2024
1 parent 6d19016 commit b84d130
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion twikit/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b84d130

Please sign in to comment.