-
Notifications
You must be signed in to change notification settings - Fork 0
Home
A comprehensive Discord bot with advanced moderation, entertainment features, and external service integrations. Built with Python 3.8+ and discord.py 2.3.2.
This Discord bot provides a complete server management solution with:
- Modular Architecture: Clean separation of concerns with cogs-based structure
- Comprehensive Features: Moderation, games, achievements, osu! integration, GitHub monitoring
- Security: Built-in anti-spam, blacklist system, report system
- Type Safety: Type hints throughout the codebase
- Language: Python 3.8+
- Framework: discord.py 2.3.2
- Testing: pytest with asyncio support
- Code Quality: Black, flake8, isort
- CI/CD: GitHub Actions
- Message Management: Bulk deletion, edit/delete logging
- User Moderation: Kick, ban, mute (timeout), warn commands
- Audit Logging: Member join/leave, voice, role, nickname, channel events
- Blacklist System: Global blacklist with appeal system (Modal + View)
- Bot Appearance: Per-guild avatar/banner with developer approval
- 7-Layer Anti-Spam: Flood, duplicate, mention, link, emoji, newline, raid detection
- Report System: Right-click context menu reporting with mute/ban/warn modals
- Auto Escalation: Progressive punishment for repeat offenders
- Raid Detection: Mass-join detection with auto-lockdown
- Achievement System: Chat, game, social, and special achievements
- Giveaway System: Button-based participation, auto-expiry
- Welcome Messages: Customizable messages with auto-role
- Role/Emoji Management: Assign/remove roles, upload emojis
- Deep Sea Oxygen: 2-player cooperative game with shared oxygen
- Russian Roulette: 2-player competitive game with items and chips
- osu! Integration: Player stats, bind, best plays, recent plays, scores
- GitHub Monitoring: Repository watch + keeiv/bot tracking
- GitHub Diagnostics: API status and rate limit checks
- Performance Dashboard: Cache stats, network status, API optimization
- System Maintenance: Cleanup, cache management
- Network Diagnostics: Connectivity testing
- Python 3.8 or higher
- Discord Bot Token
- Clone the repository
git clone https://github.com/keeiv/bot.git
cd bot- Set up virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Configure environment
cp .env.example .env
# Edit .env with your Discord bot token- Run the bot
python -m src.mainCreate a .env file with the following required variables:
DISCORD_TOKEN=your_bot_token_here
# Optional configurations
GITHUB_TOKEN=your_github_token
OSU_API_KEY=your_osu_api_keybot/
├── src/
│ ├── bot.py # Main bot class and initialization
│ ├── main.py # Application entry point
│ ├── cogs/ # Discord command modules
│ │ ├── core/ # Core functionality (admin, logging)
│ │ ├── features/ # Feature modules (achievements, integrations)
│ │ └── games/ # Entertainment games
│ ├── utils/ # Utility functions and helpers
│ └── bot_types/ # Type definitions
├── tests/ # Test suite
├── docs/ # Documentation
├── scripts/ # Development and utility scripts
├── data/ # Runtime data storage
└── .github/workflows/ # CI/CD pipeline configuration
Bot Core (src/bot.py)
- Main bot class inheriting from discord.ext.commands.Bot
- Cog loading and management
- Event handling setup
Cogs System (src/cogs/)
- Modular command organization
- Separation by functionality
- Independent feature development
Utilities (src/utils/)
- Shared helper functions
- Configuration management
- Common operations
Type System (src/bot_types/)
- Centralized type definitions
- Data structure specifications
- Interface contracts
This project enforces strict development standards through automated checks:
English-First Policy
- All code, comments, and documentation must be in English
- Variable names use descriptive English words
- User-facing strings must be English
- Docstrings follow Google style with English descriptions
Formatting Standards
- 4-space indentation for Python files
- 88-character line length limit
- Consistent import organization
- Type hints for all public APIs
Quality Assurance
- Automated testing with >80% coverage
- Static type checking with MyPy strict mode
- Security vulnerability scanning
- Code complexity analysis
Continuous Integration
- Multi-version Python testing (3.8-3.11)
- Automated code quality checks
- English standards compliance verification
- Security scanning and reporting
Pre-commit Hooks
- Automatic code formatting
- Import sorting
- Linting and style checking
- Type validation
- Installation Guide: Detailed setup instructions
- Configuration: Environment variables and settings
- API Reference: Complete API documentation
- Development: Development setup and guidelines
- Deployment: Production deployment options
- Troubleshooting: Common issues and solutions
All public APIs include comprehensive docstrings following Google style:
async def process_command(self, ctx: commands.Context, command_name: str) -> bool:
"""Process a user command and return execution status.
Args:
ctx: The command context containing user information.
command_name: The name of command to process.
Returns:
True if command was executed successfully, False otherwise.
Raises:
ValueError: If command_name is empty or invalid.
CommandError: If command execution fails.
"""We welcome contributions from the community! Please review our Contributing Guide before submitting pull requests.
- Fork the repository
-
Create a feature branch:
git checkout -b feature/your-feature - Follow coding standards: English-only, properly formatted code
- Add tests: Ensure >80% coverage for new features
- Submit pull request: With clear description and testing
- All contributions must pass automated CI checks
- Code must follow English-only standards
- New features require comprehensive tests
- Documentation must be updated for API changes
- GitHub Issues: Report bugs and request features
- GitHub Discussions: Ask questions and share ideas
- Wiki: Comprehensive documentation and guides
- Code Review: Maintainer review and feedback
This project is licensed under the MIT License. See LICENSE for details.
For support and questions:
- Documentation: Check the wiki
- Issues: Report bugs
- Discussions: Community forum
Thank you for using our Discord bot! We're committed to providing a high-quality, well-documented, and secure solution for Discord server management.