
Public
Like
3
discordWebhook
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v23View latest version
Send a message to a Discord channel. It's useful for notifying your team or community when someone interesting happens, like a user signup, Stripe payment, mention on social media, etc.
Follow the instructions here. It only takes a minute.
Paste it into val's environment variables.
import { discordWebhook } from "https://esm.town/v/stevekrouse/discordWebhook/main.ts";
await discordWebhook({
url: Deno.env.get("DISCORD_WEBHOOK_URL"),
content: "Hi from val town!",
});
Any text, rendered as markdown. If over 2000 characters, we will truncate it to the first 2000 for you.
ie SUPPRESS_EMBEDS
Learn more about flag options here: https://discord.com/developers/docs/resources/message#message-object-message-flags
This helper function only supports content
and flags
as parameters. There are other parameters that Discord supports. PRs welcome!