A simple discord bot of mine developed with Node.js's discord.js package.
You can invite the bot to your server using THIS link.
The bot requires administartor permissions (&permissions=8).
I'm hosting it, should be online 24/7.
Do the following for setting up the application from sratch:
- Clone the repository.
- Create a
.env
file, or rename the existing .env.example file, and fill it out with the required data. - Create a
config.json
file, or rename the existing config.json.example file, and fill it out with the required configuration settings. - Like you would with any other node.js app, install dependencies with with the
npm i
command.
Some of the bot's features require a MariaDB database.
If you already have a working database, and have filled up the connection details in the .env
file for the connection, you can just run npm run create-tables
. This will automatically create the tables based on the SQL queries that can be found in the sql folder.
Otherwise, please refer to THIS documentation for addittional help about setting up a database.
If everything above checks out, you can prepare for the first run:
- Deploy the slash (/) commands with
npm run deploy
. You might want to do this again if you modify / add commands. - Finally, run the bot with
npm run app
.
If you want to run the application on a Linux system in the background as a systemd service, you can follow THIS guide.