Skip to content

VEKAgg/vekamj

Repository files navigation

VEKA Bot

A modern, feature-rich Discord bot built with nextcord, featuring a modular architecture and best practices for scalability and maintainability.

CI CD codecov

Features

  • 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

Prerequisites

  • Python 3.10 or higher
  • MongoDB (optional)
  • Redis (optional)
  • Discord Bot Token
  • Docker (optional, but recommended)

Installation

Using Docker (Recommended)

  1. Clone the repository:
git clone https://github.com/yourusername/veka-bot.git
cd veka-bot
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your Discord bot token and other settings
  1. Start the services:
docker compose up -d

Manual Installation

  1. Create and activate a conda environment:
conda create -n veka-bot python=3.10
conda activate veka-bot
  1. Install dependencies:
# Install core dependencies
pip install .

# Install development dependencies (optional)
pip install ".[dev]"

# Install test dependencies (optional)
pip install ".[test]"
  1. Set up environment variables and start the bot:
cp .env.example .env
# Edit .env with your settings
python main.py

Development

Code Style and Quality

The project uses several tools to maintain code quality:

  • black for code formatting
  • isort for import sorting
  • mypy for static type checking
  • ruff for fast linting

You can run these tools using:

# Format code
black .
isort .

# Type checking
mypy .

# Linting
ruff check .

Pre-commit Hooks

Set up pre-commit hooks to automatically check code quality:

pre-commit install --install-hooks

Running Tests

pytest

Docker Development

For development with Docker:

  1. Build the development image:
docker compose build
  1. Run with development settings:
docker compose up
  1. View logs:
docker compose logs -f bot

Deployment

Using GitHub Actions (Recommended)

  1. Push a new tag to trigger deployment:
git tag v1.0.0
git push origin v1.0.0
  1. The CD pipeline will:
    • Build and push Docker image to GitHub Container Registry
    • Create a GitHub Release
    • Generate release notes

Manual Deployment

  1. Build the production image:
docker build -t veka-bot .
  1. Run in production:
docker compose -f docker-compose.yml up -d

Project Structure

veka-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

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes (using commitizen)
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors