theunknownextr

Create a professional Discord verification bot for Vengeance SMP with a website-based verification system.

Core Features:

Build a Discord bot where users verify themselves through a website link. The bot should have full setup commands for admins.

Verification Flow:

New members join and automatically get Unverified role.

Members with Unverified role:

Can only see the verification channel Cannot view or access any other channels In the verification channel, the bot sends an embed message with:

Welcome to Vengeance SMP Instructions to verify A button/link to the verification website User clicks the website link, completes verification, then automatically receives Verified role.

Once verified:

Unverified role removed Verified role added All normal server channels become visible Admin Setup Commands:

Create slash commands: /setverifylink <url> Sets the website verification link /setverifychannel <channel> Sets the channel where verification embed will be sent /setunverifiedrole <role> Sets the default unverified role /setverifiedrole <role> Sets the verified member role /sendverifypanel Sends or refreshes the verification embed panel /lockserver Locks all channels from unverified users except verification channel /unlockserver Removes restrictions if needed Embed Design:

Title: Vengeance SMP Verification Description:

Welcome to Vengeance SMP!

To access the server, complete verification using the button below.

Button: Verify Now Extra Features:

Auto DM user after joining with verification instructions Logging channel for successful verifications Anti-alt protection (optional account age check) Custom embed colors (dark red / black theme) Database to save settings permanently Tech Stack:

Python Discord.js v14 Express.js for website verification API MongoDB for storing guild settings Goal:

Professional, smooth, secure verification bot for Vengeance SMP with easy setup commands and automatic role/channel management.

Kodari AI
KodariMay 11 at 8:42 am 10,866 (v2)
VengeanceSMPVerify
A professional Discord verification bot for Vengeance SMP with website-based verification flow. New members receive an Unverified role and can only see the verification channel. After completing verification via a linked website, they automatically receive the Verified role and gain full server access. Features admin slash commands for full setup, verification panel embeds, server locking, DM notifications, verification logging, anti-alt protection, and persistent MongoDB settings storage.

Here’s my plan before writing any code:

  • bot.py — Main entry point, loads cogs, connects to MongoDB

  • config.py — Environment/config loader

  • cogs/verification.py — Verification panel, join events, DM logic

  • cogs/setup.py — All admin slash commands (/setverifylink, /setverifychannel, etc.)

  • cogs/lock.py — /lockserver and /unlockserver logic

  • api/server.py — Express-style Flask API that the website calls to complete verification

  • database/db.py — MongoDB connection and guild settings helpers

  • requirements.txt — All dependencies

  • .env — Token and secrets template

Here’s a full breakdown of what was built:


📁 Project Structure

File
Purpose
bot.py
Entry point — starts bot + background API server
config.py
Loads all env vars
database/db.py
MongoDB async helpers (Motor)
cogs/setup.py
All admin slash commands
cogs/verification.py
Join events, DM logic, panel, role assignment
cogs/lock.py
/lockserver
&
/unlockserver
api/server.py
Flask REST API for website to call
.env
Token + secrets template
requirements.txt
All dependencies

🔗 Verification Flow

  1. Member joins → gets Unverified role automatically

  2. Account age check kicks in (anti-alt) — kicks if too new

  3. Bot DMs the member with the verify link

  4. Member visits website → website POSTs to /verify with guild_id + user_id + secret header

  5. Bot removes Unverified, adds Verified, DMs success, logs to log channel

🌐 API Endpoint

Your website calls:

Plain Text
POST /verify
Headers: X-API-Secret: <your_secret>
Body: { "guild_id": 123, "user_id": 456 }

⚙️ First-Time Setup Order

  1. Fill in .env with your token, MongoDB URI, and API secret

  2. Invite bot with Administrator permission

  3. Run /setunverifiedrole, /setverifiedrole, /setverifychannel, /setverifylink, /setlogchannel

  4. Run /lockserver to restrict channels

  5. Run /sendverifypanel to post the embed

Kodari can make mistakes. Review important code before using.
Files
api
cogs
database
bot.py
config.py
requirements.txt
Code
11 654
bot.py
import discord
from discord.ext import commands
import asyncio
import logging
import sys
from config import DISCORD_TOKEN
from api.server import run_api

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s [%(levelname)s] %(name)s: %(message)s",
    handlers=[
        logging.StreamHandler(sys.stdout),
        logging.FileHandler("bot.log", encoding="utf-8"),
    ]
)
logger = logging.getLogger("VengeanceBot")

COGS = [
    "cogs.setup",
    "cogs.verification",
    "cogs.lock",
]


class VengeanceBot(commands.Bot):
    def __init__(self):
        intents = discord.Intents.all()
        super().__init__(
            command_prefix="!",
            intents=intents,
            help_command=None,
        )

    async def setup_hook(self):
        for cog in COGS:
            try:
                await self.load_extension(cog)
                logger.info(f"Loaded cog: {cog}")
            except Exception as e:
                logger.error(f"Failed to load cog {cog}: {e}")

        await self.tree.sync()
        logger.info("Slash commands synced globally.")

    async def on_ready(self):
        logger.info(f"Logged in as {self.user} (ID: {self.user.id})")
        logger.info(f"Connected to {len(self.guilds)} guild(s)")
        await self.change_presence(
            activity=discord.Activity(
                type=discord.ActivityType.watching,
                name="for new members | /sendverifypanel"
            )
        )

    async def on_command_error(self, ctx: commands.Context, error: commands.CommandError):
        logger.error(f"Command error: {error}")

    async def on_app_command_error(self, interaction: discord.Interaction, error: app_commands.AppCommandError):
        logger.error(f"App command error in {interaction.command}: {error}")
        if not interaction.response.is_done():
            await interaction.response.send_message("❌ An unexpected error occurred.", ephemeral=True)
        else:
            await interaction.followup.send("❌ An unexpected error occurred.", ephemeral=True)


import discord.app_commands as app_commands


async def main():
    bot = VengeanceBot()
    run_api(bot)
    logger.info("API server started in background thread.")
    async with bot:
        await bot.start(DISCORD_TOKEN)


if __name__ == "__main__":
    asyncio.run(main())