- Discord bot runs in background thread alongside desktop app - State synchronization between Discord and desktop waifu - Commands: !hello, !status - Responds to mentions and DMs - Complete setup guide in DISCORD_SETUP.md - Graceful fallback if no token configured 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
2.8 KiB
2.8 KiB
Discord Bot Setup Guide
Step 1: Create Discord Application
- Go to https://discord.com/developers/applications
- Click "New Application"
- Name it (e.g., "Desktop Waifu")
- Click "Create"
Step 2: Create Bot User
- In your application, go to the "Bot" tab
- Click "Add Bot"
- Confirm by clicking "Yes, do it!"
Step 3: Configure Bot Settings
Bot Permissions
Under the "Bot" tab:
- Enable "MESSAGE CONTENT INTENT" (required to read messages)
- Enable "SERVER MEMBERS INTENT" (optional, for member events)
- Enable "PRESENCE INTENT" (optional, for presence updates)
Bot Token
- Under "TOKEN", click "Reset Token"
- Copy the token (you'll need this for
.env
) - NEVER share this token publicly!
Step 4: Invite Bot to Your Server
-
Go to "OAuth2" > "URL Generator"
-
Select scopes:
bot
applications.commands
-
Select bot permissions:
- Send Messages
- Read Message History
- Use Slash Commands
- Read Messages/View Channels
- Embed Links
- Attach Files
-
Copy the generated URL at the bottom
-
Open it in your browser
-
Select your server and authorize
Step 5: Configure Application
-
Create
.env
file in project root:cp .env.example .env
-
Edit
.env
and add your bot token:DISCORD_BOT_TOKEN=YOUR_TOKEN_HERE
Step 6: Test the Bot
-
Run the application:
python main.py
-
In Discord, try these commands:
!hello
- Bot will greet you!status
- Check waifu's current mood@BotName your message
- Mention the bot to chat- Send a DM to the bot
Available Commands
!hello
- Say hello to the waifu!status
- Check current emotional state
Features
Automatic Responses
The bot will respond to:
- Mentions - When you @mention the bot in any channel
- DMs - When you send a direct message to the bot
State Synchronization
The bot shares state with the desktop app:
- Emotions sync between Discord and desktop
- Conversation history is tracked
- Interactions update the desktop waifu in real-time
Troubleshooting
Bot doesn't respond
- Check that MESSAGE CONTENT INTENT is enabled
- Verify bot has "Send Messages" permission in the channel
- Check console for error messages
Bot won't start
- Verify DISCORD_BOT_TOKEN is set in
.env
- Check that token is valid (not expired/reset)
- Ensure discord.py is installed:
pip install discord.py
Bot joins but shows offline
- This is normal for Python bots
- They appear offline but will still respond to messages
Security Notes
- Never commit your
.env
file to git (it's in.gitignore
) - Never share your bot token publicly
- If token is compromised, reset it in Discord Developer Portal
- Keep the bot token secret like a password