discord-alert-transport

Portable Discord webhook transport — Python package + multi-language reference.

View the Project on GitHub jdp5949/discord-alert-transport

Quick start — 3 minutes

1. Make a Discord server + channel + webhook (60 sec)

  1. Discord app → + icon → Create My Own → name my-app-prod.
  2. Right-click the auto-created #general (or make a new #alerts channel) → Edit ChannelIntegrationsWebhooksNew WebhookCopy Webhook URL.

Stash the URL somewhere safe. Treat it like an API key — anyone with the URL can post to your channel (they cannot read it, just post).

2. Install

pip install discord-alert-transport

Python 3.10+. Zero runtime dependencies (stdlib only).

3. Send

from discord_alert_transport import Channel, DiscordSender, build_embed

s = DiscordSender(
    webhooks={
        Channel.ALERTS: "https://discord.com/api/webhooks/.../...",
    },
    enabled=True,
    username="my-app",
)

s.send_embed(
    Channel.ALERTS,
    build_embed(
        title="Backup completed",
        description="Nightly Postgres dump finished",
        color=0x00cc66,
        fields=[
            {"name": "Size", "value": "12.4 GB", "inline": True},
            {"name": "Duration", "value": "8m 14s", "inline": True},
        ],
        footer="cron / backup.sh",
    ),
)

Phone buzzes (assuming Discord mobile app installed + channel notifications set to “All Messages”).

4. Don’t have Python? Use any language

curl -X POST -H "Content-Type: application/json" \
  -d '{"username":"my-bot","content":"hello world"}' \
  https://discord.com/api/webhooks/.../...

Returns 204 No Content on success. Try it from node, go, bash, PHP, etc. See languages for ready-to-paste examples.

5. Production checklist

Next: how it works.