Skip to content
This repository was archived by the owner on Aug 10, 2026. It is now read-only.

Repository files navigation

Warning

This repository is no longer maintained.

Active development has moved to Schrodinger: https://github.com/TheCodeVerseHub/Schrodinger

This repository is kept for archival purposes only and will not receive future updates.

# CodeVerse Bot

Enterprise-grade Discord bot for programming communities with comprehensive management tools

StatusLicensePython

Professional Staff Management • Advanced Moderation • Support Ticket System • Data Persistence • Programming Utilities • Community Engagement

Features Overview

  • Moderation suite — purge, kick, ban, softban, timeout (?mute works as a prefix alias), slowmode, locks/lockdowns, tempban, and more, with permit-based delegation for staff.
  • Warning system — issue, revoke, and review warnings (/warn, /warnings view|modify|clear).
  • Support tickets — persistent, thread-based ticket system with category routing, transcripts, and logging.
  • Permit system — create named permission groups (roles), assign them to members, and let staff act without native Discord permissions. Full lifecycle: new, add, list, check, delete, rename, check-all.
  • Reaction roles — automatic role assignment through emoji reactions.
  • Sticky messages — keep important announcements pinned in channels.
  • Appeals — ban/mute appeals with DM workflow and staff review.
  • Centralized logging — webhook-based event logging with per-guild channel configuration.
  • Thread management — close/archive, pin, and unpin threads.
  • Embed builder & server tooling — interactive embed creator plus ?ls channel/role/permission auditing tools.
  • Rules & community — quick rule-reference commands (?r1?r12, ?tldr).
  • Protection — protected-channel auto-timeout, authorized-server enforcement, and more.

Prefix:? (per-guild override via /prefix) • Slash:/

Recent Changes

  • Permit management commands — added /permit delete, /permit rename, and /permit check-all (paginated view of every user with permits).
  • Environment-based configuration — all Discord channel/category/user/role/guild IDs moved out of the code into a single .env file (fallback defaults live in config.py).

Quick Start

Prerequisites

  • Python 3.12+
  • Discord bot token
  • Server/Guild ID

Installation

  1. Clone the repository

    git clone https://github.com/youngcoder45/codeverse-bot.git
    cd codeverse-bot
  2. Set up environment

    python -m venv .venv
    # Windows PowerShell
    .\.venv\Scripts\Activate.ps1
    # Linux/Macsource .venv/bin/activate
  3. Install dependencies

    pip install -r requirements.txt
  4. Configure environment variables Copy .env.example to .env and fill in the values:

    # RequiredDISCORD_TOKEN=your_bot_token_hereGUILD_ID=your_server_id_here# Authorized guilds (comma-separated) — the bot only operates hereAUTHORIZED_GUILD_IDS=your_server_id_here

    Every Discord ID the bot uses (channels, roles, users, guilds) is configured through .env. See Configuration and .env.example for the full list.

  5. Run the bot

    python main.py

Windows One-Liner

python -m venv .venv; .\.venv\Scripts\Activate.ps1; pip install -r requirements.txt; python main.py

Command Reference

A full, maintained reference lives in docs/COMMAND_REFERENCE.md. Quick overview by category:

Core

CommandDescription
/help?helpInteractive categorized help menu
/pingBot latency check
/info?infoDetailed user information (alias userinfo)
/get-user-idGet a Discord ID from a mention
/prefixView or change the per-guild prefix
/reportReport a message to moderators
/diag?diagBot diagnostics (prefix only)

Moderation

CommandDescription
/purge/cleanDelete messages / clean bot messages
/kick/ban/unban/softbanMember removal
/timeout (alias ?mute) • /untimeout (alias ?unmute) • /tempbanTemporary actions
/slowmode/lock/unlock/lockdown/unlockdownChannel control
/nuke/massbanOwner-only destructive tools
/role/addmod/nicknameRole & nickname management
/verifyVerification panel with role selection
/serverinfo/roleinfo/avatarInformation commands
?hide?unhideChannel visibility (prefix only)

Warnings

CommandDescription
/warnIssue a warning
/unwarnRemove a warning by ID
/warnings viewView a user's warning history
/warnings modifyRevoke a warning by case ID
/warnings clearClear all warnings for a user

Permits

CommandDescription
/permit newCreate a permit role and pick permissions
/permit addAssign a permit role to a member
/permit listList all permit roles
/permit checkCheck a member's permits
/permit deleteDelete a permit role (with confirmation)
/permit renameRename a permit role
/permit check-allShow every user with permits (paginated)

Tickets

CommandDescription
/ticket panelCreate a persistent ticket panel
/ticket list/ticket statsView tickets / statistics
/ticket forcecloseForce-close a ticket
/ticket log/ticket support/ticket report/ticket partner/ticket categoryConfigure roles/channels/categories

Reaction Roles & Sticky Messages

CommandDescription
/rrCreate a reaction-role message
/rrlist/rrremoveList / remove reaction-role setups
/stickymessageSet a sticky message in a channel
/removesticky/liststickyRemove / list sticky messages

Threads, Appeals & Logging

CommandDescription
?close?pin?unpinThread management (prefix only)
/appeals/appealinfo/appealcancelAppeal workflow
/setlogchannelsConfigure per-guild log channels

Utility & Rules

CommandDescription
/embed/editembedInteractive embed creator/editor
?ls role/perms/perm/noperms/members/channels/categories/bots/boostersServer auditing tools (prefix only)
?r1?r12?r34?tldrQuick rule reference (prefix only)

Project Structure

codeverse-bot/
├── main.py # Production entrypoint
├── config.py # Central configuration (reads .env)
├── .env.example # Environment variable template
├── src/
│ ├── bot.py # Bot initialization & cog loading
│ ├── commands/
│ │ ├── core.py # Core commands (ping, info, help, report, prefix)
│ │ ├── diagnostics.py # ?diag
│ │ ├── modcog.py # Main moderation commands
│ │ ├── advanced_moderation.py # tempban, hide/unhide
│ │ ├── appeals.py # Appeal workflow
│ │ ├── tickets.py # Ticket system
│ │ ├── permits.py # Permit permission groups
│ │ ├── reaction_roles.py # Reaction-role assignment
│ │ ├── sticky_message.py # Sticky messages
│ │ ├── spam_catch.py # Protected-channel auto-timeout
│ │ ├── thread.py # Thread close/pin/unpin
│ │ ├── help_thread_notification.py # ?needhelp (staff)
│ │ ├── rules.py # ?r1…?r12, ?tldr
│ │ ├── utility.py # /embed, /editembed, ?ls tools
│ │ ├── help_menu.py # Dynamic /help menu
│ │ ├── logging/ # Webhook-based logging system
│ │ └── modules/sam/ # Warning system (SAM module)
│ ├── events/
│ │ ├── member_events.py # Welcome DMs on join
│ │ └── message_handler.py # Intro reactions + error handling
│ ├── utils/ # Database, embeds, helpers, webhooks, keep-alive
│ └── data/ # JSON data (quotes, questions, challenges)
├── data/ # SQLite database files
├── requirements.txt # Python dependencies
└── runtime.txt # Python version for hosting

Configuration

The bot reads all configuration from .env via config.py. Copy .env.example.env.

Required

  • DISCORD_TOKEN — your bot token
  • GUILD_ID — your main server ID
  • AUTHORIZED_GUILD_IDS — comma-separated guilds the bot is allowed to operate in

Discord IDs (all optional — code falls back to defaults)

Guilds:AUTHORIZED_GUILD_IDS, MAIN_GUILD_ID

Roles:MODERATION_ROLE_ID, STAFF_ROLE_ID, ADMIN_BYPASS_ROLE_ID, HELP_MODERATOR_ROLE_ID, VERIFY_STREAM_ROLE_ID, VERIFY_VOICE_ROLE_ID, VERIFY_EMBED_ROLE_ID, VERIFY_JOIN_VC_ROLE_ID

Users:BOT_OWNER_ID, APPEALS_MODERATOR_USER_ID

Channels:INTRODUCTION_CHANNEL_ID, WELCOME_ROLES_CHANNEL_ID, WELCOME_GENERAL_CHANNEL_ID, WELCOME_IDEAS_CHANNEL_ID, HELP_FORUM_ID, WELCOME_TICKET_CHANNEL_ID, HELP_NOTIFY_TARGET_CHANNEL_ID, HELP_GUIDE_CHANNEL_ID, REPORT_CHANNEL_ID, PROTECTED_CHANNEL_ID, TICKET_LOGS_CHANNEL_ID

Logging channels:LOG_CHANNEL_MEMBERS_ID, LOG_CHANNEL_ROLES_ID, LOG_CHANNEL_CHANNELS_ID, LOG_CHANNEL_TIMEOUTS_ID, LOG_CHANNEL_VOICE_ID, LOG_CHANNEL_WARNINGS_ID, LOG_CHANNEL_MEMBER_ROLE_CHANGES_ID, LOG_CHANNEL_MODERATION_ID, LOG_CHANNEL_TICKETS_ID, LOG_CHANNEL_STAFF_POINTS_ID

Other:APPEALS_LOG_CHANNEL_IDS, DATABASE_NAME, LOG_CHANNEL_NAME, STATUS_MESSAGE, PORT, HOSTING_PLATFORM, INSTANCE_ID, BOT_LOCK_FILE, ALLOW_MULTIPLE_INSTANCES

Required Bot Permissions

  • View Channels, Send Messages, Embed Links, Add Reactions, Use Slash Commands, Read Message History
  • Moderation: Manage Messages, Kick Members, Ban Members, Moderate Members, Manage Channels, Manage Nicknames, Manage Roles
  • Advanced: Create Public Threads, Manage Threads, Manage Webhooks (for webhook logging)

Development

Adding New Commands

  1. Create or edit a cog file in src/commands/
  2. Add a command with the appropriate decorator:
    @commands.hybrid_command(name="mycommand", help="Description")asyncdefmy_command(self, ctx):
    awaitctx.send("Hello!")
  3. Add the cog to COGS_TO_LOAD in src/bot.py

Testing Changes

python -m py_compile src/commands/your_cog.py

Deployment

Railway / Heroku

  1. Connect your GitHub repository
  2. Set environment variables in the platform dashboard (token, guild IDs)
  3. Deploy automatically on push

VPS / Self-Hosted

  1. Clone the repository on the server
  2. Create .env with your configuration
  3. Run with a process manager (systemd / PM2)

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes
  4. Push to the branch and open a Pull Request

License

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

Support

About

A Python Discord bot implemented with discord.py that includes moderation tools (kick/ban/mute), utility commands, and small fun features. Made for @TheCodeVerseHub 2100+ members

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages