Edits history of script submission #23040 for ' Get User (slack)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { WebClient } from "@slack/web-api"
    
    /**
     * Get User
     * Fetch one user's profile by ID (e.g. U0123456789), such as the `user` on a message. Needs users:read, plus users:read.email for `profile.email`. Works with a bot or a user token.
     */
    export async function main(
      auth: RT.Slack,
      user: string,
      include_locale?: boolean
    ) {
      const client = new WebClient(auth.token)
      return await client.users.info(
        include_locale === undefined ? { user } : { user, include_locale }
      )
    }
    

    Submitted by hugo989 1 hour ago