Skip to main content

Installation

๐Ÿš€ Installationโ€‹

Requirementsโ€‹

1. Install dependenciesโ€‹

cd discord_ticketbot
npm install

2. Set up environment variablesโ€‹

cp .env.example .env

Fill in .env:

# Required
TOKEN="your_bot_token"
CLIENT_ID="your_application_id"
GUILD_ID="your_server_id"

# Optional โ€” MSK Transcript Service (get your key at www.msk-scripts.de/verify)
MSK_API_KEY="your_msk_api_key"
MSK_API_URL="https://www.msk-scripts.de"

3. Set up the configurationโ€‹

cp config/config.example.jsonc config/config.jsonc

Edit config/config.jsonc as needed โ€” all fields are commented.

4. (Optional) Set up canned responsesโ€‹

cp config/snippets.example.jsonc config/snippets.jsonc

Edit config/snippets.jsonc to define your team's canned responses. If the file does not exist, /snippet commands will show a setup hint.

5. Start the botโ€‹

npm start

On first start the bot will automatically:

  • Create the SQLite database at data/tickets.db
  • Register all slash commands on your server

5. Set up the panelโ€‹

Run /setup on your Discord server (Administrator permission required). The bot will send the ticket panel to the channel configured in openTicketChannelId.


๐Ÿ–ฅ๏ธ Autostart with systemd (Linux Server)โ€‹

The included ticketbot.service file lets the bot start automatically after a server reboot.

1. Copy the bot files to the serverโ€‹

sudo cp -r discord_ticketbot /opt/discord_ticketbot
sudo useradd -r -s /bin/false discord
sudo chown -R discord:discord /opt/discord_ticketbot

2. Set up .env on the serverโ€‹

sudo nano /opt/discord_ticketbot/.env

3. Verify the Node.js pathโ€‹

which node
# e.g.: /usr/bin/node

If the path differs, adjust ExecStart in ticketbot.service accordingly.

4. Install the systemd unitโ€‹

sudo cp /opt/discord_ticketbot/ticketbot.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now ticketbot.service

5. Check the statusโ€‹

sudo systemctl status ticketbot.service
sudo journalctl -u ticketbot.service -f

Useful commandsโ€‹

CommandDescription
sudo systemctl start ticketbot.serviceStart the bot
sudo systemctl stop ticketbot.serviceStop the bot
sudo systemctl restart ticketbot.serviceRestart the bot
sudo systemctl enable ticketbot.serviceEnable autostart
sudo systemctl disable ticketbot.serviceDisable autostart
sudo journalctl -u ticketbot.service -fFollow live logs with colors