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

0 points by rosseastdene 119 days ago | 173 uses

One script reply has been approved by the moderators
This version of script #17 was approved by the moderators as the one that fits the best the script ask: 'List Users'. It is safe to use in your flows in production.
0 points
by rossmccrann 105 days ago
edit by rossmccrann 105 days ago
import * as wmill from "https://deno.land/x/[email protected]/index.ts";
import { WebClient } from "https://deno.land/x/[email protected]/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 };
}
edit/run in windmill raw embed