Skip to content

A Vouch bot remade from a plex tickets addon to be standalone

License

Notifications You must be signed in to change notification settings

ptraced/Vouch-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vouch Bot

A Discord bot for managing user vouches and reviews with star ratings and customizable embeds.

Features

  • Slash Commands: Modern Discord slash command interface
  • Star Ratings: 1-5 star rating system with visual stars
  • User-Specific Vouching: Option to vouch for specific users or the business as a whole
  • Image Attachments: Optional image upload for proof/evidence
  • Role Restrictions: Limit vouch command usage to specific roles
  • Customizable Embeds: Fully customizable embed colors, titles, and field names
  • Vouch Counter: Automatic numbering of vouches
  • MongoDB Storage: All vouches are stored in MongoDB for persistence and recovery
  • Vouch Recovery: Use /recover to repost all vouches if a channel gets deleted

Setup

Prerequisites

  • Node.js 22.22.0 or higher
  • A Discord bot token and application
  • Discord server with appropriate permissions
  • A MongoDB database (Atlas or self-hosted)

MongoDB Setup

You need a MongoDB database to store vouches. You have two options:

Option 1: MongoDB Atlas (Recommended)

  1. Go to MongoDB Atlas and create a free account
  2. Create a free cluster
  3. Create a database user and whitelist your IP
  4. Get your connection string (it looks like mongodb+srv://user:pass@cluster.mongodb.net/vouchbot)

Option 2: Self-Hosted MongoDB

If you prefer to host MongoDB yourself, follow the official installation guide for your platform:

Your connection string for a local instance will typically be mongodb://localhost:27017/vouchbot.

Installation

  1. Clone or download this repository

  2. Install dependencies

    npm install
  3. Configure the bot

    Edit config.yml and replace the placeholder values:

    # Bot Configuration
    botToken: "YOUR_BOT_TOKEN_HERE"     # Your Discord bot token
    clientId: "YOUR_CLIENT_ID_HERE"     # Your Discord application/client ID
    guildId: "YOUR_GUILD_ID_HERE"       # Your Discord server ID (optional)
    
    # MongoDB Configuration
    mongoURI: "YOUR_MONGODB_CONNECTION_STRING_HERE"
    
    # Other settings
    vouchChannelId: "CHANNEL_ID_HERE"   # Channel where vouches will be sent
    requiredRoles: ["ROLE_ID_1", "ROLE_ID_2"]  # Roles that can use vouch command
  4. Start the bot

    npm start

Getting Discord IDs

To get the required IDs:

  1. Bot Token & Client ID:

    • Go to Discord Developer Portal
    • Create a new application or select existing one
    • Go to "Bot" section for the token
    • Go to "General Information" for the Client ID
  2. Guild ID (Server ID):

    • Enable Developer Mode in Discord settings
    • Right-click your server → "Copy Server ID"
  3. Channel ID:

    • Right-click the channel → "Copy Channel ID"
  4. Role ID:

    • Right-click the role → "Copy Role ID"

Bot Permissions

Your bot needs the following permissions:

  • Send Messages
  • Use Slash Commands
  • Embed Links
  • Attach Files (if image uploads are enabled)
  • Read Message History

Configuration Options

Basic Settings

  • allowUserSpecificVouch: Allow vouching for specific users (true/false)
  • uploadImage: Require image attachments for vouches (true/false)
  • requiredRoles: Array of role IDs that can use the vouch command
  • mongoURI: Your MongoDB connection string

Customization

All embed elements can be customized in the customization section:

customization:
  embedColor: "#5e99ff"
  vouchTitle: "🎉 Vouch (#${count})"
  vouchFooterText: "Vouched by ${authorTag}"
  userFieldTitle: "Vouched User"
  vouchedByFieldTitle: "Vouched By"
  vouchedAtFieldTitle: "Vouched at"
  starsFieldTitle: "Stars"
  messageDescription: "${messageContent}"

Bot Status

Configure the bot's activity status:

botStatus:
  activity: "Managing vouches"
  type: 0  # 0 = Playing, 1 = Streaming, 2 = Listening, 3 = Watching, 5 = Competing

Usage

/vouch Command

Users with the required roles can use the /vouch command with the following options:

  • message (required): The vouch message/review
  • stars (required): Rating from 1-5 stars
  • user (optional): The user being vouched for (if enabled in config)
  • attachment (optional): Image proof (if enabled in config)

/recover Command

Administrators can use the /recover command to repost all vouches from the database into the vouch channel. This is useful if the vouch channel gets accidentally deleted — just create a new channel, update the vouchChannelId in config.yml, restart the bot, and run /recover.

File Structure

vouch-bot/
├── commands/
│   ├── vouch.js          # Vouch command implementation
│   └── recover.js        # Vouch recovery command
├── models/
│   └── Vouch.js          # MongoDB vouch schema
├── config.yml            # Bot configuration
├── db.js                 # MongoDB connection utility
├── index.js              # Main bot file
├── package.json          # Dependencies and scripts
└── README.md             # This file

Development

For development with auto-restart:

npm run dev

Support

If you encounter any issues:

  1. Check that all IDs in config.yml are correct
  2. Ensure the bot has proper permissions in your server
  3. Verify that your MongoDB connection string is correct and the database is reachable
  4. Verify that slash commands were deployed successfully
  5. Check the console for error messages

About

A Vouch bot remade from a plex tickets addon to be standalone

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published