Ask channel for approval

Ask a whole channel for approval of a flow

Script· approval slack Verified

by admin · 1/9/2023

The script

Submitted by hugo989 Bun
Verified 6 days ago
1
import { getResumeUrls } from "windmill-client@1";
2
import { WebClient } from "@slack/web-api";
3

4
type Slack = {
5
  token: string;
6
};
7
export async function main(
8
  slack: Slack,
9
  channel: string,
10
  text = "A flow is requesting an approval to be resumed",
11
) {
12
  const web = new WebClient(slack.token);
13

14
  const { approvalPage } = await getResumeUrls(`channel-${channel}`);
15
  await web.chat.postMessage({
16
    channel,
17
    text: text + " <" + approvalPage + "|approval page>",
18
  });
19
}
20

Other submissions
  • Submitted by admin Deno
    Created 398 days ago
    1
    import { getResumeUrls } from "https://deno.land/x/[email protected]/mod.ts";
    2
    import { WebClient } from "https://deno.land/x/[email protected]/mod.ts";
    3
    
    
    4
    type Slack = {
    5
      token: string;
    6
    };
    7
    export async function main(
    8
      slack: Slack,
    9
      channel: string,
    10
      text = "A flow is requesting an approval to be resumed",
    11
    ) {
    12
      const web = new WebClient(slack.token);
    13
    
    
    14
      const { approvalPage } = await getResumeUrls(`channel-${channel}`);
    15
      await web.chat.postMessage({
    16
        channel,
    17
        text: text + " <" + approvalPage + "|approval page>",
    18
      });
    19
    }
    20