0
Ask channel for approval Approval
One script reply has been approved by the moderators Verified

Send approval request message via Discord webhook.

Created by henri186 175 days ago Viewed 1240 times
0
Submitted by henri186 Deno
Verified 175 days ago
1
import discordwebhook from "https://deno.land/x/discordwebhook/mod.ts";
2
import { getResumeUrls } from "https://deno.land/x/windmill@v1.85.0/mod.ts";
3

4
type DiscordWebhook = {
5
  webhook_url: string;
6
};
7

8
export async function main(discord_webhook: DiscordWebhook, message: string = "A flow is requesting an approval to be resumed") {
9

10
  const webhook = new discordwebhook(discord_webhook.webhook_url);
11

12
  const { approvalPage } = await getResumeUrls();
13
  
14
  const fullMessage = `${message} [approval page](${approvalPage})`;
15

16
  const ret = await webhook.createMessage(fullMessage);
17
  return ret;
18
}
19