TicketBot is a fully slash-command Discord.js v14 ticket bot for structured support workflows on Discord. It uses MongoDB through Mongoose, keeps the codebase simple, and focuses on a clean, customizable, open-source friendly ticket system.
- Slash commands only
- Discord.js v14 architecture
- MongoDB storage through Mongoose
- Modal-based ticket creation
- Private ticket channels with role-based visibility
- Staff-only log channels under the ticket category
- Transcript generation on demand and on close
- DM-based rating flow with written feedback for low ratings
- Guild-based solved ticket statistics in
/stats - GitHub button inside
/stats - Editable ticket panel content and panel color
- Manual setup and automatic setup support
- Full reset command for guild ticket data
-
/helpShows the help menu and command groups. -
/pingShows gateway latency and round-trip time. -
/statsShows server-specific ticket stats, runtime details, CPU, RAM, latency, version information, and a GitHub link button.
These commands are visible to members with the Manage Messages permission.
-
/setup-ticketCreates or refreshes the ticket system. -
/settingsShows the current ticket configuration or updates the existing setup. -
/resetFully removes the configured ticket system for the current guild and resets the ticket counter.
This is the main ticket panel users interact with before opening a request. It shows the panel embed, the opening button, and the clean entry point of the ticket workflow.
The modal collects a clear ticket title and a required description before the channel is created. It helps the workflow feel structured from the first user interaction.
This view shows the live support channel after a ticket is created. Keeping the transcript and close actions visible makes the workflow immediately understandable.
This view shows the private staff log with closure details and the transcript attachment in one place. It highlights that the system is built for moderation workflows, not only for opening tickets.
This capture shows the post-ticket DM rating flow with star-based feedback options. It gives the project a polished end-to-end feel by showing how support quality is measured after closure.
TicketBot supports both manual setup and automatic setup.
Manual setup:
- Use
/setup-ticketwith your preferred staff role, log channel, panel channel, and panel text values. - If the selected log channel is outside the ticket category, the bot moves it under the category automatically.
- The log channel is permission-synced so only the configured staff role and the bot can see it.
Automatic setup:
- Run
/setup-ticketwithout optional values. - The bot creates the staff role, ticket category, and log channel when they do not already exist.
- The panel message is sent in the current text channel unless
panel-channelis provided.
- A member presses the ticket panel button.
- A modal opens.
- The member must enter:
- a title with at least 5 characters
- a description with at least 20 characters
- The bot creates a private ticket channel under the configured ticket category.
- Only these targets can see the channel:
- the ticket opener
- the configured staff role
- the bot
- The ticket message includes:
Conversation TranscriptClose Ticket
The Conversation Transcript button generates a plain text transcript for the current ticket and returns it as an ephemeral file.
When a ticket closes, a transcript is also generated automatically and uploaded to the log channel.
Transcript output includes:
- date
- time
- day name
- ticket number
- username
- message content
- attachment URLs when present
- embed summaries when present
Example line format:
[26.03.2026 18:25:10 Thursday] [Ticket 0001] [username]: message content
When a ticket is closed:
- the ticket is marked as closed in MongoDB
- a close log embed is sent to the log channel
- the transcript file is uploaded to the log channel
- the ticket opener receives a DM rating menu
- the ticket channel is deleted after 10 seconds by default
Rating meanings:
⭐- Very poor⭐⭐- Poor⭐⭐⭐- Average⭐⭐⭐⭐- Excellent⭐⭐⭐⭐⭐- Flawless
Rating behavior:
- 1 or 2 stars open a required feedback modal
- 3, 4, or 5 stars are saved immediately
- ratings are stored in MongoDB
- rating logs are forwarded to the ticket log channel
Edit config.json before starting the bot.
{
"token": "YOUR_BOT_TOKEN",
"clientId": "YOUR_CLIENT_ID",
"developerId": "YOUR_DEVELOPER_ID",
"mongoUri": "YOUR_MONGODB_URI",
"embedColors": {
"primary": "#5865F2",
"success": "#16A34A",
"error": "#DC2626",
"warning": "#D97706"
},
"ticket": {
"panelColor": "#1F2937",
"panelTitle": "Support Tickets",
"panelDescription": "Use the button below to open a private ticket. A short form will ask for a title and description before the channel is created.",
"panelFooter": "Tickets are visible only to the requester and the configured staff role.",
"buttonLabel": "Open Ticket",
"closeButtonLabel": "Close Ticket",
"staffRoleName": "Ticket Staff",
"categoryName": "Tickets",
"logChannelName": "ticket-logs",
"deleteDelaySeconds": 10
}
}Notes:
embedColors.primaryis the stable bot embed color.ticket.panelColoronly affects the ticket panel embed.deleteDelaySecondscontrols how long the ticket channel stays open after closure.
- Install dependencies:
npm install-
Fill
config.jsonwith your real values. -
Start the bot:
npm startOptional local starter:
start.batOptional validation:
npm run checkThe bot should have at least these permissions:
- View Channels
- Send Messages
- Read Message History
- Embed Links
- Attach Files
- Manage Channels
- Manage Roles
The bot role must be placed above the roles it needs to manage. If the bot role is not high enough, ticket setup and ticket creation are intentionally blocked.
Startup logs are intentionally plain. Examples:
[Database] Connected: MongoDB[Event] Loaded: ready.js[Command] Loaded: setup-ticket.js[Button] Loaded: transcriptTicket.js
Application commands are registered globally when the bot becomes ready. Discord may take a short time to refresh global slash commands after a restart.
app.js
config.json
start.bat
assets/
screenshots/
src/
commands/
general/
system/
components/
buttons/
modals/
selects/
database/
mongoose.js
events/
client/
handlers/
utils/
This project is released under the MIT License.




