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..."
| Field | Type | Description |
|---|---|---|
enabled | bool | Enable the Discord channel |
token | SecureString | Discord bot token from the Discord Developer Portal |
allow_from | []string | Allowlist of Discord user IDs |
Setup steps
- Create an application at the Discord Developer Portal.
- Add a Bot and copy the token.
- Enable Message Content Intent under Bot → Privileged Gateway Intents.
- Add the token to
.security.yml. - Invite the bot to your server using the OAuth2 URL generator (scopes:
bot,applications.commands). - Start KhunQuant.