sniffyfr

๐Ÿ› ๏ธ Tester Commands /queue-open gm: โ€” Open the queue for a specified gamemode. /queue-close gm: โ€” Close the queue (prevents new players from joining). /available gm: โ€” Mark yourself as available so the bot can assign you tickets. /unavailable gm: โ€” Stop receiving ticket assignments. /result old: new: ign: โ€” Submit test results (triggers auto-role updates + skin preview)

๐Ÿ‘ค Player Interactions Players do not need slash commands; they interact entirely via buttons: โ€ข Select GM: Choose a gamemode from the main panel. โ€ข Join Queue: Open a testing ticket from the queue panel. โ€ข Leave Waitlist: Remove yourself from the active waitlist.

Make a tierlist bot which should contain these commands

๐Ÿ“Ž 1 file 1,070 chars
๐Ÿ“„
pasted-code-1783859182107.txt
txt 14 lines
โ–ถ
/create-gamemode name: โ€” Create a new gamemode (e.g., sword, lifesteal).
/remove-gamemode gm: โ€” Delete a specific gamemode and its configuration.
/set-queue-channel gm: ch: โ€” Set the channel where the queue panel for a gamemode is posted.
/set-ticket-category gm: cat: โ€” Define which category test tickets will be created in.
/set-tester-role gm: role: โ€” Select the tester role for a specific gamemode.
/set-access-role gm: role: โ€” Set the role required for players to join the queue.
/set-panel channel: โ€” Post the main gamemode selection panel.
/set-result-channel ch: โ€” Set the channel for posting test results with skin previews.
/set-role-log-channel ch: โ€” Set the audit log channel for tracking role changes.
/tierrole gm: tier: role: โ€” Map tier ranks (HT1, LT3, etc.) to specific Discord roles.
/quedelete channel: โ€” Post the waitlist removal button panel.
/panelavatar url: โ€” Add a small thumbnail to the panel embed.
/panelbanner url: โ€” Add a large banner image to the panel embed.
/embededit title: desc: โ€” Customize the text content of the panel.
Kodari AI
KodariJul 12 at 12:29 pm 9
TierlistBot
TierlistBot manages Minecraft testing queues and tier assignments inside Discord. It provides gamemode-specific queue panels, access and tester role controls, ticket creation, tester availability tracking, waitlist removal buttons, configurable ticket categories, and administrative setup commands. Testers submit results directly from ticket channels, automatically updating mapped tier roles and publishing result embeds with Minecraft skin previews. Persistent SQLite storage keeps all settings, queues, roles, and ticket data across restarts.
sniffyfr

Ill give 2 old config which has roles ids setuped will you analyse it and set the code as the old config so it would be ready to use

Kodari AI
KodariJul 12 at 12:33 pm 2

Yes. Upload the two old configuration files, and Iโ€™ll:

  • Analyze their structure and existing role/channel/category IDs.

  • Map each gamemode, tier role, tester role, access role, and configured channel.

  • Adapt the bot to use those IDs and preserve the old setup.

  • Keep IDs in configuration rather than hardcoding them where possible.

  • Verify missing or conflicting settings.

  • Prepare it for use with only the required Discord token and server-specific values.

Remove or replace any bot token before uploading.

Kodari can make mistakes. Review important code before using.
Files
.gitignore
bot.py
requirements.txt
Code
3 1,514
bot.py
import logging
import os
import re
import sqlite3
from datetime import datetime, timezone
from typing import Optional

import discord
from discord import app_commands
from discord.ext import commands
from dotenv import load_dotenv


load_dotenv()

logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s %(levelname)s %(name)s: %(message)s",
)
logger = logging.getLogger("tierlistbot")


DEFAULT_PANEL_TITLE = "Minecraft Tierlist Testing"
DEFAULT_PANEL_DESCRIPTION = (
    "Select a gamemode below to view its queue and join a testing ticket."
)
GAMEMODE_PATTERN = re.compile(r"^[a-z0-9][a-z0-9_-]{0,23}$")

LEGACY_TESTING_CATEGORY = 1512763658298593480
LEGACY_RESULT_CHANNEL = 1512763925291339776
LEGACY_LOG_CHANNEL = 1522595917000343563
LEGACY_TESTER_ROLE = 1512762839561928765
LEGACY_PRIORITY_ROLE = 1512762832763224214
LEGACY_GAMEMODES = ["Sword", "NethOP", "Mace", "Axe", "UHC", "Pot", "Vanilla", "SMP"]
LEGACY_QUEUE_CHANNELS = {
    "AS": {
        "Sword": 1512763988541177886,
        "NethOP": 1512763984875622494,
        "Mace": 1512764007294177360,
        "Axe": 1512763995596128377,
        "UHC": 1512763977485123645,
        "Pot": 1512763981301940255,
        "Vanilla": 1512763973961908297,
        "SMP": 1512763992089821414,
    },
    "EU": {
        "Sword": 1522619270209736784,
        "NethOP": 1522619229600219277,
        "Mace": 1522619351616979105,
        "Axe": 1522619323905081444,
        "UHC": 1522619032954605660,
        "Pot": 1522619184276570112,
        "Vanilla": 1522618995499470868,
        "SMP": 1522619300190490648,
    },
}
LEGACY_TIER_ROLES = {
    "Sword": {
        "HT1": 1512762907484491986, "LT1": 1512762929743659008, "HT2": 1512762948387602553, "LT2": 1512762967974740040,
        "HT3": 1512762996651331725, "LT3": 1512763017018740806, "HT4": 1512763037109456956, "LT4": 1512763057238180011,
        "HT5": 1512763080759705731, "LT5": 1512763100233994260,
    },
    "NethOP": {
        "HT1": 1512762897736929390, "LT1": 1512762923968368914, "HT2": 1512762944574722168, "LT2": 1512762963948339260,
        "HT3": 1512762993170055239, "LT3": 1512763013143330996, "HT4": 1512763033464737873, "LT4": 1512763055392690299,
        "HT5": 1512763075260973218, "LT5": 1512763096832413746,
    },
    "Mace": {
        "HT1": 1512762911095787650, "LT1": 1512762933262684301, "HT2": 1512762952460140675, "LT2": 1512762971531645028,
        "HT3": 1512763000208101408, "LT3": 1512763020965576775, "HT4": 1512763040859422812, "LT4": 1512763060941619371,
        "HT5": 1512763084429852757, "LT5": 1512763108077342780,
    },
    "Axe": {
        "HT1": 1512762908998635642, "LT1": 1512762931400540240, "HT2": 1512762950509662288, "LT2": 1512762969677893803,
        "HT3": 1512762998333378680, "LT3": 1512763018981933127, "HT4": 1512763038963597393, "LT4": 1512763058907250688,
        "HT5": 1512763082655400168, "LT5": 1512763105610829944,
    },
    "UHC": {
        "HT1": 1512762901515997275, "LT1": 1512762919471943792, "HT2": 1512762940577550509, "LT2": 1512762960425123921,
        "HT3": 1512762989432934522, "LT3": 1512763009032913036, "HT4": 1512763029605847050, "LT4": 1512763049667465276,
        "HT5": 1512763071414931589, "LT5": 1512763092730253393,
    },
    "Pot": {
        "HT1": 1512762903835578439, "LT1": 1512762922080800858, "HT2": 1512762942804857013, "LT2": 1512762962023153746,
        "HT3": 1512762991181955142, "LT3": 1512763010907766858, "HT4": 1512763031795535983, "LT4": 1512763051424874587,
        "HT5": 1512763073562153060, "LT5": 1512763095037247569,
    },
    "Vanilla": {
        "HT1": 1512762899599458556, "LT1": 1512762916795846857, "HT2": 1512762938740445194, "LT2": 1512762958550405291,
        "HT3": 1512762987231055872, "LT3": 1512763007006933153, "HT4": 1512763027672531075, "LT4": 1512763047633096894,
        "HT5": 1512763069816635442, "LT5": 1512763090641616907,
    },
    "SMP": {
        "HT1": 1512762905454706709, "LT1": 1512762927730524170, "HT2": 1512762946571341855, "LT2": 1512762965441515612,
        "HT3": 1512762994906501270, "LT3": 1512763014506610759, "HT4": 1512763035352043530, "LT4": 1512763053622431805,
        "HT5": 1512763078952095835, "LT5": 1512763098510135467,
    },
}


class Database:
    def __init__(self, path: str):
        self.connection = sqlite3.connect(path)
        self.connection.row_factory = sqlite3.Row

    def initialize(self) -> None:
        self.connection.executescript(
            """
            CREATE TABLE IF NOT EXISTS settings (
                key TEXT PRIMARY KEY,
                value TEXT NOT NULL
            );

            CREATE TABLE IF NOT EXISTS gamemodes (
                id INTEGER PRIMARY KEY AUTOINCREMENT,
                name TEXT NOT NULL UNIQUE,
                queue_open INTEGER NOT NULL DEFAULT 0,
                queue_channel_id INTEGER,
                ticket_category_id INTEGER,
                tester_role_id INTEGER,
                access_role_id INTEGER
            );

            CREATE TABLE IF NOT EXISTS tier_roles (
                gamemode_id INTEGER NOT NULL,
                tier TEXT NOT NULL,
                role_id INTEGER NOT NULL,
                PRIMARY KEY (gamemode_id, tier),
                FOREIGN KEY (gamemode_id) REFERENCES gamemodes(id)
            );

            CREATE TABLE IF NOT EXISTS waitlist (
                gamemode_id INTEGER NOT NULL,
                user_id INTEGER NOT NULL,
                joined_at TEXT NOT NULL,
                PRIMARY KEY (gamemode_id, user_id),
                FOREIGN KEY (gamemode_id) REFERENCES gamemodes(id)
            );

            CREATE TABLE IF NOT EXISTS availability (
                gamemode_id INTEGER NOT NULL,
                user_id INTEGER NOT NULL,
                PRIMARY KEY (gamemode_id, user_id),
                FOREIGN KEY (gamemode_id) REFERENCES gamemodes(id)
            );

            CREATE TABLE IF NOT EXISTS tickets (
                channel_id INTEGER PRIMARY KEY,
                gamemode_id INTEGER NOT NULL,
                user_id INTEGER NOT NULL,
                assigned_tester_id INTEGER,
                created_at TEXT NOT NULL,
                FOREIGN KEY (gamemode_id) REFERENCES gamemodes(id)
            );
            """
        )
        self.connection.commit()

    def close(self) -> None:
        self.connection.close()

    def seed_legacy_configuration(self) -> None:
        for gamemode_name in LEGACY_GAMEMODES:
            normalized_name = gamemode_name.lower()
            gamemode = self.get_gamemode(normalized_name)
            if not gamemode:
                self.create_gamemode(normalized_name)
                gamemode = self.get_gamemode(normalized_name)

            self.set_gamemode_field(
                normalized_name,
                "queue_channel_id",
                LEGACY_QUEUE_CHANNELS["AS"][gamemode_name],
            )
            self.set_gamemode_field(
                normalized_name,
                "ticket_category_id",
                LEGACY_TESTING_CATEGORY,
            )
            self.set_gamemode_field(
                normalized_name,
                "tester_role_id",
                LEGACY_TESTER_ROLE,
            )
            self.set_gamemode_field(
                normalized_name,
                "access_role_id",
                LEGACY_PRIORITY_ROLE,
            )

            for tier, role_id in LEGACY_TIER_ROLES[gamemode_name].items():
                self.set_tier_role(gamemode["id"], tier, role_id)

        self.set_setting("result_channel_id", str(LEGACY_RESULT_CHANNEL))
        self.set_setting("role_log_channel_id", str(LEGACY_LOG_CHANNEL))

    def get_setting(self, key: str, default: Optional[str] = None) -> Optional[str]:
        row = self.connection.execute(
            "SELECT value FROM settings WHERE key = ?",
            (key,),