- Go to https://discord.com/developers/applications
- Click "New Application"
- Name:
Obsidian Chat Bot(or whatever you prefer) - Click "Create"
- Go to "Bot" tab in left sidebar
- Click "Add Bot" → "Yes, do it!"
- Configure bot settings:
- Username:
obsidian-chat(or your preference) - Requires OAuth2 Code Grant: ❌ Disabled
- Message Content Intent: ✅ REQUIRED - Enable this!
- Username:
- In "Bot" tab, under "Token" section
- Click "Reset Token" → Confirm
- Copy the token - you'll need this for
.envfile ⚠️ NEVER share this token publicly
- Go to "OAuth2" → "URL Generator" tab
- Scopes: Check
bot - Bot Permissions: Check these:
- ✅ View Channels
- ✅ Send Messages
- ✅ Send Messages in Threads
- ✅ Use Slash Commands
- ✅ Create Public Threads
- ✅ Create Private Threads
- ✅ Manage Threads
- ✅ Read Message History
- ✅ Add Reactions
- Copy the generated URL from step 4
- Open URL in browser
- Select your Discord server
- Click "Authorize"
- Complete captcha if prompted
- In Discord, enable Developer Mode:
- User Settings → Advanced → Developer Mode ✅
- Right-click the channel you want the bot to monitor
- Click "Copy ID"
- This is your
DISCORD_INBOX_CHANNEL_ID
# Discord Configuration
DISCORD_BOT_TOKEN=your_bot_token_from_step_3
DISCORD_INBOX_CHANNEL_ID=your_channel_id_from_step_6
# Claude Configuration
CLAUDE_CODE_OAUTH_TOKEN=your_claude_oauth_token
OBSIDIAN_VAULT_PATH=/Users/your-username/Projects/obsidian-vault
# Development Settings
NODE_ENV=development
PORT=3001
REDIS_URL=redis://localhost:6379
REDIS_TTL_SECONDS=172800# Copy from .env.production template
cp .env.production .env
# Edit with your actual values:
# - DISCORD_BOT_TOKEN (from step 3)
# - DISCORD_INBOX_CHANNEL_ID (from step 6)
# - CLAUDE_CODE_OAUTH_TOKEN (from claude CLI)cd discord-server
npm run devLook for these logs:
🤖 Bot logged in as obsidian-chat#1234
📥 Monitoring channel: 1234567890123456789
🏥 Health server listening on port 3001
- Go to your Discord channel
- Send any message
- Bot should:
- Create a new thread
- Respond with Claude's answer
- Show processing indicators
curl http://localhost:3001/healthShould return:
{
"status": "healthy",
"timestamp": "2025-09-18T...",
"bot": {
"connected": true,
"user": "obsidian-chat#1234"
},
"redis": "connected",
"threads": { "active": 0, "total": 0 }
}- ❌ Invalid token: Check
DISCORD_BOT_TOKENin.env - ❌ Missing intents: Ensure "Message Content Intent" is enabled
- ❌ Network issues: Check firewall/VPN
- ❌ Wrong channel: Check
DISCORD_INBOX_CHANNEL_IDmatches your test channel - ❌ Missing permissions: Bot needs "Send Messages" and "Create Threads"
- ❌ Claude auth: Check
CLAUDE_CODE_OAUTH_TOKENis valid
- ❌ Claude CLI issue: Check Claude authentication with
claude auth status - ❌ Redis connection: Ensure Redis is running locally or via Docker
Once local testing works:
- Create production bot (optional - separate bot for prod)
- Update production .env with production tokens
- Deploy:
./deploy.sh - Verify:
curl http://localhost:3001/health
Your Discord bot is now ready to use with Claude Code integration!