Discord Integration#
Connect your Discord bot to Outeract for automated messaging in servers, channels, and direct messages.
Overview#
| Property | Value |
|---|---|
| Platform Type | DISCORD |
| Authentication | Bot Token |
| Webhook Type | Dedicated |
| Message Limit | 2000 characters |
Prerequisites#
- Discord account
- Discord server (for testing)
- Discord application created at discord.com/developers
Setup Guide#
Step 1: Create a Discord Application#
- Go to Discord Developer Portal
- Click New Application
- Enter an application name
- Click Create
Step 2: Create a Bot#
- In your application, go to Bot section
- Click Add Bot
- Confirm by clicking Yes, do it!
- Under Token, click Reset Token
- Copy and save the token securely
**Important**: You can only view the token once. If you lose it, you'll need to regenerate it.
Step 3: Configure Bot Settings#
In the Bot section:
| Setting | Recommended |
|---|---|
| Public Bot | Off (unless you want others to add it) |
| Requires OAuth2 Code Grant | Off |
| Presence Intent | On (if needed) |
| Server Members Intent | On |
| Message Content Intent | On (required for reading messages) |
Step 4: Set Bot Permissions#
- Go to OAuth2 → URL Generator
- Select scopes:
bot,applications.commands - Select bot permissions:
- Send Messages
- Read Message History
- Attach Files
- Embed Links
- Add Reactions
Step 5: Add Bot to Server#
- Copy the generated OAuth2 URL
- Open in browser
- Select your server
- Authorize the bot
Step 6: Create Platform Connection#
mutation {
createPlatformConnection(
platformName: DISCORD
name: "My Discord Bot"
config: {
bot_token: "your-bot-token"
application_id: "your-application-id"
public_key: "your-public-key"
}
) {
id
webhookUrl
}
}Step 7: Configure Interactions Endpoint#
- In Discord Developer Portal, go to your application
- In General Information, set Interactions Endpoint URL to your webhook URL
- Discord will verify the endpoint
Supported Features#
Message Types#
| Type | Send | Receive | Notes |
|---|---|---|---|
| Text | ✓ | ✓ | Up to 2000 characters |
| Embeds | ✓ | ✓ | Rich formatted messages |
| Files | ✓ | ✓ | Up to 8MB (25MB with Nitro) |
| Images | ✓ | ✓ | PNG, JPEG, GIF, WebP |
| Reactions | ✓ | ✓ | Emoji reactions |
Capabilities#
- Server channels (text channels)
- Direct messages (DMs)
- Threads
- Embeds and rich formatting
- File attachments
Sending Messages#
Basic Message#
mutation {
sendMessage(
platformConnectionId: "pc_discord_123"
toExternalId: "123456789012345678" # User or channel ID
message: "Hello from Outeract!"
) {
id
status {
success
}
}
}Message with File#
mutation {
sendMessage(
platformConnectionId: "pc_discord_123"
toExternalId: "123456789012345678"
message: "Check out this file"
fileIds: ["file_xyz789"]
) {
id
}
}External ID Format#
Discord uses Snowflake IDs (18-19 digit numbers):
| Entity | Example |
|---|---|
| User | 123456789012345678 |
| Channel | 987654321098765432 |
| Server | 111222333444555666 |
Webhook Events#
Message Received#
{
"event_id": "evt_abc123",
"event_type": "message.inbound",
"payload": {
"message": {
"text": "Hello!",
"role": "user"
},
"platform": "discord"
},
"edges": {
"sent_by": {
"external_id": "123456789012345678"
}
}
}Message Content Intent#
**Required**: Enable **Message Content Intent** in your bot settings, or you won't receive message content.
As of August 2022, Discord requires privileged intents for reading message content. Without it, message.content will be empty.
Troubleshooting#
“Bot token is invalid”#
- Verify you copied the complete token
- Check if token was regenerated
- Ensure no extra whitespace
“Missing Permissions”#
- Check bot role has required permissions
- Ensure bot role is higher than managed roles
- Verify channel-specific permission overrides
“Cannot send messages to this user”#
- User has DMs disabled
- User blocked the bot
- No mutual servers
“Missing Access”#
- Bot not in the server
- Bot doesn’t have access to the channel
- Check channel permission overwrites
“Message content empty”#
- Enable Message Content Intent in bot settings
- Re-authorize bot if intent was added after
Rate Limits#
Discord has various rate limits:
| Scope | Limit |
|---|---|
| Per channel | 5 messages/5 seconds |
| Per user DM | 5 messages/5 seconds |
| Global | Varies by endpoint |
Outeract handles rate limits automatically with retries.
Security#
Outeract validates Discord interactions using Ed25519 signatures:
- Extracts signature and timestamp from headers
- Verifies signature using your application’s public key
- Rejects requests with invalid signatures