import discordwebhook from "https://deno.land/x/discordwebhook/mod.ts";
type DiscordWebhook = {
webhook_url: string;
};
export async function main(
discord_webhook: DiscordWebhook,
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 admin 460 days ago
import discordwebhook from "https://deno.land/x/discordwebhook/mod.ts";
type DiscordWebhook = {
webhook_url: string;
};
export async function main(discord_webhook: DiscordWebhook, 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 admin 463 days ago
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 592 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 626 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 658 days ago