From 70f2f1a14086f5b22407f74708062906bc6917cf Mon Sep 17 00:00:00 2001 From: PC0011_ Date: Sun, 23 Jun 2024 18:20:28 +0800 Subject: [PATCH] Add support for note_tweet field in requests and replies to handle long tweets --- fields/tweet_fields.go | 1 + resources/tweet.go | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/fields/tweet_fields.go b/fields/tweet_fields.go index 7f27808..2d7c322 100644 --- a/fields/tweet_fields.go +++ b/fields/tweet_fields.go @@ -23,6 +23,7 @@ const ( TweetFieldSource TweetField = "source" TweetFieldText TweetField = "text" TweetFieldWithheld TweetField = "withheld" + TweetFieldNoteTweet TweetField = "note_tweet" ) func (f TweetField) String() string { diff --git a/resources/tweet.go b/resources/tweet.go index 7b77019..48d56e4 100644 --- a/resources/tweet.go +++ b/resources/tweet.go @@ -24,6 +24,7 @@ type Tweet struct { ReplySettings *string `json:"reply_settings,omitempty"` Source *string `json:"source,omitempty"` Withheld *TweetWithheld `json:"withheld,omitempty"` + NoteTweet *TweetNoteTweet `json:"note_tweet,omitempty"` } type TweetAttachments struct { @@ -132,3 +133,13 @@ type TweetWithheld struct { Copyright *bool `json:"copyright"` CountryCodes []*string `json:"country_codes"` } + +type TweetNoteTweet struct { + Entities struct { + CashTags []TweetEntityTag `json:"cashtags"` + HashTags []TweetEntityTag `json:"hashtags"` + Mentions []TweetEntityTag `json:"mentions"` + URLs []URL `json:"urls"` + } `json:"entities"` + Text *string `json:"text"` +}