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).
- Clone our repository.
git clone https://gitlab.com/indispark/brave-bot.git- Then
cdto the repository folder.
- Then
- Rename
env.exampleto.env. Once renamed edit your.envand add your Discord Bot Token.- To rename run:
cp env.example .env - To edit the file run
nano .env
- To rename run:
- Rename
example.ymltoconfig.yml. Once renamed edit yourconfig.ymland set theOwner IDandServer IDfields.- To rename run:
cp example.yml config.yml - To edit the file run:
nano config.yml
- To rename run:
- Install the bot dependencies:
- Install Pixi.
- Run
pixi install -e bot(Not needed if you are deploying via Docker)
- Follow a deployment method below
- Install Docker
- Run:
docker compose up -d
- Install Node.js if not installed.
- Install PM2, use either:
- NPM:
npm install pm2@latest -g - Yarn:
yarn global add pm2
- NPM:
- 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.
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.
- Update the text in
community/scripts/release_inform.py. - Create a channel webhook.
- Copy the Webhook URL.
- Paste the Webhook URL as CI/CD Project variable (Ensure it is protected and masked).
- Once you have released a update run a pipeline with the variable
UPDATE_PIPELINEset totrue.
Extra Brave Bot Configuration:¶
- 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 theRules Channel IDfield for this to work.
- 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.
- Open Positions:
- With YAML multi-string, list the positions that you are looking for. This field requires the
Application Overrideto be enabled (set totrue).
- With YAML multi-string, list the positions that you are looking for. This field requires the
- Disallow
/nukein certain servers:- Set the
Nuke Command Restrictions Overridetotrue(enabled). - Add the servers (server-ids), that you do not want
/nuketo work in, into theNo Nuke Command Serverslist field.
- Set the
- Scenic Loading Images:
- For
Bot Statisticshelp-extra and/help, you will first get a loading embed. If you enable theScenic Loading Image System Overrideand added image addresses to theScenic Loading Imageslist field, images will then appear for the end-user.
- For
- Banned Nicknames:
- Enable the
Banned Nicknames Overrideand have nicknames in theBanned Nicknamesfield. Once done, when using/nicknamenicknames listed in the field will not be allowed.
- Enable the
- Guardian System:
- If the
Guardian System Overrideis enabled (set totrue) you can add users to the Guardian System via theGuardiansconfiguration field. - The Guardian System allows users to stop users from archiving messages authored by them.
- The
Guardiansconfiguration field must be a list that only has IDs (integers) as it's elements.
- If the
- Other Optional ID Fields.
Logs Channel ID- Required if you want GlobaLogs (Brave Bot's logging system) to work.
Rules Channel ID- Allows you to send custom Support Server Rules.
Main Source Code Project ID- Optional GitLab (not GitHub) integration if wanted.
- 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 Ownerslist field.
- If you have Team helping you, you can make a Bot Co Owner. To do this add their User-ID(s) to the
- Sentry (Error Tracking):
- If the
Sentry Integration Overrideis enabled (set totrue) you must add your Sentry DSN to your.env.
- If the
- Topia System Configuration:
- Pro & None Pro VAT Rates
- Pro & None Pro Tax Rates
- Multipliers for Pro and None Pro Users
- Earning Ranges (Pro & None Pro)
- Winning Amount Ranges (Pro & None Pro)
- Daily Earning Ranges (Pro & None Pro)
- Pro Battle Saving (Pro Only and is used solely as a percent)
- Tax Refund Range
- Government Benefit Range
- Stocks (Gain or Lose) Range (Apart of a Pro Only Feature unless the Pro System is disabled)
- Bong Game Per Round Coin Range
- Farm Revenue Range (Apart of a Pro Only Feature unless the Pro System is disabled)
- Division Number for Profile Level
- Topia Adversaries (Nothing is pre-set)
- List of Adversary/Boss names.
- Custom Tips:
- Ensure the
Tips Overrideis enabled (set totrue). - In the
Custom Tipslist field, you can add custom tips that you wanna add alongside the baseline tips that are written intips.py(In the utils Folder).
- Ensure the
- Emojis:
- Arrow Emoji
- Cross Emoji
- Tick Emoji
- Pro Emoji
- Bot Name:
- By default it is set to
Brave Bot. Change it to the name of your bot.
- By default it is set to
- 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 URLfield. - The URL provided must be HTTPS and valid.
- 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
- Documentation URL:
- If you wish to redirect users to your documentation, update the
Documentation URLfield. Pydantic will verify if the URL passed is correct. - By default we re-direct users here.
- If you wish to redirect users to your documentation, update the
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).
- Clone our repository.
git clone https://gitlab.com/indispark/brave-bot.git- Then
cdto the repository folder.
- Then
- Install pixi on your server.
- Install & deploy:
pixi install -e docspixi 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:¶
- Ensure pixi is installed.
- Run
pixi install - Run either:
- For test deploying the bot run
pixi run bot-run - For test deploying the docs website run
pixi run test-docs
- For test deploying the bot run
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:¶
- Download the
thread botfolder as a zip folder from the Community Archive Folder. - Unzip it.
- Modify the code for your uses and etc.
- 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).
- Download the
ubb.pyfile from the Community Archive Folder. - Modify the code for your uses and etc.
- Deploy it.