MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / setAssistantStatus

Function setAssistantStatus

server/src/addie/handler.ts:902–922  ·  view source on GitHub ↗

* Set status message for Assistant thread * Uses Slack's assistant.threads.setStatus API

(channelId: string, status: string)

Source from the content-addressed store, hash-verified

900 * Uses Slack's assistant.threads.setStatus API
901 */
902async function setAssistantStatus(channelId: string, status: string): Promise<void> {
903 const token = process.env.ADDIE_BOT_TOKEN || process.env.SLACK_BOT_TOKEN;
904 if (!token) return;
905
906 const response = await fetch('https://slack.com/api/assistant.threads.setStatus', {
907 method: 'POST',
908 headers: {
909 'Authorization': `Bearer ${token}`,
910 'Content-Type': 'application/json',
911 },
912 body: JSON.stringify({
913 channel_id: channelId,
914 status,
915 }),
916 });
917
918 const data = await response.json() as { ok: boolean; error?: string };
919 if (!data.ok && data.error !== 'not_in_channel') {
920 logger.debug({ error: data.error }, 'Addie: Failed to set status');
921 }
922}
923
924/**
925 * Send a proactive message when a user links their account

Callers 1

handleAssistantMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected