import discordwebhook from "https://deno.land/x/discordwebhook/mod.ts";
import type { Resource } from 'https://deno.land/x/windmill@v1.85.0/mod.ts'
export async function main(discord_webhook: Resource<'discord_webhook'>, message: string, name: string) {
const flow_id = Deno.env.get("WM_FLOW_JOB_ID")
message = `Flow [${flow_id}](${Deno.env.get("WM_BASE_URL")}/run/${flow_id}?workspace=${Deno.env.get("WM_WORKSPACE")}) had an error:\n${name}: ${message}`
const webhook = new discordwebhook(discord_webhook.webhook_url);
const ret = await webhook.createMessage(message);
return ret;
}
Submitted by adam186 59 days ago
import discordwebhook from "https://deno.land/x/discordwebhook/mod.ts";
import type { Resource } from 'https://deno.land/x/windmill@v1.70.1/mod.ts'
export async function main(discord_webhook: Resource<'discord_webhook'>, message: string, name: string) {
const flow_id = Deno.env.get("WM_FLOW_JOB_ID")
message = `Flow [${flow_id}](${Deno.env.get("WM_BASE_URL")}/run/${flow_id}?workspace=${Deno.env.get("WM_WORKSPACE")}) had an error:\n${name}: ${message}`
const webhook = new discordwebhook(discord_webhook.webhook_url);
const ret = await webhook.createMessage(message);
return ret;
}
Submitted by adam186 94 days ago
import discordwebhook from "https://deno.land/x/discordwebhook/mod.ts";
import type { Resource } from 'https://deno.land/x/windmill@v1.27.2/mod.ts'
export async function main(discord_webhook: Resource<'discord_webhook'>, message: string, name: string) {
const flow_id = Deno.env.get("WM_FLOW_JOB_ID")
message = `Flow [${flow_id}](${Deno.env.get("WM_BASE_URL")}/run/${flow_id}?workspace=${Deno.env.get("WM_WORKSPACE")}) had an error:\n${name}: ${message}`
const webhook = new discordwebhook(discord_webhook.webhook_url);
const ret = await webhook.createMessage(message);
return ret;
}
Submitted by rubenfiszel 125 days ago