A modern, feature-rich Discord bot built with nextcord, featuring a modular architecture and best practices for scalability and maintainability.
- Modern async/await syntax
- Modular cog-based command system
- Comprehensive error handling and logging
- Configuration management using YAML and environment variables
- Database integration ready (MongoDB & Redis)
- Clean and maintainable project structure
- Modern Python tooling (pyproject.toml, black, isort, mypy)
- Docker support with multi-stage builds
- CI/CD with GitHub Actions
- Python 3.10 or higher
- MongoDB (optional)
- Redis (optional)
- Discord Bot Token
- Docker (optional, but recommended)
- Clone the repository:
git clone https://github.com/yourusername/veka-bot.git
cd veka-bot- Set up environment variables:
cp .env.example .env
# Edit .env with your Discord bot token and other settings- Start the services:
docker compose up -d- Create and activate a conda environment:
conda create -n veka-bot python=3.10
conda activate veka-bot- Install dependencies:
# Install core dependencies
pip install .
# Install development dependencies (optional)
pip install ".[dev]"
# Install test dependencies (optional)
pip install ".[test]"- Set up environment variables and start the bot:
cp .env.example .env
# Edit .env with your settings
python main.pyThe project uses several tools to maintain code quality:
blackfor code formattingisortfor import sortingmypyfor static type checkingrufffor fast linting
You can run these tools using:
# Format code
black .
isort .
# Type checking
mypy .
# Linting
ruff check .Set up pre-commit hooks to automatically check code quality:
pre-commit install --install-hookspytestFor development with Docker:
- Build the development image:
docker compose build- Run with development settings:
docker compose up- View logs:
docker compose logs -f bot- Push a new tag to trigger deployment:
git tag v1.0.0
git push origin v1.0.0- The CD pipeline will:
- Build and push Docker image to GitHub Container Registry
- Create a GitHub Release
- Generate release notes
- Build the production image:
docker build -t veka-bot .- Run in production:
docker compose -f docker-compose.yml up -dveka-bot/
├── app/ # Main application package
│ ├── core/ # Core bot functionality
│ ├── cogs/ # Command modules
│ ├── database/ # Database connections
│ └── utils/ # Utility functions
├── config/ # Configuration files
├── tests/ # Test suite
├── .github/ # GitHub Actions workflows
├── docs/ # Documentation
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
├── pyproject.toml # Project configuration
└── README.md # Project documentation
- Fork the repository
- Create a feature branch
- Commit your changes (using commitizen)
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.