-
Notifications
You must be signed in to change notification settings - Fork 0
13. FAQ
Common questions and answers about UtilsBot+ setup, usage, and troubleshooting.
- General Questions
- Setup & Installation
- Commands & Features
- API & Integrations
- Troubleshooting
- Development & Contributing
UtilsBot+ is a modern, feature-rich Discord bot built with Python 3.11+ that provides comprehensive utilities including:
- 🤖 AI integration with Google Gemini
- 🎮 Interactive games (Wordle)
- 🌐 Network tools (screenshots, IP lookup, URL unshortening)
- 🔒 Security tools (TOTP, QR codes, password generation)
- ⚙️ Developer utilities (code evaluation, hot reload)
Yes! UtilsBot+ is completely free and open-source. It uses free tiers of external APIs:
- Google Gemini: 15 requests/minute (free tier)
- IP Geolocation: 1000 requests/month (free tier)
- Screenshot API: Optional paid service for enhanced screenshots
- Slash Commands Only: Modern Discord UX with no prefix commands
- AI-Powered: Built-in Google Gemini integration for intelligent responses
- Security-First: Permission layers, input validation, and user whitelisting
- Developer-Friendly: Hot reload, code evaluation, and comprehensive error handling
- Production-Ready: Structured logging, database integration, and monitoring
Absolutely! UtilsBot+ is designed for easy self-hosting with:
- Docker support for one-command deployment
- Comprehensive setup scripts
- Multiple database options (SQLite, PostgreSQL, MySQL)
- Cloud platform deployment guides
Minimum Requirements:
- Python 3.11 or higher
- 512MB RAM
- 2GB storage
- Internet connection for Discord API and external services
Recommended:
- Python 3.12
- 1GB+ RAM
- 5GB+ storage
- Dedicated server or VPS
- Go to the Discord Developer Portal
- Click "New Application" and give it a name
- Go to "Bot" section and click "Add Bot"
- Copy the token under "Token" section
- Important: Keep this token secret and never share it publicly
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the generated API key
- The free tier provides 15 requests per minute
Essential Permissions:
- ✅ Send Messages
- ✅ Use Slash Commands
- ✅ Embed Links
- ✅ Attach Files (for screenshots and QR codes)
- ✅ Read Message History
Optional Permissions:
- 📊 View Server Members (for analytics)
- 🔧 Manage Messages (for bot management)
- Go to Discord Developer Portal → Your Application → OAuth2 → URL Generator
- Select scopes:
bot
andapplications.commands
- Select the permissions listed above
- Copy the generated URL and open it in your browser
- Select your server and authorize the bot
Slash commands provide a better user experience:
- Discoverability: Users can see available commands with autocomplete
- Validation: Built-in parameter validation and help text
- Performance: More efficient than scanning all messages for prefixes
- Security: Better permission handling and user identification
Use /help
to see all commands organized by category:
-
Information:
/info
,/ping
,/version
,/help
-
AI:
/ask
,/chat
-
Games:
/wordle
-
Network:
/screenshot
,/ip
,/unshorten
-
Tools:
/totp
,/qr
,/base64
,/hash
,/password
- Admin: Developer and whitelist commands
The whitelist system allows bot owners to restrict access during beta testing:
- Closed Beta: Only whitelisted users can use the bot
- Developer Override: Bot developers always have access
- Database Tracking: Whitelist status stored in database
-
Commands:
/whitelist add/remove/list/check
(dev-only)
The bot tracks comprehensive game statistics:
- Games Played: Total number of games started
- Win Rate: Percentage of games won
- Best Score: Best performance achieved
- Achievements: Special milestones and accomplishments
- Persistent: Stats saved across bot restarts
Yes, your privacy is protected:
- No Storage: Conversations are not permanently stored
- Rate Limiting: 3 questions per minute to prevent spam
- Ephemeral Options: Most AI responses can be made private
- Context Aware: AI has context about Discord but not personal data
Core APIs:
- Google Gemini 1.5 Flash: AI responses and chat (free tier: 15/min)
- ip-api.com: IP geolocation lookup (free tier: 1000/month)
Optional APIs:
- ScreenshotOne: Enhanced website screenshots (paid service)
- RapidAPI: Additional API endpoints (varies by service)
UtilsBot+ includes comprehensive error handling:
- Graceful Degradation: Features fail safely without crashing
- User Feedback: Clear error messages explaining issues
- Fallbacks: Local alternatives where possible (e.g., screenshot placeholders)
- Retry Logic: Automatic retry for temporary failures
- Sign up for ScreenshotOne
- Get your API key from the dashboard
- Add
SCREENSHOT_API_KEY=your_key
to your.env
file - Restart the bot to enable enhanced features
Enhanced Features:
- Higher resolution screenshots
- Full-page capture
- Custom viewport sizes
- Ad blocking
- Faster processing
Yes, each API has different limits:
Google Gemini (Free Tier):
- 15 requests per minute
- 1 million input tokens per minute
- 8,192 output tokens per response
IP Geolocation:
- 1,000 requests per month
- No daily limits
Bot Rate Limiting:
- AI commands: 3 per minute per user
- Other commands: 5 per minute per user
- Global cooldown: 2 seconds between commands
Common Issues:
- Invalid Bot Token: Verify token in Discord Developer Portal
-
Missing Dependencies: Run
pip install -r requirements.txt
- Python Version: Ensure Python 3.11+ is installed
-
Environment Variables: Check
.env
file exists and has required values - Permissions: Ensure bot has necessary permissions in Discord
Debug Steps:
# Check Python version
python --version
# Verify dependencies
pip list | grep discord
# Test environment loading
python -c "from config.settings import settings; print(settings.bot_token[:10])"
# Check logs
tail -f logs/bot.log
Solutions:
-
Sync Commands: Use
/sync
command (dev-only) -
Check Permissions: Ensure bot has
Use Slash Commands
permission - Wait for Propagation: Discord can take up to 1 hour to update commands
-
Guild vs Global: Try syncing to specific guild first:
/sync guild
Common Causes:
-
Invalid API Key: Check Gemini API key in
.env
- Rate Limiting: Wait and try again (3 questions/minute limit)
- API Quota: Verify you haven't exceeded free tier limits
- Network Issues: Check internet connection and API status
Solutions:
-
Initialize Database: Run
python migrations/init_db.py
-
Check Permissions: Ensure write access to
data/
directory -
Database URL: Verify
DATABASE_URL
format in.env
-
SQLite Issues: Delete
data/bot.db
and reinitialize if corrupted
Optimization Tips:
-
Reduce Log Level: Set
LOG_LEVEL=WARNING
in production - Database Cleanup: Regularly clean old command logs
-
Resource Monitoring: Use
htop
or similar to monitor usage - Connection Pooling: Configure database connection limits
Ways to Contribute:
- Bug Reports: Submit issues on GitHub with detailed information
- Feature Requests: Propose new features or improvements
- Code Contributions: Submit pull requests with new features or fixes
- Documentation: Improve wiki pages and code documentation
- Testing: Help test new features and report issues
# Clone repository
git clone https://github.com/ad1107/utils-bot-plus.git
cd utils-bot-plus
# Create development environment
python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
# Install development dependencies
pip install -r requirements-dev.txt
# Copy environment template
cp .env.example .env
# Edit .env with your credentials
# Initialize database
python migrations/init_db.py
# Run in development mode
python main.py
Example: Adding a /hello
command:
-
Choose the appropriate cog (e.g.,
cogs/tools.py
) - Add the command function:
@app_commands.command(name="hello", description="Say hello to the bot")
@app_commands.describe(name="Your name (optional)")
async def hello(self, interaction: discord.Interaction, name: str = None):
greeting = f"Hello {name}!" if name else "Hello there!"
embed = create_success_embed("Greeting", greeting)
await interaction.response.send_message(embed=embed)
- Add error handling and logging as needed
- Test the command thoroughly
- Update documentation
Code Style:
-
Formatting: Use Black formatter (
black .
) -
Imports: Use isort for import organization (
isort .
) - Type Hints: Include type annotations for all functions
- Docstrings: Document all public functions and classes
- Error Handling: Use try/except blocks for external API calls
Git Workflow:
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-command
- Make your changes with clear, descriptive commits
- Test thoroughly
- Submit a pull request with detailed description
# Install development dependencies
pip install -r requirements-dev.txt
# Run all tests
python -m pytest
# Run with coverage
python -m pytest --cov=.
# Run specific test file
python -m pytest tests/test_commands.py
# Run linting
black --check .
isort --check-only .
mypy .
- Getting Started - Setup and installation guide
- Commands Reference - Complete command documentation
- Troubleshooting - Detailed troubleshooting guide
- Developer Guide - Development and contribution guide
If you couldn't find the answer to your question:
-
Check the logs: Look in
logs/bot.log
for detailed error information - Search GitHub Issues: Your question might already be answered
- Create an Issue: Submit a detailed bug report or feature request
- Join the Community: Connect with other users and developers
When asking for help, please include:
- Bot version (
/version
command output) - Operating system and Python version
- Complete error messages from logs
- Steps to reproduce the issue
- Your configuration (without sensitive tokens)