Skip to content

Commit

Permalink
feat: add moderation types (#1213)
Browse files Browse the repository at this point in the history
  • Loading branch information
myandrienko authored Jan 31, 2024
1 parent d2bf603 commit 2a13b05
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ export type MessageResponseBase<
};
latest_reactions?: ReactionResponse<StreamChatGenerics>[];
mentioned_users?: UserResponse<StreamChatGenerics>[];
moderation_details?: ModerationDetailsResponse;
own_reactions?: ReactionResponse<StreamChatGenerics>[] | null;
pin_expires?: string | null;
pinned_at?: string | null;
Expand All @@ -580,6 +581,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<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics> = {
user: UserResponse<StreamChatGenerics>;
created_at?: string;
Expand Down

0 comments on commit 2a13b05

Please sign in to comment.