packages/twenty-apps/internal/twenty-discord/README.md
Connect Discord to your Twenty workflows. Post messages, edit them, react, delete, and browse channels — all from the workflow builder or the AI chat.
Once installed and the admin has provided the bot token, five tools become available in workflows and the AI chat:
channelId + messageText. Optional
replyToMessageId turns it into a reply to a previous message.👍, ✅, 🎉)
or a custom server emoji (partyparrot:643452342342342342). Great for
signalling status at a glance.guildId blank if your bot is in only one
server — it auto-picks. If the bot is in multiple servers, the error
response lists each server's name and ID so you can copy the right one.Heads up: if you see "Discord is not configured" on the first run, your Twenty admin needs to follow the Self-hosting setup section below — they need to create a Discord application and provide the bot token before the tools work.
Discord IDs are long numeric strings (e.g. 1234567890123456789). To copy
them from the Discord client:
discord-list-channels when your bot is in multiple
servers (otherwise leave it blank for auto-pick).Tip: when chaining steps, pass
messageIdfrom a previous Send Discord message step directly into a follow-up Update / Delete / Add Reaction step. No copy/paste needed.
What this connector intentionally does not support in v1:
/commands.| Symptom | Likely cause | Fix |
|---|---|---|
Discord is not configured | DISCORD_BOT_TOKEN not set | Admin: paste the bot token in Settings → Applications → Discord → Settings tab |
401 Unauthorized | Token wrong, copied with whitespace, or rotated | Reset the token in the Discord Developer Portal and re-paste |
Missing Access (50001) | Bot wasn't invited to that server | Re-run the OAuth invite URL for that server (see admin setup) |
Missing Permissions (50013) | Bot is in the server but lacks Send / Manage / React permissions | In Discord: server settings → roles → grant the bot's role the missing permission |
Unknown Channel (10003) | channelId is wrong, or bot can't see that channel | Verify the ID; check the bot has View Channel permission |
Unknown Message (10008) | messageId is wrong, or message was deleted | Verify the ID is from a still-existing message |
Cannot edit a message authored by another user (50005) | Trying to update / delete a message the bot didn't send | The bot can only edit its own messages; it can delete others' messages only with the Manage Messages permission |
Bot is in N Discord servers — please specify which one (from list-channels) | Bot is in multiple servers and guildId was left blank | Copy the server ID from the error message and paste it into the guildId field |
Discord API responded with 429 | Hit Discord's rate limit | Reduce workflow concurrency; this connector doesn't yet auto-retry |
This section is for Twenty server admins. If you're on Twenty Cloud, skip this — the bot credentials are already configured.
bot.Send Messages, Manage Messages,
Add Reactions, Read Message History.DISCORD_BOT_TOKEN row. Saves on blur.Workspace users can now use the Discord workflow tools immediately — no further per-user configuration needed (which is unique vs Linear / Slack where each user connects their own account).
Slack and Linear use OAuth-per-workspace
(defineConnectionProvider({ type: 'oauth' })) so each Twenty workspace
stores its own access token. Discord works differently:
bot scope does have an OAuth flow, but the access_token
it returns is a user bearer token — useless for bot actions like posting
messages. To actually send messages as the bot you need the static
bot token from the Developer Portal.The result: this connector skips defineConnectionProvider entirely and
reads DISCORD_BOT_TOKEN from an applicationVariable set once at
deployment scope. See
Discord's OAuth2 docs
for the underlying reason bot users authenticate via static tokens.
If you're working on this app rather than installing the published version:
cd packages/twenty-apps/internal/twenty-discord
# Day-to-day development (publish + install + watch in one):
yarn twenty dev
# Run unit tests:
yarn test
# Lint:
yarn lint
twenty dev is recommended for iteration — it publishes to your local
Twenty server, installs the app, and watches for changes in one command.
The Discord REST API (v10) is called directly via fetch — no discord.js
or other SDK dependency. See
src/logic-functions/utils/discord-api-request.ts for the auth and
error-handling wrapper that all handlers go through.