This guide will walk you through setting up Summary Bot NG from installation to your first summary.
Before installing Summary Bot NG, ensure you have:
- Python 3.8+: Check with
python --version - Poetry: Python dependency management tool
- Git: For cloning the repository
- Discord Developer Account: For creating the bot application
- Anthropic Account: For Claude API access (development)
- OpenRouter Account: For Claude API access via OpenRouter (production)
- Memory: Minimum 512MB RAM
- Storage: 100MB free space
- Network: Internet connection for API calls
git clone <repository-url>
cd summarybot-ng# On macOS/Linux
curl -sSL https://install.python-poetry.org | python3 -
# On Windows (PowerShell)
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
# Verify installation
poetry --version# Install all dependencies
poetry install
# Verify installation
poetry show# Copy the example environment file
cp .env.example .env
# Edit the environment file
nano .env # or your preferred editor# Discord Configuration
DISCORD_BOT_TOKEN=your_discord_bot_token_here
DISCORD_GUILD_ID=your_server_id_here
# AI Configuration (Choose one based on environment)
# Production (recommended): OpenRouter
LLM_ROUTE=openrouter
OPENROUTER_API_KEY=sk-or-v1-your_openrouter_key_here
OPENROUTER_MODEL=anthropic/claude-3-sonnet-20240229
# Development: Direct Claude API
# LLM_ROUTE=anthropic
# CLAUDE_API_KEY=sk-ant-your_claude_key_here
# Bot Configuration
BOT_PREFIX=/
SUMMARY_MAX_LENGTH=2000
WEBHOOK_PORT=5000
# Optional: Webhook Configuration
WEBHOOK_URL=https://your-webhook-endpoint.com
WEBHOOK_SECRET=your_webhook_secret- Visit https://discord.com/developers/applications
- Click "New Application"
- Enter application name: "Summary Bot NG"
- Go to the "Bot" section
- Click "Add Bot"
- Copy the token and add it to your
.envfile
Required permissions:
Send Messages(2048)Read Message History(65536)Use Slash Commands(2147483648)
Permission integer: 2147551296
- Go to "OAuth2" > "URL Generator"
- Select scopes:
botandapplications.commands - Select permissions listed above
- Copy the generated URL and visit it
- Select your server and authorize
- Visit https://openrouter.ai
- Create account or log in
- Go to API Keys section
- Create new API key
- Copy key to
.envfile asOPENROUTER_API_KEY - Set
LLM_ROUTE=openrouterin.env - Ensure you have sufficient credits
- Visit https://console.anthropic.com
- Create account or log in
- Go to API Keys section
- Create new API key
- Copy key to
.envfile asCLAUDE_API_KEY - Set
LLM_ROUTE=anthropicin.env
# Run with Poetry
poetry run python src/main.py
# Or activate virtual environment first
poetry shell
python src/main.py# Using systemd (Linux)
sudo systemctl start summarybot-ng
# Using Docker
docker-compose up -d
# Using PM2 (Node.js process manager)
pm2 start ecosystem.config.js- Check bot appears online in your Discord server
- Bot should show as "Summary Bot NG" with online status
- Look for successful connection logs in console
# In Discord, try these commands:
/summarize
/summarize channel:#general
/summarize last:10# Test webhook server
curl -X POST http://localhost:5000/webhook \
-H "Content-Type: application/json" \
-d '{"test": "message"}'# Basic summary of recent messages
/summarize
# Summarize specific channel
/summarize channel:#development
# Summarize last N messages
/summarize last:50
# Summarize with custom prompt
/summarize prompt:"Focus on technical decisions"# POST to webhook endpoint
curl -X POST http://localhost:5000/summary \
-H "Content-Type: application/json" \
-d '{
"channel_id": "123456789",
"message_count": 25,
"prompt_template": "default"
}'- Application Logs:
logs/summarybot.log - Error Logs:
logs/error.log - API Logs:
logs/api.log
# Set log level in .env
LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR# Check bot status
curl http://localhost:5000/health
# Check API status
curl http://localhost:5000/api/statusdiscord:
intents:
- message_content
- guild_messages
- guilds
commands:
sync_on_startup: true
global_commands: false
summarization:
default_length: 2000
max_messages: 100
include_links: true
webhook:
enabled: true
port: 5000
timeout: 30default: |
Summarize the following Discord conversation into a structured format with:
- H2 headers for main topics
- Nested bullet points for details
- Preserve important message links
- Focus on actionable items and decisions
technical: |
Create a technical summary focusing on:
- Code changes and decisions
- Architecture discussions
- Bug reports and solutions
- Performance considerations
meeting: |
Generate a meeting-style summary with:
- Agenda items discussed
- Decisions made
- Action items assigned
- Next steps identified# Check bot token
echo $DISCORD_BOT_TOKEN
# Verify bot permissions
# Ensure bot has required permissions in Discord server
# Check logs
tail -f logs/summarybot.log# For OpenRouter
echo $OPENROUTER_API_KEY
curl https://openrouter.ai/api/v1/models \
-H "Authorization: Bearer $OPENROUTER_API_KEY"
# For Claude Direct
echo $CLAUDE_API_KEY
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $CLAUDE_API_KEY" \
-H "anthropic-version: 2023-06-01"
# Check usage/limits at respective platform dashboards# Check file permissions
ls -la .env
chmod 600 .env
# Check directory permissions
ls -la logs/
chmod 755 logs/- Check Logs: Always start by examining the log files
- Verify Configuration: Ensure all environment variables are set
- Test API Keys: Verify Discord and OpenAI API keys work
- Check Permissions: Ensure bot has necessary Discord permissions
- Consult Documentation: See Troubleshooting Guide
Now that your bot is running:
- Configure Channels: Set up channel-specific settings
- Customize Prompts: Create custom summary templates
- Set Up Webhooks: Configure external integrations
- Monitor Usage: Track API usage and bot performance
- Explore Advanced Features: Check out the Examples
For detailed configuration options, see the Configuration Guide.