Skip to content
/ Ticker-Boy Public template

Ticket system bot🎫 worked with /commands and text commands, had perfect dashboard and website for easy setup on guild.

License

Notifications You must be signed in to change notification settings

Persian-Caesar/Ticker-Boy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎫 Ticker Boy - Advanced Discord Ticket System Bot

npm node javascript

version license last-commit release-date

stars forks code-size files

GitHub Repo stars


πŸš€ What is Ticker Boy?

ticker-boy

Ticker Boy is a feature-rich, production-ready Discord bot designed specifically for advanced ticket management in Discord servers. Built with Discord.js v14, it provides a professional support system for communities, gaming servers, and businesses.

Core Purpose

  • Streamline Support: Users create tickets via interactive buttons/menus, staff claim/resolve them with transcripts.
  • Admin Dashboard: Configure everything via /settings (language, panels, roles, logs, claims).
  • Scalable: Supports thousands of servers with multi-DB options (JSON, MySQL, MongoDB).
  • Customizable: Multi-language (EN/Persian), themes, embeds, and permissions.

Version 1.3.9 Highlights:

  • Fixed Ticket Bugs: Improved stability in create/close/claim flows.
  • Enhanced Buttons: Better interaction handling, no more "interaction failed" errors.
  • Quality Improvements: Optimized DB queries, reduced memory usage, better error logging.
  • New Features: Claim system toggle, parent category support (open/close), menu options, mod logs.
  • Dashboard: Express-based web interface for stats/settings.
  • Transcripts: HTML exports for closed tickets (via discord-html-transcripts).
  • Multi-Language: EN-US & Persian with dynamic localization.
  • Webhook Logging: Auto-reports joins/leaves/errors to support server.
  • Anti-Crash: Full error handling with webhook alerts.

Perfect for support teams needing fast, organized ticket handling without manual channels.


✨ Key Features

Feature Description
Interactive Tickets Button/menu-based creation, claim, close, reopen, rename, add/remove users, delete.
Admin Dashboard /settings with select menus, modals, buttons for full customization.
Multi-DB Support JSON (default), SQLite, MySQL, MongoDB via QuickDB/QuickMongo.
Claim System Staff claim tickets; toggleable, with permissions.
Transcripts Auto-generate HTML transcripts on close/delete, DM to staff.
Logging Mod logs, webhook alerts (joins/leaves, errors, reports).
Parent Categories Auto-move tickets to open/close categories.
Multi-Language English & Persian; per-guild configurable.
Permissions Granular role-based access (admin roles, ManageChannels).
Cooldowns Per-command, per-user (configurable).
Status Updates Auto-updating bot stats embed in support server (servers, users, ping, uptime, CPU/memory).
Anti-Crash Catches unhandled errors, logs to webhook/console.
Dashboard Web UI (Express + EJS) for stats (localhost:3000).
Commands Slash + Prefix support; categories: Admin, Misc, Owner, Ticket.

πŸ“¦ Dependencies

Package Version Purpose
axios ^1.5.0 HTTP requests (e.g., chatbots).
cli-color ^2.0.2 Colored console logging.
cpu-stat ^2.0.1 CPU stats for status embeds.
discord-html-transcripts ^3.1.3 Ticket transcript generation.
discord.js ^14.13.0 Discord API client.
dotenv ^16.4.5 Environment variables.
ejs ^3.1.10 Dashboard templates.
express ^4.19.2 Web dashboard server.
moment ^2.29.4 Date/time formatting.
mongoose ^7.1.1 MongoDB ORM (if used).
quick.db ^9.1.7 File/SQLite DB wrapper.
quickmongo ^5.2.0 MongoDB driver for QuickDB.

Install with: npm install


πŸ“ Project Structure

Ticker Boy/
β”œβ”€β”€ config.js                  # Bot config (DB, Discord, support)
β”œβ”€β”€ index.js                   # Main entrypoint
β”œβ”€β”€ package.json               # Dependencies & scripts
β”œβ”€β”€ example.env                # Env template
β”œβ”€β”€ LICENSE                    # BSD-3-Clause
β”œβ”€β”€ start.bat                  # Auto-install & start
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ commands/              # All commands (Admin, Misc, Owner, Ticket)
β”‚   β”‚   β”œβ”€β”€ Admin/settings.js  # Main dashboard
β”‚   β”‚   β”œβ”€β”€ Misc/{help,invite,ping}.js
β”‚   β”‚   β”œβ”€β”€ Owner/{dbset,serverleave,serverlist}.js
β”‚   β”‚   └── Ticket/{add,claim,close,create,delete,open,rename,transcript}.js
β”‚   β”œβ”€β”€ dashboard/             # Express web UI
β”‚   β”‚   β”œβ”€β”€ index.js
β”‚   β”‚   β”œβ”€β”€ public/            # Static files (CSS, HTML)
β”‚   β”‚   └── views/             # EJS templates
β”‚   β”œβ”€β”€ events/                # Event handlers
β”‚   β”‚   β”œβ”€β”€ button/interactionCreate.js
β”‚   β”‚   β”œβ”€β”€ command/interactionCreate.js
β”‚   β”‚   β”œβ”€β”€ guild/{create,delete}.js
β”‚   β”‚   β”œβ”€β”€ menu/interactionCreate.js
β”‚   β”‚   β”œβ”€β”€ message/messageCreate.js
β”‚   β”‚   β”œβ”€β”€ modal/interactionCreate.js
β”‚   β”‚   β”œβ”€β”€ ready/ready.js
β”‚   β”‚   β”œβ”€β”€ status/ready.js
β”‚   β”‚   └── ticket/interactionCreate.js
β”‚   β”œβ”€β”€ functions/             # Utilities
β”‚   β”‚   β”œβ”€β”€ chooseRandom.js
β”‚   β”‚   β”œβ”€β”€ database.js
β”‚   β”‚   β”œβ”€β”€ error.js
β”‚   β”‚   β”œβ”€β”€ errorMessage.js
β”‚   β”‚   β”œβ”€β”€ functions.js       # Multi-purpose utils
β”‚   β”‚   β”œβ”€β”€ help.js
β”‚   β”‚   β”œβ”€β”€ loadCommand.js
β”‚   β”‚   β”œβ”€β”€ post.js
β”‚   β”‚   β”œβ”€β”€ ticket.js          # Ticket core
β”‚   β”‚   └── ... (20+ more)
β”‚   β”œβ”€β”€ handlers/              # Bootloaders
β”‚   β”‚   β”œβ”€β”€ 1-antivirus.js     # (Missing in your upload?)
β”‚   β”‚   β”œβ”€β”€ 2-database.js
β”‚   β”‚   β”œβ”€β”€ 3-events.js
β”‚   β”‚   β”œβ”€β”€ 4-dashboard.js
β”‚   β”‚   └── 5-commandHandler.js
β”‚   β”œβ”€β”€ locales/               # Translations
β”‚   β”‚   β”œβ”€β”€ en.json
β”‚   β”‚   └── per.json
β”‚   └── storage/               # Static data
β”‚       β”œβ”€β”€ colors.json
β”‚       β”œβ”€β”€ embed.json
β”‚       β”œβ”€β”€ emotes.json
β”‚       └── languages.json

πŸ”§ Important Functions

Function Input Output Description
chooseRandom(array) array: any[] any Returns random item from array.
createORgetInvite(guild) guild: Guild Invite | null Creates or fetches server invite.
DB.has(key) key: string boolean Checks if DB key exists.
DB.get(key, def?) key: string, def?: any any Gets value from DB (with default).
DB.set(key, val) key: string, val: any Promise<void> Sets DB value.
DB.push(key, val) key: string, val: any Promise<void> Appends to DB array.
DB.add(key, num) key: string, num: number Promise<number> Increments DB number.
deleteResponse({interaction, message}) Interaction/Message void Deletes reply/message safely.
editResponse({interaction, message, data}) Options obj Message Edits interaction/message.
error(err) err: Error void Logs error to console/webhook.
errorMessage(client, interaction, text) Client, Interaction, string void Sends styled error embed.
firstUpperCase(string) string: string string Title-cases string (e.g., "hello" β†’ "Hello").
logMessage(client, interaction, channel, desc, reason, emote, file?) Params obj void Sends formatted log embed (with optional file).
loadCommand(dirname, type, commands) Paths, Map void Loads commands from folders.
post(data, type, color1, color2) Params void Colored console logger.
response(interaction, data) Interaction, MessageOptions Message Sends/edits response.
selectLanguage(lang) lang: string Object Loads locale JSON.
sendGuildAlert({client, guild, ...}) Options obj Message Sends guild join/leave webhook.
ticket.create(client, interaction) Client, Interaction void Creates ticket channel.
ticket.close(client, interaction) Client, Interaction void Closes ticket, generates transcript.
ticket.claim(client, interaction) Client, Interaction void Claims ticket for staff.
checkPing(ms) ms: number string Ping status emoji/text (e.g., "🟒 Excellent").

πŸ›  Installation

Prerequisites

  • Node.js β‰₯16.9.0
  • Discord Bot Token (Developer Portal)
  • Optional: MySQL/MongoDB server

Steps

  1. Clone Repo:

    git clone https://github.com/Persian-Caesar/Ticker-Boy.git
    cd Ticker-Boy
  2. Install Dependencies:

    npm install
  3. Setup Environment (copy example.env β†’ .env):

    token=YOUR_BOT_TOKEN
    prefix=!
    database_type=json  # json/sql/mysql/mongodb
    # MongoDB:
    database_mongoURL=mongodb+srv://user:[email protected]/
    # MySQL:
    database_msql_host=localhost
    database_msql_user=root
    database_msql_password=pass
    database_msql_database=tickerboy
    # Support:
    support_id=1054814674979409940
    support_url=https://discord.gg/xh2S2h67UW
    webhook_url=YOUR_WEBHOOK_URL  # For logging
  4. Customize config.js (optional):

    • Dashboard port/host
    • Status activities
    • Owners/VIP roles
    • Invite links
  5. Run Bot:

    node index.js

    Or: start.bat (auto-install + run)

Invite Bot: Use links in config.js (no-perms, admin, default).


βš™οΈ Configuration

config.js Sections

  • source: Language, anti-crash, dashboard (port: 3000), DB type.
  • discord: Token, prefix, status, invites, support (webhook, roles, owners).
  • topgg: Vote page URL.

DB Types:

  • json: File-based (easiest).
  • sql: SQLite (local).
  • mysql: Remote MySQL.
  • mongodb: Cloud MongoDB.

πŸ“‹ Commands

Category Command Description Permissions
Admin πŸ‘¨β€πŸ’Ό /settings Interactive guild setup dashboard. ManageChannels, ManageGuild
Misc πŸ“Š /help [command] Bot info & command list. SendMessages
Misc πŸ“Š /invite Invite bot links. SendMessages
Misc πŸ“Š /ping Bot latency/ping. SendMessages
Owner πŸ‘‘ dbset <key> <value> Set DB value. Owner IDs
Owner πŸ‘‘ serverleave Leave small guilds (<50 members). Owner IDs
Owner πŸ‘‘ serverlist Paginated server list. Owner IDs
Ticket 🎫 /add @user Add user to ticket. ManageChannels
Ticket 🎫 /claim Claim ticket. ManageChannels
Ticket 🎫 /close Close ticket. SendMessages
Ticket 🎫 /create Create ticket. SendMessages
Ticket 🎫 /delete Delete ticket. ManageChannels
Ticket 🎫 /open Reopen ticket. ManageChannels
Ticket 🎫 /rename <name> Rename ticket. ManageChannels
Ticket 🎫 /transcript Generate HTML transcript. ManageChannels

Prefix: Configurable (default: empty for slash-only).


πŸ—„ Database Schema

Guild data: guild_${guildId}

{
  language: "en",
  prefix: "!",
  ticket_type: "Reason - Menu - UserTag",
  ticket_claim: true,
  admin_roles: ["roleId1"],
  modlog: "channelId",
  categories: { open: "catId", close: "catId" },
  panel: {
    channel: "channelId",
    menu_options: [{ label: "Support", value: "Support", emoji: "🎫" }]
  },
  tickets: [
    {
      channelId: "id",
      channelName: "ticket-user",
      user: "userId",
      newUser: "addedUserId",
      closed: false,
      claimed: "claimerId"
    }
  ]
}

Global: totalCommandsUsed: number


πŸ’» Dashboard

  • Enabled: config.source.dashboard.on = true
  • URL: http://localhost:3000 (configurable port/host)
  • Tech: Express + EJS templates
  • Features: Stats, commands, premium (WIP), invite
  • Views: /test, 404 handler
  • Static: CSS/JS in /public

🌐 Localization

  • Files: src/locales/{en,per}.json
  • Default: English
  • Per-Guild: /settings β†’ Language
  • Usage: client.languages[lang].commands.help.embed1.title

πŸ›‘οΈ Error Handling

  • Anti-Crash: process.on('unhandledRejection') β†’ Webhook + Console.
  • Commands: Permission/cooldown checks with styled errors.
  • Webhooks: Bugs/status/reports to support threads.

πŸƒβ€β™‚οΈ Scripts

Script Usage
npm start Run bot.
start.bat Auto npm install && npm start.
npm test Placeholder (no tests).

🀝 Contributing

  1. Fork repo
  2. Create branch: git checkout -b feature/ticket-fix
  3. Commit: git commit -m "Fix: ticket claim bug"
  4. Push: git push origin feature/ticket-fix
  5. Open PR

Guidelines:

  • ESLint + Prettier
  • JSDoc comments
  • Unit tests for functions
  • Mention Persian Caesar in credits

πŸ“ž Support


πŸ“„ License

BSD 3-Clause License

Copyright (c) 2021-2025, Sobhan-SRZA (mr.sinre) & Persian Caesar


πŸ‘₯ Credits

⭐ Star this repo if it helps!
Built with ❀️ for Discord communities

Languages