From 80981dacdf534e766f95b0a4a3b70658cad02342 Mon Sep 17 00:00:00 2001 From: Matvei Andrienko Date: Thu, 25 Jan 2024 15:21:48 +0100 Subject: [PATCH 1/2] feat: add moderation types --- src/types.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/types.ts b/src/types.ts index 9aefd6235..d6b4f9e01 100644 --- a/src/types.ts +++ b/src/types.ts @@ -558,6 +558,7 @@ export type MessageResponseBase< }; latest_reactions?: ReactionResponse[]; mentioned_users?: UserResponse[]; + moderation_details?: ModerationDetailsResponse; own_reactions?: ReactionResponse[] | null; pin_expires?: string | null; pinned_at?: string | null; @@ -571,6 +572,18 @@ export type MessageResponseBase< updated_at?: string; }; +export type ModerationDetailsResponse = { + action: 'MESSAGE_RESPONSE_ACTION_BOUNCE' | string; + error_msg: string; + harms: ModerationHarmResponse[]; + original_text: string; +}; + +export type ModerationHarmResponse = { + name: string; + phrase_list_ids: number[]; +}; + export type MuteResponse = { user: UserResponse; created_at?: string; From f906c9e89ef73248d0fadfe7fc14613e3c711659 Mon Sep 17 00:00:00 2001 From: Matvei Andrienko Date: Thu, 25 Jan 2024 15:29:15 +0100 Subject: [PATCH 2/2] feat: nicer autocomplete --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index d6b4f9e01..dada8a3d9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -573,7 +573,7 @@ export type MessageResponseBase< }; export type ModerationDetailsResponse = { - action: 'MESSAGE_RESPONSE_ACTION_BOUNCE' | string; + action: 'MESSAGE_RESPONSE_ACTION_BOUNCE' | (string & {}); error_msg: string; harms: ModerationHarmResponse[]; original_text: string;