Skip to content

WIP - A Discord economy bot with minigames and more.

Notifications You must be signed in to change notification settings

zsd7200/ratbase

Repository files navigation

Ratbase Logo Ratbase

A Discord economy bot with minigames and more.

Self-hosted via Docker and configurable via JSON files within the src/config folder.

Getting Started

With Docker + docker-compose.yml (recommended)

  1. Clone this repository.
git clone https://github.com/zsd7200/ratbase.git
  1. Make a copy of docker-compose.yml.example and rename it to simply docker-compose.yml.
  2. Set environment variables.
    • TOKEN: Discord bot token, available after creating a bot in the Discord Developer Portal.
      • Should look something like: NUSfjbnj453bTYF6b3b899NN.st7AS5.v8b3u3NOTAREALKEY838438bnsa
    • SRV: MongoDB connection URL.
      • Should look something like: mongodb+srv://[username]:[password]@[project].[server].mongodb.net/
    • Never share these environment variables, otherwise your bot or its data may be compromised.
  3. In the src/config folder, make copies of all files with .example suffixes without the .example suffix and adjust as needed.
    • Example: basic.json.example should be copied and renamed to basic.json.
    • Files in the src/config folder 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.json is 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].amountType is either fixed or percent--the bot will not run if the example file provided remains unmodified.
        • fixed will give a static amount of $RAT.
        • percent will give a percentage of the top of the leaderboard's balance. It is similar to the $$tax command, but nothing is removed from the top user. Should be entered as a decimal, not an integer.
      • Note: All rate objects in extras.json are represented as 1/x.
      • Note: All commands in the allow and deny arrays must be enabled in commands.json as well.
  4. Create and run the container from within this repository's folder:
docker compose up -d

Without Docker

  1. Create a .env with the following entries:
TOKEN=
SRV=
  1. Set environment variables.
    • TOKEN: Discord bot token, available after creating a bot in the Discord Developer Portal.
      • Should look something like: NUSfjbnj453bTYF6b3b899NN.st7AS5.v8b3u3NOTAREALKEY838438bnsa
    • SRV: MongoDB connection URL.
      • Should look something like: mongodb+srv://[username]:[password]@[project].[server].mongodb.net/
    • Never share these environment variables, otherwise your bot or its data may be compromised.
  2. In the src/config folder, make copies of all files with .example suffixes without the .example suffix and adjust as needed.
    • See above explanations for these files.
  3. Run install command from this repository's directory:
npm i
  1. Run the start command from this repository's directory:
npm run start

Troubleshooting

Q: 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.

About

WIP - A Discord economy bot with minigames and more.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •