Talks to Discord™ from a
Jennifer program: posts to a channel through a
webhook, from plain text to embeds and buttons; answers slash commands and
button presses through a signature-checked interactions endpoint in a web
app; and sends and edits messages and registers commands with a bot token.
Replaces the discord module of Jennifer's standard library (shipped since
0.18.0, deprecated from 0.26.0, removed in 0.28.0) with the same webhook API
and more; only the import differs.
This deck is part of Deckyard, community decks for Jennifer.
Up to 0.1.0 this deck was @jennifer/discord. To switch, change the [decks]
entry to "@deckyard/discord" = "^0.3.0" and the imports to "@deckyard/discord/".
jvc add @deckyard/discordThis vendors the deck to vendor/deckyard/discord/. Without jvc, unpack the
src/ subtree of a release archive (deckyard-discord-<version>.tar.gz) there.
import "@deckyard/discord/" as discord;
import "http.j" as http;
def r as http.Response init discord.send(os.getEnv("DISCORD_WEBHOOK_URL"), "deploy finished");
io.printf("%d\n", $r.status); # 204; a deleted webhook is 404, not an error
examples/send.j builds a message with an embed, prints its payload and
posts it when DISCORD_WEBHOOK_URL is set; examples/bot.j is a dice bot on
the interactions endpoint.
Jennifer 0.27.0 or newer and network access to Discord. Sending needs the
default jennifer binary; the stock jennifer-tiny has no network driver.
tools/check-all.sh # the full gate, as CI runs it
jennifer test src/discord_test.j # the test overlay
tools/check-docs.sh # docs against the code
tools/pack.sh dist # build the release archiveLGPL-3.0-only, see LICENSE. Copyright (C) 2026 mplx <mplx@jennifer-lang.dev>.
tools/check-headers.sh checks every source file's SPDX header against
deck.toml.
Discord™ is a trademark of Discord Inc. Other product and company names may be trademarks of their respective owners. They are used only to identify the products this deck works with. This deck is an independent project, not affiliated with, sponsored or endorsed by Discord Inc.