-
-
Notifications
You must be signed in to change notification settings - Fork 280
Installation
This page explains the non-Docker installation path. For containers, see Docker Setup.
Ticket-Bot v4 expects:
- Bun 1.0 or newer for the documented setup commands
- Node.js 20 or newer if you build first and run the compiled output
- Git
- A Discord bot token
- A Discord server where you can invite the bot
The project uses TypeScript, @discordjs/core, Drizzle, and a SQLite/libSQL database URL.
git clone https://github.com/Sayrix/Ticket-Bot.git
cd Ticket-Bot
bun installTicket-Bot reads environment variables from config/.env.
Create config/.env:
DISCORD_TOKEN=your_bot_token_here
DB_FILE_NAME=file:.data/ticket-bot.db
TICKETPM_PASSKEY=| Variable | Required | Purpose |
|---|---|---|
DISCORD_TOKEN |
Yes | Bot token from the Discord Developer Portal. |
DB_FILE_NAME |
Yes | SQLite/libSQL database URL used by Drizzle. |
TICKETPM_PASSKEY |
No | Passkey used for ticket.pm transcript uploads. |
For local SQLite, use a file URL such as:
DB_FILE_NAME=file:.data/ticket-bot.dbKeep .data/ backed up because it stores ticket records and tracked panel messages.
Copy the example:
cp config/config.example.ts config/config.tsPowerShell:
Copy-Item config/config.example.ts config/config.tsThen edit config/config.ts. At minimum, replace:
clientIdguildIdlogs.channelIdtickets.staffRoleIds- each
ticketTypes.*.categoryId - each
panels.*.channelId
See Configuration for every option.
Run:
bun run drizzle:pushThis applies the schema from src/db/schema.ts. The schema stores:
- Tracked panel messages.
- Application metadata.
- Ticket records, including creator, channel, status, claim, close reason, invited users, and transcript URL.
The bot deploys slash commands automatically on startup. Commands are deployed to the configured guildId, so they should appear quickly in that server.
bun run startIf you prefer Node.js, install dependencies with npm, build the TypeScript output, then run the compiled bot:
npm install
npm run drizzle:push
npm run build
npm run node:startUse Node.js 20 or newer. The node:start script runs dist/src/index.js, so run npm run build again after changing files under src/, config/, messages/, or i18n/.
Useful package scripts:
| Command | Purpose |
|---|---|
bun run start |
Start the bot. |
bun run node:start |
Start the compiled output after bun run build. |
npm run node:start |
Start the compiled output with Node.js after npm run build. |
bun run drizzle:push |
Apply database schema changes. |
bun run typecheck |
Run TypeScript checks. |
bun run lint |
Run Biome linting. |
bun run format |
Check formatting. |
bun run format:fix |
Rewrite formatting. |
bun run build |
Build the project. |
When the bot starts, it:
- Loads
config/.env. - Imports
config/config.ts. - Connects to Discord.
- Validates that the configured guild is accessible.
- Warns if the bot does not have Administrator.
- Validates configured panel channels.
- Deploys slash commands.
- Syncs panel messages.
- Applies configured presence.
- Starts telemetry according to the config.