Skip to content

007codename/discord-ticket-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✨ TicketPilot Bot

A lightweight, modular Discord ticket bot with slash commands, position management, and rich interaction handling.


🌟 Features

Feature What you get
🎫 Ticket System Create, manage, and close support tickets with slash commands.
👥 Position Management Add and remove hiring positions dynamically.
🧾 User Tracking Track ticket owners and position applicants in local storage.
⚡ Slash Commands Modern /ticket, /close, /positions command suite.
🗂️ Modular Managers Dedicated managers for tickets, positions, and users.
💾 JSON Storage Lightweight local file storage auto-created at runtime.

🧭 Project Structure

.
├── src/                    # Source code
│   ├── commands/           # Slash commands
│   │   ├── ticket.js       # Create support tickets
│   │   ├── close.js        # Close active tickets
│   │   ├── add.js          # Add hiring positions
│   │   ├── remove.js       # Remove hiring positions
│   │   ├── positions.js    # View available positions
│   │   └── ping.js         # Bot health check
│   ├── events/             # Discord event handlers
│   │   ├── interactionCreate.js # Handle slash commands & interactions
│   │   └── ready.js        # Startup sync
│   ├── managers/
│   │   ├── TicketManager.js     # Ticket lifecycle management
│   │   ├── PositionsManager.js  # Position CRUD operations
│   │   └── TicketUsersManager.js# User/applicant tracking
│   ├── config/
│   │   ├── config.json         # Bot configuration
│   │   └── config.json.example # Bot configuration template
│   └── index.js            # Bot entry point
├── data/                   # Auto-created JSON storage
│   ├── positions.json      # Hiring positions data
│   └── ticket-users.json   # User & applicant tracking
├── .env.example            # Environment variable template
├── package.json            # Dependencies & metadata
├── LICENSE                 # MIT License
└── README.md

🚀 Quick Start

Estimated setup time: 5–10 minutes

1) Install dependencies

npm install

2) Configure environment

Rename .env.example to .env and fill in:

TOKEN=your_bot_token_here
CLIENT_ID=your_client_id_here
GUILD_ID=your_guild_id_here

3) Configure bot settings

Rename src/config.json.example to src/config.json and set your server-specific settings:

{
  "ticketChannelId": "your_ticket_channel_id",
  "supportRoleId": "your_support_role_id",
  "logChannelId": "your_log_channel_id"
}

4) Run the bot

node src/index.js

🤖 Commands

Requires Manage Server permissions unless otherwise noted.

Command Purpose Permissions
/ticket Create a new support ticket. Everyone
/close Close an active ticket. Ticket owner or staff
/positions add Add a new hiring position. Manage Server
/positions remove Remove a hiring position. Manage Server
/positions View all available positions. Everyone
/ping Check bot responsiveness. Everyone

⚙️ Configuration & Permissions

Intents

Enable these in the Discord Developer Portal:

  • Server Members Intent
  • Message Content Intent

Recommended Bot Permissions

  • View Channels
  • Send Messages
  • Embed Links
  • Read Message History
  • Manage Channels (for ticket creation)

📦 Data Storage

The bot stores lightweight JSON files at runtime in the data/ folder. Directories are created automatically:

  • data/positions.json — hiring positions & metadata
  • data/ticket-users.json — user tracking & applicants

For multi-server persistence or production use, consider migrating to a real database.


🛠️ Development Notes

Area Details
Slash Commands Registered globally on startup.
Ticket Management Uses snowflake IDs for reliable tracking.
Position Data Stored as JSON objects with timestamps.

📄 License

MIT


👤 Author

Discord: @007codename

About

Simple Discord ticket system bot (TicketPilot)

Topics

Resources

License

Stars

Watchers

Forks

Contributors