561f1a8fb1d5c70079d5927c3dc8315e2d911d58
Daemon Boyfriend
A Discord bot for the MSC group with multi-provider AI chat and SearXNG web search.
Features
- Multi-Provider AI Chat: Supports OpenAI, OpenRouter, and Anthropic (Claude)
- Mention-based Chat: Just @mention the bot to chat
- Web Search: Privacy-respecting search via SearXNG
- Conversation Memory: Remembers context per user
- Rate Limiting: Prevents abuse
Commands
| Command | Description |
|---|---|
@Daemon Boyfriend <message> |
Chat with the bot |
/chat <message> |
Chat via slash command |
/search <query> |
Search the web |
/image <query> |
Search for images |
/clear |
Clear your conversation history |
/status |
Show bot status |
/help |
Show all commands |
Quick Start
Prerequisites
- Python 3.11+
- Discord bot token (Discord Developer Portal)
- AI provider API key (OpenAI, OpenRouter, or Anthropic)
- SearXNG instance (optional, for search)
Installation
- Clone the repository:
git clone https://github.com/your-username/Daemon-Boyfriend.git
cd Daemon-Boyfriend
- Create a virtual environment:
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# or: .venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
- Configure the bot:
cp .env.example .env
# Edit .env with your tokens
- Run the bot:
python -m daemon_boyfriend
Configuration
Edit .env to configure the bot:
# Required
DISCORD_TOKEN=your_bot_token
# AI Provider (choose one)
AI_PROVIDER=openai # or: openrouter, anthropic
AI_MODEL=gpt-4o
# API Keys (set the one you use)
OPENAI_API_KEY=sk-xxx
OPENROUTER_API_KEY=sk-or-xxx
ANTHROPIC_API_KEY=sk-ant-xxx
# SearXNG (optional)
SEARXNG_BASE_URL=http://localhost:8080
AI Providers
| Provider | Models | Notes |
|---|---|---|
| OpenAI | gpt-4o, gpt-4-turbo, gpt-3.5-turbo | Official OpenAI API |
| OpenRouter | 100+ models | Access to Llama, Mistral, Claude, etc. |
| Anthropic | claude-3-5-sonnet, claude-3-opus | Direct Claude API |
Docker Deployment
With Docker Compose (includes SearXNG)
cp .env.example .env
# Edit .env with your tokens
docker-compose up -d
Bot Only (external SearXNG)
docker build -t daemon-boyfriend .
docker run -d --env-file .env daemon-boyfriend
Development
Project Structure
src/daemon_boyfriend/
├── bot.py # Main bot class
├── config.py # Configuration
├── cogs/ # Command modules
│ ├── ai_chat.py # Chat commands
│ ├── search.py # Search commands
│ └── admin.py # Admin commands
├── services/ # External integrations
│ ├── ai_service.py # AI provider factory
│ ├── providers/ # AI providers
│ ├── searxng.py # SearXNG client
│ └── conversation.py # Chat history
└── utils/ # Utilities
├── logging.py
├── rate_limiter.py
└── error_handler.py
Running in Development
Set DISCORD_GUILD_ID in .env for faster command sync during development:
DISCORD_GUILD_ID=123456789012345678
License
MIT
Description
A companion for those who love deeply and feel intensely. For the ones whose closeness is a feature, not a bug - who build connections through vulnerability, trust, and unwavering presence. A safe space to process grief, navigate attachment, and remember that your capacity to care is a strength, even when it hurts.
Languages
Python
96.9%
HTML
2.9%
Dockerfile
0.2%