Discord
Discord integration uses the Gateway API (WebSocket) for real-time message delivery, with the REST API for sending messages.
- Create an application at the Discord Developer Portal
- Under Bot, create a bot and copy the token
- Enable Message Content Intent under Privileged Gateway Intents
- Generate an invite link with the required permissions and add the bot to your server
- In KinBot, go to your Kin’s Channels tab
- Click Add Channel, select Discord
- Paste your bot token — it will be encrypted in KinBot’s vault
- Optionally, restrict to specific channel IDs with the allowlist
Configuration
Section titled “Configuration”| Field | Required | Description |
|---|---|---|
| Bot Token | ✅ | Discord bot token (stored encrypted) |
| Allowed Channel IDs | ❌ | Restrict to specific Discord channels |
How It Works
Section titled “How It Works”- Inbound: KinBot maintains a persistent WebSocket connection to Discord’s Gateway. It receives message events, ignores its own messages, and routes incoming messages to the Kin.
- Outbound: Messages are sent via the REST API. Long messages (>2,000 chars) are automatically split. File attachments are uploaded as multipart form data.
Gateway Features
Section titled “Gateway Features”The adapter handles all Gateway lifecycle events:
- Heartbeat keepalive
- Session resume on reconnect
- Automatic reconnection on disconnect or invalid session
- Proper identification with required intents
Required Intents
Section titled “Required Intents”| Intent | Bit | Purpose |
|---|---|---|
| GUILDS | 1 << 0 | Server/channel info |
| GUILD_MESSAGES | 1 << 9 | Receive messages in servers |
| DIRECT_MESSAGES | 1 << 12 | Receive DMs |
| MESSAGE_CONTENT | 1 << 15 | Read message text (privileged) |
Features
Section titled “Features”- Text messages with Discord Markdown
- File attachments (inbound via CDN URLs, outbound via multipart upload)
- Reply threading
- Automatic message chunking
- DM and server channel support
- Typing indicator
- Bot ignores its own messages automatically