Closed jiangzhuo closed 1 month ago
This pull request fixes the handling of note tweets in the create_tweet
method by correctly accessing the tweet results based on whether it's a note tweet or a regular tweet.
sequenceDiagram
participant User
participant Client
participant Server
User->>Client: Call create_tweet(is_note_tweet)
alt is_note_tweet
Client->>Server: Request notetweet_create
Server-->>Client: Response with notetweet_create['tweet_results']
else is not note_tweet
Client->>Server: Request create_tweet
Server-->>Client: Response with create_tweet['tweet_results']
end
Client->>User: Return tweet_results
Change | Details | Files |
---|---|---|
Modified the tweet result extraction logic to handle note tweets differently |
|
twikit/client/client.py |
The changes in this pull request modify the create_tweet
method of the Client
class in the twikit/client/client.py
file. The main adjustment involves the conditional retrieval of results from the response, differentiating between community notes and standard tweets. If the tweet is a community note, the result is accessed from a specific path in the response; otherwise, it follows the standard path. Minor updates to documentation strings for the method also clarify its parameters and examples.
File | Change Summary |
---|---|
twikit/client/client.py | Updated create_tweet method to conditionally handle community notes versus standard tweets. Adjusted documentation strings for clarity. |
In the meadow where tweets take flight,
A note of community shines so bright.
With logic refined, our tweets now align,
Each message crafted, a joy to define.
Hopping with glee, we share what we create,
In the world of tweets, oh, isn't it great! 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
This also resolve #201
Check complete, merging
is_note_tweet
in thecreate_tweet
method to ensure proper handling of note tweets.Summary by Sourcery
Fix the conditional logic in the create_tweet method to ensure note tweets are processed correctly.
Bug Fixes:
Summary by CodeRabbit
New Features
Documentation
create_tweet
method to clarify parameters and examples.