0

slack_get_caller_user_id

by
Published Dec 13, 2024

Get the Slack User ID of the caller of the windmill workflow. The user ID can be used to tag the person in the message.

Script slack
  • Submitted by pranav bansal428 Bun
    Created 557 days ago
    1
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    2
    
    
    3
    type Slack = {
    4
      token: string;
    5
    };
    6
    
    
    7
    export async function main(
    8
      slack: Slack,
    9
    ) {    
    10
      const web = new WebClient(slack.token);
    11
      const email = Deno.env.get('WM_EMAIL');
    12
      return await web.users.lookupByEmail({
    13
        email
    14
      })
    15
    }