Send approval request message via Discord webhook.
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