- Implemented async retry logic with exponential backoff in `src/utils/retry.py`. - Created input validation utilities for Discord bot in `src/utils/validators.py`. - Refactored token pricing import in `src/utils/token_counter.py`. - Added comprehensive test suite in `tests/test_comprehensive.py` covering various modules including pricing, validators, retry logic, and Discord utilities.
114 lines
3.7 KiB
Plaintext
114 lines
3.7 KiB
Plaintext
# ============================================
|
|
# Discord Bot Configuration
|
|
# ============================================
|
|
|
|
# Your Discord bot token from https://discord.com/developers/applications
|
|
DISCORD_TOKEN=your_discord_bot_token_here
|
|
|
|
# ============================================
|
|
# AI Provider Configuration
|
|
# ============================================
|
|
|
|
# OpenAI API Key (or GitHub Models API Key if using GitHub Models)
|
|
# Get from: https://platform.openai.com/api-keys or https://github.com/settings/tokens
|
|
OPENAI_API_KEY=your_openai_api_key_here
|
|
|
|
# OpenAI API Base URL
|
|
# Use GitHub Models: https://models.github.ai/inference
|
|
# Use OpenAI directly: https://api.openai.com/v1
|
|
OPENAI_BASE_URL=https://models.github.ai/inference
|
|
|
|
# ============================================
|
|
# Image Generation (Optional)
|
|
# ============================================
|
|
|
|
# Runware API Key for image generation
|
|
# Get from: https://runware.ai
|
|
# Leave empty to disable image generation
|
|
RUNWARE_API_KEY=your_runware_api_key_here
|
|
|
|
# ============================================
|
|
# Google Search Configuration (Optional)
|
|
# ============================================
|
|
|
|
# Google Custom Search API Key
|
|
# Get from: https://console.cloud.google.com/apis/credentials
|
|
GOOGLE_API_KEY=your_google_api_key_here
|
|
|
|
# Google Custom Search Engine ID (CX)
|
|
# Get from: https://programmablesearchengine.google.com/
|
|
GOOGLE_CX=your_google_cx_id_here
|
|
|
|
# ============================================
|
|
# Database Configuration
|
|
# ============================================
|
|
|
|
# MongoDB Connection URI
|
|
# Format: mongodb+srv://username:password@cluster.mongodb.net/?retryWrites=true&w=majority
|
|
# Get from: https://cloud.mongodb.com/
|
|
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/?retryWrites=true&w=majority
|
|
|
|
# ============================================
|
|
# Admin Configuration
|
|
# ============================================
|
|
|
|
# Discord User ID of the bot administrator
|
|
# Right-click your username in Discord (with Developer Mode enabled) and select "Copy ID"
|
|
ADMIN_ID=your_discord_user_id_here
|
|
|
|
# ============================================
|
|
# Logging Configuration (Optional)
|
|
# ============================================
|
|
|
|
# Discord webhook URL for logging bot errors and info
|
|
# Create a webhook in your Discord channel settings
|
|
LOGGING_WEBHOOK_URL=your_discord_webhook_url_here
|
|
|
|
# Enable/disable webhook logging (true/false)
|
|
ENABLE_WEBHOOK_LOGGING=true
|
|
|
|
# ============================================
|
|
# Timezone Configuration
|
|
# ============================================
|
|
|
|
# Timezone for timestamps and reminders
|
|
# Examples: America/New_York, Europe/London, Asia/Tokyo, Asia/Ho_Chi_Minh
|
|
# Full list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
TIMEZONE=UTC
|
|
|
|
# ============================================
|
|
# File Management Configuration
|
|
# ============================================
|
|
|
|
# How long uploaded files are stored (in hours)
|
|
# Examples:
|
|
# 24 = 1 day
|
|
# 48 = 2 days (default)
|
|
# 72 = 3 days
|
|
# 168 = 1 week
|
|
# -1 = Never expire (permanent storage)
|
|
FILE_EXPIRATION_HOURS=48
|
|
|
|
# ============================================
|
|
# Monitoring & Observability (Optional)
|
|
# ============================================
|
|
|
|
# Sentry DSN for error tracking
|
|
# Get from: https://sentry.io/ (create a project and copy the DSN)
|
|
# Leave empty to disable Sentry error tracking
|
|
SENTRY_DSN=
|
|
|
|
# Environment name for Sentry (development, staging, production)
|
|
ENVIRONMENT=development
|
|
|
|
# Sentry sample rate (0.0 to 1.0) - percentage of errors to capture
|
|
# 1.0 = 100% of errors, 0.5 = 50% of errors
|
|
SENTRY_SAMPLE_RATE=1.0
|
|
|
|
# Sentry traces sample rate for performance monitoring (0.0 to 1.0)
|
|
# 0.1 = 10% of transactions, lower values recommended for high-traffic bots
|
|
SENTRY_TRACES_RATE=0.1
|
|
|
|
# Log level (DEBUG, INFO, WARNING, ERROR)
|
|
LOG_LEVEL=INFO
|