1 | import discordwebhook from "https://deno.land/x/discordwebhook/mod.ts"; |
2 |
|
3 | type DiscordWebhook = { |
4 | webhook_url: string; |
5 | }; |
6 |
|
7 | export async function main(discord_webhook: DiscordWebhook, message: string) { |
8 | |
9 | const normalized_url = discord_webhook.webhook_url.replace("discordapp.com", "discord.com"); |
10 |
|
11 | const webhook = new discordwebhook(normalized_url); |
12 | const ret = await webhook.createMessage(message); |
13 | return ret; |
14 | } |
15 |
|