0

Get Current User

by
Published today

Identify the connected token: its user, bot, team and URL (auth.test).

Script slack Verified

The script

Submitted by hugo989 Bun
Verified 1 hour ago
1
import { WebClient } from "@slack/web-api"
2

3
/**
4
 * Get Current User
5
 * Identify the connected token (auth.test): `user_id`, `user`, `team_id`, `team`, workspace `url`, and `bot_id` when it is a bot token — handy to check which identity a resource acts as. No scope needed.
6
 */
7
export async function main(auth: RT.Slack) {
8
  const client = new WebClient(auth.token)
9
  return await client.auth.test()
10
}
11