1 | import { removeObjectEmptyFields } from "https://deno.land/x/[email protected]/mod.ts"; |
2 | import { SlackAPI } from "https://deno.land/x/[email protected]/mod.ts"; |
3 |
|
4 | |
5 | * @param cursor Paginate the list of users by setting the cursor parameter |
6 | * to a `next_cursor` attribute returned by a previous request's |
7 | * `response_metadata`. Default value fetches the first "page" of the users. |
8 | * Used in conjunction with `limit`. |
9 | * |
10 | * @param limit The maximum number of users to return. Fewer than the |
11 | * requested number of users may be returned, even if the end of the result |
12 | * list hasn't been reached. |
13 | * Used in conjunction with `cursor`. |
14 | */ |
15 | type Slack = { |
16 | token: string; |
17 | }; |
18 | export async function main(auth: Slack, cursor?: string, limit?: number) { |
19 | const client = SlackAPI(auth.token); |
20 | const params = removeObjectEmptyFields({ cursor, limit }); |
21 | return await client.users.list(params); |
22 | } |
23 |
|