import discordwebhook from "https://deno.land/x/discordwebhook/mod.ts";
type DiscordWebhook = {
webhook_url: string;
};
export async function main(discord_webhook: DiscordWebhook, message: string) {
// Normalize legacy Discord webhook URLs to the current domain
const normalized_url = discord_webhook.webhook_url.replace("discordapp.com", "discord.com");
const webhook = new discordwebhook(normalized_url);
const ret = await webhook.createMessage(message);
return ret;
}
Submitted by joshuarussell.online513 6 days ago