Skip to content

Discord

Discord integration uses the Gateway API (WebSocket) for real-time message delivery, with the REST API for sending messages.

  1. Create an application at the Discord Developer Portal
  2. Under Bot, create a bot and copy the token
  3. Enable Message Content Intent under Privileged Gateway Intents
  4. Generate an invite link with the required permissions and add the bot to your server
  5. In KinBot, go to your Kin’s Channels tab
  6. Click Add Channel, select Discord
  7. Paste your bot token — it will be encrypted in KinBot’s vault
  8. Optionally, restrict to specific channel IDs with the allowlist
FieldRequiredDescription
Bot TokenDiscord bot token (stored encrypted)
Allowed Channel IDsRestrict to specific Discord channels
  • 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.

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
IntentBitPurpose
GUILDS1 << 0Server/channel info
GUILD_MESSAGES1 << 9Receive messages in servers
DIRECT_MESSAGES1 << 12Receive DMs
MESSAGE_CONTENT1 << 15Read message text (privileged)
  • 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