/** * `conversations.members` with a specific bot token — who is actually in a * Slack channel, read by one of the agents' own bots (the workspace bot is * usually not in a private room). * * @module services/slack/slack-channel-members */ /** Result of a member read. */ export type ChannelMembersResult = { ok: true; members: string[]; } | { ok: false; error: string; }; /** * Member user ids of a channel, bots included, as `token`'s bot sees it. * Never throws. * * @param channelId - Slack channel id * @param token - A bot token * @param fetchImpl - fetch (injectable for tests) * @returns The members, or Slack's error (`not_in_channel` / `channel_not_found` * mean this bot is not in the channel) */ export declare function listChannelMembersWithToken(channelId: string, token: string, fetchImpl?: typeof fetch): Promise; /** Result of a single Slack Web API call made with a bot token. */ export type SlackTokenCallResult = { ok: true; body: Record; } | { ok: false; error: string; }; /** * One Slack Web API call (form-encoded POST) with a specific bot token. * Never throws: network failures and Slack refusals come back as `error`. * * Used for the channel operations an agent's own bot can do in a room the * workspace bot is not in (a private channel the owner invited agents to): * read its name, invite another agent's bot, leave, rename. * * @param method - Web API method, e.g. `conversations.info` * @param params - Form fields * @param token - A bot token * @param fetchImpl - fetch (injectable for tests) * @returns The response body, or Slack's error code */ export declare function slackCallWithToken(method: string, params: Record, token: string, fetchImpl?: typeof fetch): Promise; /** Channel operations with an agent's own bot token (see {@link slackCallWithToken}). */ export interface ChannelTokenOps { /** `conversations.info` → the channel's current name. */ info(channelId: string, token: string): Promise<{ ok: true; name: string; isArchived: boolean; } | { ok: false; error: string; }>; /** `conversations.invite` → put a user (another agent's bot) into the channel. */ invite(channelId: string, userId: string, token: string): Promise<{ ok: boolean; error?: string; }>; /** `conversations.leave` → the token's own bot leaves the channel. */ leave(channelId: string, token: string): Promise<{ ok: boolean; error?: string; }>; /** `chat.postMessage` as the token's bot. */ post(channelId: string, text: string, token: string): Promise<{ ok: boolean; error?: string; }>; /** `conversations.rename` → the name Slack applied. */ rename(channelId: string, name: string, token: string): Promise<{ ok: true; name: string; } | { ok: false; error: string; }>; } /** * The default {@link ChannelTokenOps}, over the real Slack Web API. * * @param fetchImpl - fetch (injectable for tests) * @returns The ops */ export declare function createChannelTokenOps(fetchImpl?: typeof fetch): ChannelTokenOps; //# sourceMappingURL=slack-channel-members.d.ts.map