Skip to content

Self Hosting Guide @ Development Guide:

Info

We use pixi as our package manager, environment manager and more. Please ensure you install Pixi.

Brave Bot Self Hosting Guide:

Info

To connect to your VPS/Server, use Putty (Use Port Number 22 and "SSH" as your Connection Type).

  1. Clone our repository. git clone https://gitlab.com/indispark/brave-bot.git
    1. Then cd to the repository folder.
  2. Rename env.example to .env. Once renamed edit your .env and add your Discord Bot Token.
    1. To rename run: cp env.example .env
    2. To edit the file run nano .env
  3. Rename example.yml to config.yml. Once renamed edit your config.yml and set the Owner ID and Server ID fields.
    1. To rename run: cp example.yml config.yml
    2. To edit the file run: nano config.yml
  4. Install the bot dependencies:
    1. Install Pixi.
    2. Run pixi install -e bot (Not needed if you are deploying via Docker)
  5. Follow a deployment method below
  1. Install Docker
  2. Run: docker compose up -d
  1. Install Node.js if not installed.
  2. Install PM2, use either:
    1. NPM: npm install pm2@latest -g
    2. Yarn: yarn global add pm2
  3. Run pm2 start "pixi run -e bot bot-run" -name discord-bot

Copy and edit the file below to /etc/systemd/system/brave-bot.service, then run sudo systemctl daemon-reload && sudo systemctl enable --now brave-bot.

TOML
[Unit]
Description=Discord Bot
After=network.target

[Service]
User=<user>
Restart=always
Type=simple
WorkingDirectory=<where you put the bot>
ExecStart=/usr/bin/pixi run -e bot bot-run

[Install]
WantedBy=multi-user.target

Tip

We highly advise on updating your bot's configuration after deploying it for the first time. Learn more about what you can configure below.

Note

If your are forking and testing the bot from an IDE, please refer to our Testing Guide.

Tip

If you have forked our repository and are using GitLab, you can use our CI/CD script to inform users of any updates.

  1. Update the text in community/scripts/release_inform.py.
  2. Create a channel webhook.
  3. Copy the Webhook URL.
  4. Paste the Webhook URL as CI/CD Project variable (Ensure it is protected and masked).
  5. Once you have released a update run a pipeline with the variable UPDATE_PIPELINE set to true.

Extra Brave Bot Configuration:

  1. Support Server Rules:
    • /help's Extra: "Rules" allows the Bot Owner to send a embed of their Rules. You need to have given a Channel ID for the Rules Channel ID field for this to work.
  2. Donate URL:
    • Give a Donate/Pay link to allow users to donate/support your bot's development.
    • The URL provided must be HTTPS and valid.
  3. Open Positions:
    • With YAML multi-string, list the positions that you are looking for. This field requires the Application Override to be enabled (set to true).
  4. Disallow /nuke in certain servers:
    1. Set the Nuke Command Restrictions Override to true (enabled).
    2. Add the servers (server-ids), that you do not want /nuke to work in, into the No Nuke Command Servers list field.
  5. Scenic Loading Images:
    • For Bot Statistics help-extra and /help, you will first get a loading embed. If you enable the Scenic Loading Image System Override and added image addresses to the Scenic Loading Images list field, images will then appear for the end-user.
  6. Banned Nicknames:
    • Enable the Banned Nicknames Override and have nicknames in the Banned Nicknames field. Once done, when using /nickname nicknames listed in the field will not be allowed.
  7. Guardian System:
    • If the Guardian System Override is enabled (set to true) you can add users to the Guardian System via the Guardians configuration field.
    • The Guardian System allows users to stop users from archiving messages authored by them.
    • The Guardians configuration field must be a list that only has IDs (integers) as it's elements.
  8. Other Optional ID Fields.
    1. Logs Channel ID
      • Required if you want GlobaLogs (Brave Bot's logging system) to work.
    2. Rules Channel ID
      • Allows you to send custom Support Server Rules.
    3. Main Source Code Project ID
      • Optional GitLab (not GitHub) integration if wanted.
  9. Bot Co Owners:
    • If you have Team helping you, you can make a Bot Co Owner. To do this add their User-ID(s) to the Co Bot Owners list field.
  10. Sentry (Error Tracking):
    • If the Sentry Integration Override is enabled (set to true) you must add your Sentry DSN to your .env.
  11. Topia System Configuration:
    1. Pro & None Pro VAT Rates
    2. Pro & None Pro Tax Rates
    3. Multipliers for Pro and None Pro Users
    4. Earning Ranges (Pro & None Pro)
    5. Winning Amount Ranges (Pro & None Pro)
    6. Daily Earning Ranges (Pro & None Pro)
    7. Pro Battle Saving (Pro Only and is used solely as a percent)
    8. Tax Refund Range
    9. Government Benefit Range
    10. Stocks (Gain or Lose) Range (Apart of a Pro Only Feature unless the Pro System is disabled)
    11. Bong Game Per Round Coin Range
    12. Farm Revenue Range (Apart of a Pro Only Feature unless the Pro System is disabled)
    13. Division Number for Profile Level
    14. Topia Adversaries (Nothing is pre-set)
      • List of Adversary/Boss names.
  12. Custom Tips:
    • Ensure the Tips Override is enabled (set to true).
    • In the Custom Tips list field, you can add custom tips that you wanna add alongside the baseline tips that are written in tips.py (In the utils Folder).
  13. Emojis:
    1. Arrow Emoji
    2. Cross Emoji
    3. Tick Emoji
    4. Pro Emoji
  14. Bot Name:
    • By default it is set to Brave Bot. Change it to the name of your bot.
  15. Support Server Invite URL:
    • By default we direct users to our support server for guidance. However if you have modified Brave Bot (code-wise) please update the discord invite link set in the Support Server Invite URL field.
    • The URL provided must be HTTPS and valid.
  16. Documentation URL:
    • If you wish to redirect users to your documentation, update the Documentation URL field. Pydantic will verify if the URL passed is correct.
    • By default we re-direct users here.

Note

With Pydantic and our example.yml we pre-set defaults for you to make the self hosting experience easier (reducing the amount errors you encounter).

Warning

Your Discord App/Bot will not boot/run if your configuration is done incorrectly. Look at utils.data to see what data-type is required. If you require assistance please open a ticket in our support server (Linked in the footer).

Note

Brave Bot by-default uses the strict truthy values which is true and false. No capital "t" or capital "f".

Website Self Hosting Guide:

Info

To connect to your VPS/Server, use Putty (Use Port Number 22 and "SSH" as your Connection Type).

  1. Clone our repository. git clone https://gitlab.com/indispark/brave-bot.git
    1. Then cd to the repository folder.
  2. Install pixi on your server.
  3. Install & deploy:
    1. pixi install -e docs
    2. pixi run -e docs build-docs

Note

You can also deploy via Docker, we recommend using Zensical's Docker Image (for installation and usage instructions, see the documentation on Docker Hub).

Testing Guide:

  1. Ensure pixi is installed.
  2. Run pixi install
  3. Run either:
    1. For test deploying the bot run pixi run bot-run
    2. For test deploying the docs website run pixi run test-docs

Note

This guide is for testing the website/bot from your IDE. Ensure you have configured the bot correctly (.env and config.yml) before-hand. Your bot will not run 24-7 with this guide.

Note

To test the bot using Docker, simply run docker compose up -d. Ensure you have installed Docker before.

Archived Projects:

Warning

Both Thread Bot and Ultimate Ban Bot use a library (Nextcord) that we no longer use. The library has released breaking changes since.

Thread Bot:

  1. Download the thread bot folder as a zip folder from the Community Archive Folder.
  2. Unzip it.
  3. Modify the code for your uses and etc.
  4. Deploy it.

Ultimate Ban Bot:

Ultimate Ban Bot (UBB) is an old bot that was made by us. It is now open source and available for anyone to use. It is only available via the repository and is therefore license under this website's license (GPL 3.0).

  1. Download the ubb.py file from the Community Archive Folder.
  2. Modify the code for your uses and etc.
  3. Deploy it.