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

Function getSlackUsers

server/src/slack/client.ts:207–231  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205 * Handles pagination automatically
206 */
207export async function getSlackUsers(): Promise<SlackUser[]> {
208 const users: SlackUser[] = [];
209 let cursor: string | undefined;
210
211 do {
212 const response = await slackRequest<SlackPaginatedResponse<SlackUser>>('users.list', {
213 limit: 200,
214 cursor,
215 });
216
217 if (response.members) {
218 users.push(...response.members);
219 }
220
221 cursor = response.response_metadata?.next_cursor;
222
223 // Small delay between paginated requests
224 if (cursor) {
225 await sleep(RATE_LIMIT_DELAY_MS);
226 }
227 } while (cursor);
228
229 logger.debug({ count: users.length }, 'Fetched Slack users');
230 return users;
231}
232
233/**
234 * Get a single user by ID

Callers 2

mainFunction · 0.85
syncSlackUsersFunction · 0.85

Calls 1

sleepFunction · 0.70

Tested by

no test coverage detected