Skip to main content

Discord

KhunQuant connects to Discord using the Discord Gateway (WebSocket). The DiscordChannel adapter listens for messages and delivers responses back to the originating channel.

Capabilities

  • Text message send/receive
  • Typing indicator (TypingCapable)
  • Slash command registration (CommandRegistrarCapable)
  • Allow-listing by Discord user ID or server/channel

Configuration

Add to ~/.khunquant/config.json:

{
"channels": {
"discord": {
"enabled": true,
"token": "DISCORD_BOT_TOKEN",
"allow_from": ["123456789012345678"]
}
}
}

Add the bot token to ~/.khunquant/.security.yml:

channels:
discord:
token: "MTIzN..."
FieldTypeDescription
enabledboolEnable the Discord channel
tokenSecureStringDiscord bot token from the Discord Developer Portal
allow_from[]stringAllowlist of Discord user IDs

Setup steps

  1. Create an application at the Discord Developer Portal.
  2. Add a Bot and copy the token.
  3. Enable Message Content Intent under Bot → Privileged Gateway Intents.
  4. Add the token to .security.yml.
  5. Invite the bot to your server using the OAuth2 URL generator (scopes: bot, applications.commands).
  6. Start KhunQuant.