Search... Ctrl + K

List Users (slack)
One script reply has been approved by the moderators Verified

Created by rosseastdene 187 days ago Used 197 times 0 Points

No comments yet

Points: 0
deno
One script reply has been approved by the moderators
Ap­pro­ved
import * as wmill from "https://deno.land/x/windmill@v1.12.0/index.ts";
import { WebClient } from "https://deno.land/x/slack_web_api@1.0.3/mod.ts";
/*
@param: {string} channel - encoded team id to list users in, required if org token is used.
@param: {boolean} include_locale - Set this to true to receive the locale for users. Defaults to false
@param: {number} limit - The maximum number of items to return.
*/

export async function main(
  slack_auth: wmill.Resource<"slack">,
  team_id: string,
  include_locale: boolean = false,
  limit: number = 0,
) {
  const web = new WebClient(slack_auth);

  let response = await web.users.list({
    team_id: team_id,
    include_locale: include_locale,
    limit: limit,
  });

  return { "response": response };
}

Submitted by rossmccrann 173 days ago

Edited 172 days ago

No comments yet