Skip to content

Commit

Permalink
Merge pull request #313 from NHypocrite/add-note_tweet-support
Browse files Browse the repository at this point in the history
Add Support for Handling Long Tweets with note_tweet Field
  • Loading branch information
michimani authored Jun 25, 2024
2 parents eaa8692 + 70f2f1a commit 370f3eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions fields/tweet_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const (
TweetFieldSource TweetField = "source"
TweetFieldText TweetField = "text"
TweetFieldWithheld TweetField = "withheld"
TweetFieldNoteTweet TweetField = "note_tweet"
)

func (f TweetField) String() string {
Expand Down
11 changes: 11 additions & 0 deletions resources/tweet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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"`
}

0 comments on commit 370f3eb

Please sign in to comment.