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

Function getSlackChannels

server/src/slack/client.ts:638–668  ·  view source on GitHub ↗
(
  options: { types?: string; exclude_archived?: boolean } = {}
)

Source from the content-addressed store, hash-verified

636 * Get all channels in the workspace (public channels only by default)
637 */
638export async function getSlackChannels(
639 options: { types?: string; exclude_archived?: boolean } = {}
640): Promise<SlackChannel[]> {
641 const channels: SlackChannel[] = [];
642 let cursor: string | undefined;
643
644 do {
645 const response = await slackRequest<SlackPaginatedResponse<SlackChannel>>(
646 'conversations.list',
647 {
648 types: options.types || 'public_channel',
649 exclude_archived: options.exclude_archived ?? true,
650 limit: 200,
651 cursor,
652 }
653 );
654
655 if (response.channels) {
656 channels.push(...response.channels);
657 }
658
659 cursor = response.response_metadata?.next_cursor;
660
661 if (cursor) {
662 await sleep(RATE_LIMIT_DELAY_MS);
663 }
664 } while (cursor);
665
666 logger.info({ count: channels.length }, 'Fetched Slack channels');
667 return channels;
668}
669
670/**
671 * Get channel info by ID (cached for 30 minutes)

Callers 4

runSlackHistoryBackfillFunction · 0.85
createAdminToolHandlersFunction · 0.85
findChannelWithAccessFunction · 0.85

Calls 1

sleepFunction · 0.70

Tested by

no test coverage detected