A comprehensive Discord bot for Pokemon enthusiasts with gambling features, Pokemon information lookup, and trade tracking.
- Pokemon Search: Look up Pokemon by name or Pokedex number
- Random Pokemon Roll: Roll random Pokemon with detailed stats
- Auto-Dex Integration: Automatically responds to other Pokemon bots with enhanced information
- User Registration: Register to participate in gambling features
- Profile System: Track your gambling statistics and earnings
- Leaderboards: Compete with other users on earnings and activity
- Trade Tracking: Automatically track and log Pokemon trades
- User Management: Add/remove coins from user accounts
- Profile Viewing: View any user's profile
- Database Management: Automatic daily backups
PokeDeskie/
├── bot.py # Main bot entry point
├── config.py # Configuration management
├── database.py # Database operations
├── utils.py # Utility functions
├── requirements.txt # Python dependencies
├── cogs/ # Command modules
│ ├── admin.py # Admin commands
│ ├── events.py # Event handlers
│ ├── gambling.py # Gambling commands
│ ├── help.py # Help command
│ └── pokemon.py # Pokemon commands
├── Config.json # Bot configuration
├── PokeDex.json # Pokemon data
├── Profile.db # User database
└── Trades.json # Trade logs
- Python 3.8 or higher
- A Discord bot token
- Discord server with appropriate permissions
-
Clone/Download the project
cd PokeDeskie
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
export BOT_TOKEN="your_discord_bot_token_here"
Or create a
.env
file:BOT_TOKEN=your_discord_bot_token_here
-
Configure the bot Edit
Config.json
to set up your channels:{ "trade_log": 123456789, "rand_channels": [123456789, 987654321], "trade_channels": [123456789], "WEBHOOK_URL": "your_webhook_url_for_backups" }
-
Run the bot
python bot.py
+register
- Register in the gambling system+profile
/+p
[user] - View gambling profile+leaderboard
/+lb
- View earnings leaderboard+leaderboardgambles
/+lbg
- View activity leaderboard+ping
- Check bot status and uptime+roll
/+r
- Roll a random Pokemon+search
/+poke
<name/number> - Search for Pokemon+help
- Show help information
+adminprofile
/+ap
- View any user's profile+addnet
/+anet
- Add coins to user+removenet
/+rnet
- Remove coins from user
- Random Channels: Channels where Pokemon information is automatically displayed
- Trade Channels: Channels where trade activities are monitored
- Trade Log: Channel where trade logs are posted
The bot integrates with several Pokemon bots:
- Carl Bot (ID: 235148962103951360)
- PK2 Assistant (ID: 854233015475109888)
- YAMPB (ID: 204255221017214977)
- Poketwo (ID: 716390085896962058)
The bot uses SQLite with the following user table structure:
CREATE TABLE users (
user_id TEXT PRIMARY KEY,
net_total INTEGER DEFAULT 0,
max_gambled INTEGER DEFAULT 0,
gamble_wins INTEGER DEFAULT 0,
gamble_losses INTEGER DEFAULT 0,
gamble_wins_streak INTEGER DEFAULT 0,
gamble_losses_streak INTEGER DEFAULT 0
);
bot.py
: Main entry point, handles bot initialization and cog loadingconfig.py
: Configuration management with environment variable supportdatabase.py
: Database operations with connection pooling and error handlingutils.py
: Utility functions for Pokemon data, embeds, and formatting
admin.py
: Administrator commands for user managementevents.py
: Event handlers for messages, trades, and bot integrationgambling.py
: User registration, profiles, and leaderboardshelp.py
: Help command with dynamic admin command displaypokemon.py
: Pokemon search and random roll functionality
- Modular Structure: Separated code into logical modules and cogs
- Error Handling: Comprehensive error handling throughout
- Database Safety: Context managers for database connections
- Configuration Management: Centralized config with environment variable support
- Code Documentation: Extensive docstrings and comments
- Type Hints: Added where appropriate for better code maintainability
- Single Responsibility: Each module has a clear, focused purpose
- DRY Principle: Eliminated code duplication
- Error Recovery: Graceful handling of missing data and failed operations
- Security: No hardcoded tokens, proper permission checks
- Maintainability: Clear structure and documentation
- Bot won't start: Check if BOT_TOKEN is set correctly
- Commands not working: Verify bot has necessary permissions
- Database errors: Ensure write permissions in bot directory
- Pokemon data missing: Check if PokeDex.json exists and is valid
The bot provides console output for:
- Successful cog loading
- Database operations
- Error conditions
- Trade processing
When contributing to this project:
- Follow the existing code structure
- Add appropriate error handling
- Include docstrings for new functions
- Test thoroughly before submitting
- Update documentation as needed
This project is provided as-is for educational and personal use.