| name | configure |
| description | Set up the Discord bot — configure token, daemon URL, guild channels. Use when user says "configure discord", "set discord token", "discord setup", "discord bot setup". |
Discord Bot Configuration
Configure the bridgey-discord transport adapter.
Token Setup
The bot reads DISCORD_BOT_TOKEN from the environment (not auto-loaded from a file). Recommended: store in pass and pass inline. Each persona runs its own bot with its own token, stored at discord/<persona>-bot-token (e.g. discord/julia-bot-token).
If $ARGUMENTS contains a bot token (long alphanumeric string):
- Store it in pass:
pass insert discord/<persona>-bot-token (prompt user to paste)
- Confirm the token was saved (never display the actual token)
- Show how to start:
DISCORD_BOT_TOKEN=$(pass show discord/<persona>-bot-token) npm start
If no arguments provided, show status:
- Check if
pass show discord/<persona>-bot-token succeeds
- Check if
DISCORD_BOT_TOKEN env var is currently set
- Show current config from
~/.bridgey/discord.config.json
Configuration
Config file: ~/.bridgey/discord.config.json
Default config structure:
{
"token_env": "DISCORD_BOT_TOKEN",
"daemon_url": "http://localhost:8092",
"port": 8094,
"dm_policy": "pairing",
"guilds": {}
}
Create this file if it doesn't exist when configuring.
Guild Channel Setup
Guide the user through adding guild channels:
- Get the guild/server ID (right-click server name in Discord -> Copy Server ID, requires Developer Mode)
- Get channel IDs (right-click channel -> Copy Channel ID)
- Add to config under
guilds:
{
"guilds": {
"<guild_id>": {
"channels": ["<channel_id_1>", "<channel_id_2>"],
"require_mention": true,
"allow_from": []
}
}
}
Starting the Bot
After configuration, tell the user:
- Start:
cd ~/projects/markets/bridgey/apps/discord-bot && DISCORD_BOT_TOKEN=$(pass show discord/<persona>-bot-token) npm start
- The bot runs from
dist/bot.js (esbuild bundle) with discord.js/zod as external deps
- The bot will register as a transport with the bridgey daemon automatically
Dependency auto-install
Dependencies (discord.js, zod) are auto-installed on first Claude Code session via the SessionStart hook. If the bot fails with a missing module error:
- Check if
node_modules/discord.js exists in ~/projects/markets/bridgey/apps/discord-bot/
- If missing, run manually:
npm install --omit=dev --prefix ~/projects/markets/bridgey/apps/discord-bot
- If
dist/bot.js is missing, rebuild: cd ~/projects/markets/bridgey/apps/discord-bot && npm run build