Skip to content

06T/DCordVouches

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Discord Vouch Bot v2.0

Professional vouch management for Discord servers

Python Version Discord.py License: MIT PRs Welcome Maintenance


Upgrade your Discord server's vouch system with slash commands, analytics, and cloud-ready features

Quick Start โ€ข Features โ€ข Commands โ€ข Installation โ€ข Deploy


Why Choose This Bot?

Before (v1.0)

  • โŒ Basic JSON file storage
  • โŒ Limited search capabilities
  • โŒ No advanced analytics
  • โŒ Prone to data loss
  • โŒ Manual backup required
  • โŒ Basic embed design

After (v2.0)

  • โœ… Professional database system
  • โœ… Advanced search & filtering
  • โœ… Analytics dashboard
  • โœ… Automatic backups & migration
  • โœ… Cloud deployment ready
  • โœ… Modern interactive UI

Features

Core System

Slash commands with interactive UI, autocomplete, and embeds

Flexible Storage

SQLite, PostgreSQL & JSON support with filtering and fast queries

Analytics Suite

Statistics, user analytics, and insights

Security First

Role-based permissions, audit logging, and input validation

Cloud Ready

Deployment to Railway, Heroku, and other cloud platforms

Performance

Async operations, connection pooling, and caching


Quick Start

Get up and running in under 5 minutes with automated setup.

Option 1: Automated Setup (Recommended)

Windows:

# 1๏ธโƒฃ Download setup.bat
# 2๏ธโƒฃ Right-click โ†’ "Run as administrator"
# 3๏ธโƒฃ Follow the interactive wizard
# Bot is ready!

Linux/Mac:

# 1๏ธโƒฃ Make executable and run
chmod +x setup.sh && ./setup.sh
# 2๏ธโƒฃ Follow the interactive wizard  
# Bot is ready!

Option 2: Manual Setup

# 1๏ธโƒฃ Clone and install
git clone https://github.com/06T/DCordVouches.git
cd DCordVouches
pip install -r requirements.txt

# 2๏ธโƒฃ Configure (choose your storage type)
cp config.ini.example config.ini
# Edit config.ini with your bot token and settings

# 3๏ธโƒฃ Choose storage: SQLite, PostgreSQL, or JSON
# DATABASE_TYPE = sqlite    # Local database (recommended)
# DATABASE_TYPE = json      # Simple files (original format)  
# DATABASE_TYPE = postgresql # Cloud database (production)

# 4๏ธโƒฃ Run the bot
python bot.py

# ๐Ÿ”„ Migrating from v1.0? Run this first:
python migrate.py

Your bot is now running with all the features!


๐Ÿ“ฑ Commands Overview

๐Ÿ‘ฅ User Commands

Command Description Example
/vouch Submit a vouch with rating /vouch product:Discord Bot review:Great bot! stars:5
/myvouch View your personal vouch history /myvouch
/stats Server-wide vouch statistics /stats

๐Ÿ›ก๏ธ Admin Commands

Command Description Access
/admin restore Restore all vouches to channel Admin Role
/admin export Export data to JSON Admin Role
/admin delete Remove specific vouch Admin Role
/admin purge Clean old vouches (30+ days) Admin Role
/analytics Analytics dashboard Access Role

๐Ÿ’พ Installation

Automated Setup (Recommended)

Get started in minutes with our interactive setup wizards:

Windows Users:

# Download and run the setup script
setup.bat
# Follow the interactive prompts - no technical knowledge required!

Linux/Mac Users:

# Make executable and run
chmod +x setup.sh && ./setup.sh
# Follow the interactive prompts - handles everything automatically!

What the setup wizard does:

  • โœ… Validates Python installation
  • โœ… Installs all dependencies
  • โœ… Guides you through Discord setup
  • โœ… Creates configuration interactively
  • โœ… Offers database choice (SQLite/PostgreSQL/JSON)
  • โœ… Migrates old data if present
  • โœ… Starts your bot immediately

๐Ÿ”ง Manual Installation

๐Ÿ“ SQLite Database (Recommended)

Good for most servers:

git clone https://github.com/06T/DCordVouches.git
cd DCordVouches
pip install -r requirements.txt
cp config.ini.example config.ini

Configuration:

[Bot]
TOKEN = your_bot_token_here
DATABASE_TYPE = sqlite
DATABASE_URL = vouches.db
REVIEW_CHANNEL_ID = 123456789012345678
ACCESS_ROLE_ID = 123456789012345678
๐Ÿ“„ JSON File Storage (Original Format)

Simple file-based storage, compatible with v1.0:

# Same installation as above
pip install -r requirements.txt
cp config.ini.example config.ini

Configuration:

[Bot]
TOKEN = your_bot_token_here
DATABASE_TYPE = json
DATABASE_URL = vouches.json
REVIEW_CHANNEL_ID = 123456789012345678
ACCESS_ROLE_ID = 123456789012345678

Features:

  • โœ… Human-readable data format
  • โœ… Easy manual editing/inspection
  • โœ… Automatic backups (keeps last 5)
  • โœ… Compatible with original vouch system
  • โœ… All modern features still available
๐ŸŒ PostgreSQL Database (Production)

Cloud database for large servers and production deployment:

Step 1: Database Setup

  • Create PostgreSQL database (Railway, Heroku, AWS RDS, etc.)
  • Copy the connection URL

Step 2: Configuration

[Bot]
TOKEN = your_bot_token_here
DATABASE_TYPE = postgresql
DATABASE_URL = postgresql://user:password@host:port/database
REVIEW_CHANNEL_ID = 123456789012345678
ACCESS_ROLE_ID = 123456789012345678

Step 3: Deploy

python bot.py  # Local development
# Or deploy to cloud platform
๐Ÿ”„ Migration from v1.0

Upgrade your existing vouch data:

# 1. Backup your data (recommended)
cp vouches.json vouches_backup.json

# 2. Set up the new bot (follow installation above)

# 3. Run migration
python migrate.py

# 4. Verify migration
python -c "from database import *; import asyncio; asyncio.run(DatabaseManager().get_stats())"

Migration features:

  • โœ… Preserves all existing vouches
  • โœ… Maintains user data and timestamps
  • โœ… Creates automatic backup
  • โœ… Validates data integrity
  • โœ… Zero downtime migration

๐ŸŒ Deployment

๐Ÿš„ Railway

Deploy on Railway

Easy deployment

  • Automatic PostgreSQL
  • Environment variables
  • Instant scaling

๐ŸŸฃ Heroku

Deploy to Heroku

Traditional PaaS

  • Heroku Postgres add-on
  • Easy configuration
  • 24/7 uptime

โ˜๏ธ AWS/GCP

Enterprise deployment

  • RDS/Cloud SQL
  • Auto-scaling
  • Global distribution

๐Ÿณ Docker

Containerized deployment

  • Multi-platform support
  • Easy scaling
  • Kubernetes ready

Environment Variables

# Required
BOT_TOKEN=your_discord_bot_token
REVIEW_CHANNEL_ID=123456789012345678
ACCESS_ROLE_ID=123456789012345678

# Database (choose one)
DATABASE_TYPE=sqlite
DATABASE_URL=vouches.db

# OR for PostgreSQL
DATABASE_TYPE=postgresql
DATABASE_URL=postgresql://user:pass@host:port/db

# Optional
ADMIN_ROLE_ID=123456789012345678
ENABLE_RATE_LIMITING=true
MAX_VOUCHES_PER_HOUR=5
AUDIT_CHANNEL_ID=123456789012345678

๐Ÿ“Š Analytics Features

๐Ÿ“ˆ Real-time Statistics

  • Total vouches and average ratings
  • Activity trends (hourly, daily, weekly)
  • Top products and services
  • User contribution metrics

User Analytics

  • Most active contributors
  • Highest rated users
  • Time-based filtering
  • Custom ranking periods

Data Analytics

  • Rating distribution analysis
  • Product performance tracking
  • Time-based activity patterns
  • Export capabilities (JSON)

๐Ÿ” Search & Filtering

  • Search by user, product, rating
  • Date range filtering
  • Keyword matching
  • Pagination for large datasets

๐Ÿ”ง Configuration Reference

๐Ÿ“‹ Complete Configuration Options
[Bot]
# === Required Settings ===
TOKEN = your_bot_token_here                    # Discord bot token
REVIEW_CHANNEL_ID = 0                          # Channel for vouch posts
ACCESS_ROLE_ID = 0                             # Role for restricted commands

# === Bot Appearance ===
PREFIX = !                                     # Command prefix (legacy)
STATUS = Managing vouches                      # Bot status message
EMBED_COLOR = 00ff00                          # Hex color for embeds
FOOTER_TEXT = Vouch System v2.0               # Footer text
THUMBNAIL_URL =                               # Optional thumbnail URL

# === Security & Permissions ===
ADMIN_ROLE_ID = 0                             # Admin role for sensitive commands
ENABLE_RATE_LIMITING = true                   # Enable anti-spam protection
MAX_VOUCHES_PER_HOUR = 5                      # Rate limit threshold

# === Database Configuration ===
DATABASE_TYPE = sqlite                        # sqlite, postgresql, or json
DATABASE_URL = vouches.db                     # Connection string

# === Logging & Monitoring ===
ENABLE_AUDIT_LOG = true                       # Enable action logging
AUDIT_CHANNEL_ID = 0                          # Channel for audit logs

# === Analytics ===
ENABLE_ANALYTICS = true                       # Enable analytics features
ANALYTICS_UPDATE_INTERVAL = 3600              # Update frequency (seconds)

๐Ÿ›ก๏ธ Security Features

๐Ÿ”’ Input Security

  • SQL injection protection
  • XSS prevention
  • File validation
  • Input sanitization

๐Ÿ‘ฎ Access Control

  • Role-based permissions
  • Command restrictions
  • Admin-only functions
  • User rate limiting

๐Ÿ“ Audit Trail

  • Complete action logging
  • User activity tracking
  • Admin oversight
  • Compliance ready

๐Ÿ—๏ธ Architecture

graph TD
    A[Discord User] -->|Slash Commands| B[Bot.py]
    B --> C[Cogs System]
    C --> D[Vouch Cog]
    C --> E[Admin Cog] 
    C --> F[Stats Cog]
    
    D --> G[Database Manager]
    E --> G
    F --> G
    
    G --> H[SQLite]
    G --> I[PostgreSQL]
    G --> J[JSON Files]
    
    B --> K[Utils & UI]
    K --> L[Pagination]
    K --> M[Rate Limiting]
    K --> N[Validation]
Loading

๐Ÿค Contributing

We welcome contributions from the community!

Contributors Issues Pull Requests

๐Ÿ› ๏ธ Development Setup

# Fork the repository and clone your fork
git clone https://github.com/06T/DCordVouches.git
cd DCordVouches

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Create a feature branch
git checkout -b feature/your-new-feature

# Make your changes and test
python bot.py

# Commit and push
git commit -m "Add new feature"
git push origin feature/your-new-feature

# Create a Pull Request

๐Ÿ“‹ Contribution Guidelines

  • ๐Ÿ› Bug Reports: Use GitHub Issues with reproduction steps
  • ๐Ÿ’ก Feature Requests: Describe the use case and expected behavior
  • ๐Ÿ”ง Pull Requests: Include tests and documentation updates
  • ๐Ÿ“ Code Style: Follow PEP 8 and include type hints
  • โœ… Testing: Ensure all tests pass before submitting

๐Ÿ“š Documentation

๐Ÿ“– Quick Start Guide

QUICKSTART.md 5-minute setup guide

๐Ÿ”ง Installation Guide

install.md Complete installation documentation

โš™๏ธ Configuration

config.ini.example Configuration template


๐Ÿ“„ License

This project is licensed under the MIT License

License: MIT

See LICENSE file for details


๐Ÿ™ Acknowledgments

Built with โค๏ธ by the community, for the community

Discord.py Python PostgreSQL

  • discord.py - The foundation of our bot
  • aiosqlite & asyncpg - Database magic
  • Community feedback - Driving continuous improvement
  • Open source contributors - Making this project better every day

Star this project if you found it helpful!

GitHub stars GitHub forks


Made with ๐Ÿ’– for the Discord community

Last updated: July 2025