From 01a7c92fbd868a092ea1d11f7eb5411cbf0480a4 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 17:45:19 -0800 Subject: [PATCH] feat(web-api): add authorship arguments to assistant threads and chat stream --- packages/web-api/src/types/request/assistant.ts | 6 ++++++ packages/web-api/src/types/request/chat.ts | 12 ++++++++++++ .../test/types/methods/assistant.test-d.ts | 17 +++++++++++++++++ .../web-api/test/types/methods/chat.test-d.ts | 15 +++++++++++++++ 4 files changed, 50 insertions(+) diff --git a/packages/web-api/src/types/request/assistant.ts b/packages/web-api/src/types/request/assistant.ts index b3103a73d..56e860422 100644 --- a/packages/web-api/src/types/request/assistant.ts +++ b/packages/web-api/src/types/request/assistant.ts @@ -8,8 +8,14 @@ export interface AssistantThreadsSetStatusArguments extends TokenOverridable { status: string; /** @description Message timestamp of the thread. */ thread_ts: string; + /** @description Emoji to use as the icon for this message. Overrides `icon_url`. */ + icon_emoji?: string; + /** @description URL to an image to use as the icon for this message. The `icon_emoji` field takes precendence over this field. */ + icon_url?: string; /** @description The list of messages to rotate through as a loading indicator. */ loading_messages?: string[]; + /** @description Set your bot's username. */ + username?: string; } // https://docs.slack.dev/reference/methods/assistant.threads.setSuggestedPrompts diff --git a/packages/web-api/src/types/request/chat.ts b/packages/web-api/src/types/request/chat.ts index 7734d7a7f..40d264e2d 100644 --- a/packages/web-api/src/types/request/chat.ts +++ b/packages/web-api/src/types/request/chat.ts @@ -233,6 +233,14 @@ export type ChatScheduledMessagesListArguments = OptionalArgument< >; export interface ChatStartStreamArguments extends TokenOverridable, Channel, Partial, ThreadTS { + /** + * @description Emoji to use as the icon for this message. Overrides `icon_url`. + */ + icon_emoji?: string; + /** + * @description URL to an image to use as the icon for this message. The `icon_emoji` field takes precendence over this field. + */ + icon_url?: string; /** * @description The ID of the team that is associated with `recipient_user_id`. * This is required when starting a streaming conversation outside of a DM. @@ -243,6 +251,10 @@ export interface ChatStartStreamArguments extends TokenOverridable, Channel, Par * This is required when starting a streaming conversation outside of a DM. */ recipient_user_id?: string; + /** + * @description Set your bot's username. + */ + username?: string; } export type ChatStopStreamArguments = TokenOverridable & diff --git a/packages/web-api/test/types/methods/assistant.test-d.ts b/packages/web-api/test/types/methods/assistant.test-d.ts index 492f9b6d7..a55ee4687 100644 --- a/packages/web-api/test/types/methods/assistant.test-d.ts +++ b/packages/web-api/test/types/methods/assistant.test-d.ts @@ -46,6 +46,23 @@ expectAssignable>([ loading_messages: ['counting sheep...', 'moving bricks...'], }, ]); +expectAssignable>([ + { + channel_id: 'C1234', + thread_ts: '123.123', + status: 'counting...', + username: 'Abacus', + icon_emoji: 'abacus', + }, +]); +expectAssignable>([ + { + channel_id: 'C1234', + thread_ts: '123.123', + status: 'dreaming...', + icon_url: 'https://example.com/clouds-square.png', + }, +]); // assistant.threads.setSuggestedPrompts // -- sad path diff --git a/packages/web-api/test/types/methods/chat.test-d.ts b/packages/web-api/test/types/methods/chat.test-d.ts index f1ec5f025..8f76d11e3 100644 --- a/packages/web-api/test/types/methods/chat.test-d.ts +++ b/packages/web-api/test/types/methods/chat.test-d.ts @@ -640,6 +640,21 @@ expectAssignable>([ recipient_user_id: 'U1234', }, ]); +expectAssignable>([ + { + channel: 'C1234', + thread_ts: '1234.56', + username: 'Abacus', + icon_emoji: 'abacus', + }, +]); +expectAssignable>([ + { + channel: 'C1234', + thread_ts: '1234.56', + icon_url: 'https://example.com/clouds-square.png', + }, +]); // chat.stopStream // -- sad path