play.zombielandia.fun

Create a discord vouch system bot that sends vouch embed using a command to type in discord all can be configurable

2 images attached
play.zombielandia.fun

Create a discord vouch system bot that sends vouch embed using a command to type in discord all can be configurable

Kodari AI
KodariJan 1 at 3:49 pm 211 (v2)
VouchBot
A Discord bot for managing a vouch system where users can submit vouches via commands, sending customizable embeds to a designated channel. Features include configurable embed colors, fields, channel settings, and permission roles for vouching and moderation.
play.zombielandia.fun

Sample look

2 images attached
play.zombielandia.fun

Look

1 image attached
Kodari can make mistakes. Review important code before using.
Files
bot.py
config.json
requirements.txt
Code
3 49
bot.py
import discord
from discord.ext import commands
import json
import os
from dotenv import load_dotenv

load_dotenv()

with open('config.json', 'r') as f:
    config = json.load(f)

bot = commands.Bot(command_prefix=config['prefix'], intents=discord.Intents.all())

@bot.event
async def on_ready():
    print(f'Bot is ready! Logged in as {bot.user}')

@bot.command()
async def vouch(ctx, member: discord.Member, *, reason):
    if config['vouch_channel'] and ctx.channel.id != config['vouch_channel']:
        await ctx.send(f'Vouches can only be sent in <#{config["vouch_channel"]}>')
        return
    if config['required_role'] and not any(role.id in config['required_role'] for role in ctx.author.roles):
        await ctx.send('You do not have permission to vouch.')
        return
    embed = discord.Embed(
        title=config['embed']['title'],
        description=config['embed']['description'].format(user=member.mention, reason=reason),
        color=config['embed']['color']
    )
    embed.set_footer(text=config['embed']['footer'])
    channel = bot.get_channel(config['vouch_channel'])
    await channel.send(embed=embed)
    await ctx.send('Vouch submitted!')

bot.run(os.getenv('DISCORD_TOKEN'))