A Discord economy bot with minigames and more.
Self-hosted via Docker and configurable via JSON files within the src/config folder.
- Clone this repository.
git clone https://github.com/zsd7200/ratbase.git- Make a copy of
docker-compose.yml.exampleand rename it to simplydocker-compose.yml. - Set environment variables.
TOKEN: Discord bot token, available after creating a bot in the Discord Developer Portal.- Should look something like:
NUSfjbnj453bTYF6b3b899NN.st7AS5.v8b3u3NOTAREALKEY838438bnsa
- Should look something like:
SRV: MongoDB connection URL.- Should look something like:
mongodb+srv://[username]:[password]@[project].[server].mongodb.net/
- Should look something like:
- Never share these environment variables, otherwise your bot or its data may be compromised.
- In the
src/configfolder, make copies of all files with.examplesuffixes without the.examplesuffix and adjust as needed.- Example:
basic.json.exampleshould be copied and renamed tobasic.json. - Files in the
src/configfolder should include:basic.json: Used for changing prefix, currency label, bot name (when referenced within commands). Change this file to change branding from Ratbase to whatever you prefer.commands.json: Used for enabling/disabling commands and changing command aliases, cooldowns, descriptions, and modifying adjustable variables.extras.json: Used for enabling/disabling extra features, such as shiny messages (messages that get a reaction added to them by the bot, which gives Ratbase rewards).
extras.jsonis the only file that needs to be opened and edited after creating a copy. Any option with a|character is showing the multiple options available--only one of these options should be chosen.- Example:
extras.shiny.rates[x].amountTypeis eitherfixedorpercent--the bot will not run if the example file provided remains unmodified.fixedwill give a static amount of $RAT.percentwill give a percentage of the top of the leaderboard's balance. It is similar to the$$taxcommand, but nothing is removed from the top user. Should be entered as a decimal, not an integer.
- Note: All
rateobjects inextras.jsonare represented as1/x. - Note: All commands in the
allowanddenyarrays must be enabled incommands.jsonas well.
- Example:
- Example:
- Create and run the container from within this repository's folder:
docker compose up -d- Create a
.envwith the following entries:
TOKEN=
SRV=
- Set environment variables.
TOKEN: Discord bot token, available after creating a bot in the Discord Developer Portal.- Should look something like:
NUSfjbnj453bTYF6b3b899NN.st7AS5.v8b3u3NOTAREALKEY838438bnsa
- Should look something like:
SRV: MongoDB connection URL.- Should look something like:
mongodb+srv://[username]:[password]@[project].[server].mongodb.net/
- Should look something like:
- Never share these environment variables, otherwise your bot or its data may be compromised.
- In the
src/configfolder, make copies of all files with.examplesuffixes without the.examplesuffix and adjust as needed.- See above explanations for these files.
- Run install command from this repository's directory:
npm i- Run the
startcommand from this repository's directory:
npm run startQ: My src/config/x.json changes aren't working when using Docker.
A: You will need to rebuild the container. Run docker compose down; docker compose up -d --build from this repository's directory to fully rebuild the container and have your changes take effect.