diff --git a/src/types.ts b/src/types.ts index a84e196de..bf80fc449 100644 --- a/src/types.ts +++ b/src/types.ts @@ -678,7 +678,8 @@ export type MessageResponseBase< latest_reactions?: ReactionResponse[]; mentioned_users?: UserResponse[]; message_text_updated_at?: string; - moderation_details?: ModerationDetailsResponse; + moderation?: ModerationResponse; // present only with Moderation v2 + moderation_details?: ModerationDetailsResponse; // present only with Moderation v1 own_reactions?: ReactionResponse[] | null; pin_expires?: string | null; pinned_at?: string | null; @@ -713,6 +714,18 @@ export type ModerationHarmResponse = { phrase_list_ids: number[]; }; +export type ModerationAction = 'bounce' | 'flag' | 'remove' | 'shadow'; + +export type ModerationResponse = { + action: ModerationAction; + original_text: string; + blocklist_matched?: string; + image_harms?: string[]; + platform_circumvented?: boolean; + semantic_filter_matched?: string; + text_harms?: string[]; +}; + export type MuteResponse = { user: UserResponse; created_at?: string;