Edits history of script submission #22531 for ' Ask channel for approval (slack)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    import { getResumeUrls } from "windmill-client@1";
    import { WebClient } from "@slack/web-api";
    
    type Slack = {
      token: string;
    };
    export async function main(
      slack: Slack,
      channel: string,
      text = "A flow is requesting an approval to be resumed",
    ) {
      const web = new WebClient(slack.token);
    
      const { approvalPage } = await getResumeUrls(`channel-${channel}`);
      await web.chat.postMessage({
        channel,
        text: text + " <" + approvalPage + "|approval page>",
      });
    }
    

    Submitted by hugo989 6 days ago