Discord
Run your CLI-JAW agent through a Discord bot. Send prompts, use slash commands, receive forwarded results, and handle file attachments -- all within your Discord server.
Setup
1. Create a Discord Bot
- Go to the Discord Developer Portal
- Create a new application and add a bot
- Enable the MESSAGE_CONTENT intent under Privileged Gateway Intents
- Copy the bot token
- Invite the bot to your server with appropriate permissions
2. Configure settings.json
{
"discord": {
"token": "YOUR_DISCORD_BOT_TOKEN",
"guildId": "YOUR_GUILD_ID",
"channelIds": ["CHANNEL_ID_1", "CHANNEL_ID_2"],
"forwardAll": true
}
}
The MESSAGE_CONTENT privileged intent is required. Without it, the bot cannot read message content in guild channels.
3. Alternative: Use jaw init
jaw init --channel discord \
--discord-token "YOUR_TOKEN" \
--discord-guild-id "GUILD_ID" \
--discord-channel-ids "CHANNEL_ID_1,CHANNEL_ID_2"
Slash Commands
Discord slash commands are registered as guild-scoped commands. All 27 visible commands are available through Discord's native /command interface. The command execution uses getVisibleCommands('discord') and makeCommandCtx('discord', ...).
Slash command replies are deferred to avoid Discord's 3-second timeout on interaction responses.
Message Handling
- Text messages -- Messages in allowed channels are sent to the agent
- Attachments -- Files are downloaded and processed
- DMs -- Direct messages to the bot are supported
- AllowedMentions -- Default AllowedMentions prevents the bot from pinging everyone
Forwarding
When forwardAll is true, agent results are forwarded to the active Discord channel as chunked messages.
/forward on # Enable forwarding
/forward off # Disable forwarding
Channel Allow List
The channelIds array restricts which channels the bot listens in. Thread parents are checked against this list, so threads within allowed channels also work.
Environment Variables
DISCORD_TOKEN=your_token_here
DISCORD_GUILD_ID=123456789
DISCORD_CHANNEL_IDS=111222333,444555666
Send API
POST /api/discord/send # Direct Discord send
POST /api/channel/send # Unified channel send (preferred)
Try it:
- 디스코드 봇 설정해줘
- 디스코드로 알려줘