Skip to content
Draft
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
6 changes: 6 additions & 0 deletions packages/web-api/src/types/request/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions packages/web-api/src/types/request/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ export type ChatScheduledMessagesListArguments = OptionalArgument<
>;

export interface ChatStartStreamArguments extends TokenOverridable, Channel, Partial<MarkdownText>, 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.
Expand All @@ -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 &
Expand Down
17 changes: 17 additions & 0 deletions packages/web-api/test/types/methods/assistant.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,23 @@ expectAssignable<Parameters<typeof web.assistant.threads.setStatus>>([
loading_messages: ['counting sheep...', 'moving bricks...'],
},
]);
expectAssignable<Parameters<typeof web.assistant.threads.setStatus>>([
{
channel_id: 'C1234',
thread_ts: '123.123',
status: 'counting...',
username: 'Abacus',
icon_emoji: 'abacus',
},
]);
expectAssignable<Parameters<typeof web.assistant.threads.setStatus>>([
{
channel_id: 'C1234',
thread_ts: '123.123',
status: 'dreaming...',
icon_url: 'https://example.com/clouds-square.png',
},
]);

// assistant.threads.setSuggestedPrompts
// -- sad path
Expand Down
15 changes: 15 additions & 0 deletions packages/web-api/test/types/methods/chat.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,21 @@ expectAssignable<Parameters<typeof web.chat.startStream>>([
recipient_user_id: 'U1234',
},
]);
expectAssignable<Parameters<typeof web.chat.startStream>>([
{
channel: 'C1234',
thread_ts: '1234.56',
username: 'Abacus',
icon_emoji: 'abacus',
},
]);
expectAssignable<Parameters<typeof web.chat.startStream>>([
{
channel: 'C1234',
thread_ts: '1234.56',
icon_url: 'https://example.com/clouds-square.png',
},
]);

// chat.stopStream
// -- sad path
Expand Down