Choose an integration model
本頁內容尚未翻譯。
Status
Stable· Last verified 2026-07-11 · APIv10· Sources Interactions overview, Webhook resource
Picking the wrong model is the most expensive early mistake. This page picks for you.
The 30-second decision
Section titled “The 30-second decision”Do you only need to PUSH messages INTO a channel (notifications, alerts, logs)?│├─ YES ─────────────────────────────► Incoming Webhook. (simplest)│└─ NO — users will invoke your app, or you need to READ/REACT to events. │ Will users invoke it with slash/context-menu commands, buttons, or modals? │ ├─ YES, and I don't want to run a socket ─► App + Interaction HTTP endpoint. │ ├─ YES, and I also need live events ──────► App + Bot (gateway) + interactions. │ └─ NO — I need to observe events continuously (messages, joins, voice) ─► App + Bot on the Gateway.
Separately:• Acting on behalf of a *user* (their identity, their guilds)? ─► OAuth2.• A rich UI running *inside* the Discord client? ──────────────► Activity (Embedded App SDK).The comparison table
Section titled “The comparison table”| Incoming Webhook | Bot (Gateway) | App + Interaction endpoint | Activity | OAuth2 (user) | |
|---|---|---|---|---|---|
| Primary use | Push messages to one channel | Observe + act on events in real time | Respond to commands/components over HTTP | Embedded in-client app/game | Act as / read data for a user |
| Needs a bot token | No | Yes | No (uses Public Key) | Depends | No (uses OAuth tokens) |
| Needs a running socket | No | Yes (persistent WS) | No (Discord calls you) | Yes (RPC) | No |
| Needs a public HTTPS URL | No | No | Yes | Yes (hosted iframe) | Redirect URI only |
| Can read messages/events | No | Yes (with intents) | Only the interactions sent to it | Via SDK | Only via granted scopes |
| Auth mechanism | Secret URL | Bot token | Ed25519 signature verify | OAuth2 + SDK | OAuth2 authorization code |
| Setup effort | Minutes | Medium | Medium | High | Medium |
| Hosting cost | None | Always-on process | Serverless-friendly | Hosted web app | Redirect handler |
| Best when | Alerts, CI, logs, cron | Moderation, live features, presence | Command bots without a socket | Games, watch-together, tools | “Login with Discord”, user data |
Model-by-model notes
Section titled “Model-by-model notes”Incoming webhook — the “post-only” shortcut
Section titled “Incoming webhook — the “post-only” shortcut”A webhook is a URL bound to one channel. POST JSON and a message appears. No
identity, no intents, no gateway. It cannot read anything or respond to
interactions. Great for notifications; wrong for anything interactive.
→ Webhooks
Bot on the gateway — eyes and ears
Section titled “Bot on the gateway — eyes and ears”A bot connects over a WebSocket and receives a filtered stream of events (intents). Use it when you must observe continuously — moderation, welcome messages, voice state, reactions. Requires an always-on process and careful intent hygiene. Bots also use REST to act. → Gateway
App + interaction HTTP endpoint — commands without a socket
Section titled “App + interaction HTTP endpoint — commands without a socket”Register an Interactions Endpoint URL; Discord POSTs interactions to it and
you reply in the HTTP response. No persistent connection, so it runs beautifully
on serverless (Workers, Lambda, Vercel). The catch: you must verify every
request’s Ed25519 signature against your app’s Public Key — Discord
actively probes with invalid signatures and disables endpoints that accept them.
→ Interactions · example: interaction-endpoint
You can also receive interactions over the gateway instead of an endpoint. Choose the endpoint for serverless/stateless; choose the gateway if you already maintain a socket for events.
Activity — an app inside Discord
Section titled “Activity — an app inside Discord”Activities are web apps embedded in the Discord client via the Embedded App SDK, communicating over RPC and (optionally) voice. Highest effort, richest UX — games, collaborative tools, watch-together. Tracked in the platform map.
OAuth2 — acting for a user
Section titled “OAuth2 — acting for a user”OAuth2 is orthogonal to the above: it’s how a user authorizes your app and how your app is installed. It powers “Add to Server”, “Login with Discord”, and the newer user-install context (your app’s commands follow the user across servers and DMs). → OAuth2 & Installation
Common combinations
Section titled “Common combinations”- Notification service → webhook only.
- Moderation bot → app + bot (gateway) + slash commands (over gateway).
- Utility slash-command bot, cheap to host → app + interaction endpoint (serverless), optionally user-installed so it works everywhere.
- “Login with Discord” web app → OAuth2 authorization-code flow, no bot.
- Game night app → Activity (Embedded App SDK) + an app for install.
- New here → Your first 15 minutes
- Just need to post → Get a webhook URL
- Building commands → Interactions