Discord
Bot-token setup for a single channel — streaming-capable gateway, 2 000-char limit, good fit for community servers.
🟢 Runtime-ready — the gateway supports streaming edits via the message-edit endpoint (no production caller wires it yet — see below). Bot mode only; Discord webhooks don't expose the edit API we'd need for live streaming.
What you get
- Streaming edits via
PATCH /channels/{channel}/messages/{id}(throttled at 1 s to stay under the 5 edits / 5 s per-channel rate limit). Driven bycreateStreamSink;send_messageitself is one-shot. - Attachments — images, files, and audio via the single
multipart
POST /channels/{cid}/messagesendpoint withpayload_json+files[n]parts. Voice attachments show as an audio file with a player (native voice-message UI with waveform is a follow-up). - 2 000-char limit per message —
send_messagerejects longer text at the tool boundary; the stream sink truncates mid-stream with a… (truncated)marker. - Single channel per gateway — to post in multiple channels, use
the
channeloverride onsend_message.
Setup
1. Create a bot application
- Open the Discord Developer Portal and click New Application
- Go to Bot → Reset Token and copy the token (shown once)
- Under Privileged Gateway Intents, leave Message Content off — Minara only sends messages, it doesn't read them
- Copy the bot's install URL from OAuth2 → URL Generator:
check
botunder Scopes andSend Messagesunder Bot Permissions, then paste the URL into a browser to add the bot to your server
2. Find the target channel id
In the Discord client: User Settings → Advanced → Developer Mode
= ON, then right-click the channel → Copy Channel ID. It's a
numeric snowflake like 1234567890123456789.
3. Configure Minara
Easy way:
"set up Discord notifications in channel 1234567890"
Manual way:
minara auth messaging add discordOr directly in your project .env file:
DISCORD_BOT_TOKEN=<bot token>
DISCORD_CHANNEL_ID=12345678901234567894. Test
minara auth messaging test discordStreaming behaviour
Discord's message-edit endpoint is rate-limited to 5 edits per 5
seconds per channel. The DiscordGateway advertises
streamDefaultIntervalMs = 1000 so createStreamSink fires at
most ~5 edits in the first five seconds and then continues at 1 Hz.
Callers can widen the throttle via createStreamSink(gw, msg, { intervalMs: 1500 })
— this is a caller-side option, not a send_message tool argument.
Streaming itself is wiring-ready but not yet invoked by any
production code path.
Responses exceeding 2 000 characters are truncated rather than split
— Discord treats each chat.postMessage as atomic, and splitting
mid-stream makes the edit chain confusing to read.
Overriding the channel
send_message({
provider: "discord",
channel: "9876543210987654321",
text: "Critical: position liquidation imminent",
})Troubleshooting
"Missing Access (50001)"
- The bot isn't a member of the server, or lacks permission to see the channel. Re-check the OAuth install URL and the channel's role permissions
"Missing Permissions (50013)"
- Bot is in the server but can't
Send MessagesorEmbed Linksin this specific channel. Edit the channel permissions and grantSend Messagesto the bot's role
"Cannot send empty message (50006)"
- The message body was stripped during content moderation. Discord blocks some plain-text patterns that look like markup; try the same message with minor punctuation changes
"Stream feels choppy"
- Default throttle is 1 000 ms. Discord's 5/5 rate limit is the ceiling — you can't go faster without risking a temporary 429. Accept the cadence or use Telegram for live streaming
Reference
- Env vars:
DISCORD_BOT_TOKEN,DISCORD_CHANNEL_ID - Source:
apps/agent/src/messaging/discord.ts - REST API docs: discord.com/developers/docs/resources/channel