Installation
This guide outlines the steps required to self-host the Light Services bot.
Installation
Prerequisites
- We recommend running the bot on Ubuntu 22.04, however the steps also apply for Windows, macOS and other Linux distros.
- Installed Node v18 or newer.
Steps
Use Node v18 (LTS) or newer. The bot does not support older versions.
Insert your Discord token into the token field inside the config.yml file. You can obtain a token by going to the Discord Developer Portal, creating a new app, opening the "Bot" tab and resetting and copying the token.
While you are there, you should also enable all 3 privileged intents that are listed below the token. These are required to run the bot.
Fill the dbUrl (database url) field in the config file. This bot requires an SQL database, either: MySQL, PostgreSQL or SQLite.
If you have a database, use the following syntax:
dbUrl: "protocol://user:password@host:port/database_name"
# protocol - either "mysql", "postgres" or other Sequelize-supported RDBMS
# user - your database's username
# password - the password for this user
# host - target server's IP or domain
# port - port on which the RDBMS is running on
# database_name - the database name to use
# THE DATABASE HAS TO BE CREATED MANUALLY BEFOREHAND!If you do not have a database or don't know what to put into here, use SQLite:
dbUrl: "sqlite://database.sqlite"Creating a MySQL, PostgreSQL or any other database is beyond the scope of this document. Please refer to other sources.
You do not have to create any tables. The only thing you need to create manually is the database.
Fill other values in the configuration file according to your preference.
Most settings are self-explanatory from the key name, but some have additional comments.
Run npm install to install the required dependencies.
(Option 1; normal) Run npm run dist to run the pre-built JS dist files.
(Option 2; if you modified the src folder) Run npm run clean && npm run build && npm run dist in the terminal to re-build and run. This command will:
- clean - Remove the
distfolder so any old version doesn't interfere. - build - Runs
tscwhich compiles TypeScript and creates thedistdirectory. - dist - Starts the freshly-built
dist/index.jsfile usingnode.
(Option 3; hot-reloading) If you're planning on developing the bot, use npm run dev to run the bot with nodemon. This will watch the files for changes and will auto-restart the bot when files are changed.
Invite the bot using the bot and application.commands scopes.
If you wish to use invoicing, you should configure PayPal: PayPal Configuration