Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type support for Tweets with more than 280 characters #526

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/types/v2/tweet.definition.v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ export interface TweetOrganicMetricsV2 {

export type TweetPromotedMetricsV2 = TweetOrganicMetricsV2;

export interface NoteTweetV2 {
text: string;
entities?: NoteTweetEntitiesV2;
}

export type NoteTweetEntitiesV2 = Omit<TweetEntitiesV2, 'annotations'>;

export type TTweetReplySettingsV2 = 'mentionedUsers' | 'following' | 'everyone';

export interface SendTweetV2Params {
Expand Down Expand Up @@ -213,6 +220,7 @@ export interface TweetV2 {
lang?: string;
reply_settings?: 'everyone' | 'mentionedUsers' | 'following';
source?: string;
note_tweet?: NoteTweetV2;
}

export interface ApiV2Includes {
Expand Down
2 changes: 1 addition & 1 deletion src/types/v2/tweet.v2.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export type TTweetv2PollField = 'duration_minutes' | 'end_datetime' | 'id' | 'op
export type TTweetv2TweetField = 'attachments' | 'author_id' | 'context_annotations' | 'conversation_id'
| 'created_at' | 'entities' | 'geo' | 'id' | 'in_reply_to_user_id' | 'lang'
| 'public_metrics' | 'non_public_metrics' | 'promoted_metrics' | 'organic_metrics' | 'edit_controls'
| 'possibly_sensitive' | 'referenced_tweets' | 'reply_settings' | 'source' | 'text' | 'withheld';
| 'possibly_sensitive' | 'referenced_tweets' | 'reply_settings' | 'source' | 'text' | 'withheld' | 'note_tweet';
export type TTweetv2UserField = 'created_at' | 'description' | 'entities' | 'id' | 'location'
| 'name' | 'pinned_tweet_id' | 'profile_image_url' | 'protected' | 'public_metrics'
| 'url' | 'username' | 'verified' | 'verified_type' | 'withheld' | 'connection_status';
Expand Down