Bottius is a simple discord Bot created out of boredom for the Bricc Cult Discord server.
There are two ways of deploying Bottius. You can either use the installers or manually set everything up.
The installer automatically installs and sets up everything required to run Bottius. To get started, simply execute the following command: wget -N https://raw.githubusercontent.com/Montori/Bottius/master/linux-master-installer.sh && chmod +x linux-master-installer.sh && sudo bash linux-master-installer.sh
After using this command, simply follow the "instructions" in the installer menu.
- Ubuntu
- 18.04
- 16.04
- Debian
- 10
- 9
- CentOS/RHEL
- 8
- 7
Follow the steps below to manually get your Bottius instance working:
-
Clone the Bottius repo:
git clone https://github.com/Montori/Bottius
-
Download and install PostgreSQL 12, following the instructions at:
-
Install Node.js at:
-
Install TypeScript globally:
npm install -g typescript
-
From the Bottius root directory, install the required dependencies:
npm ci
-
Create
botconfig.json
in thesource/
directory, and place the following configurations into the file:{ "token": "yourTotallySafeBotToken", "prefix": "!!", "masters": ["userID"], "activity": "", "activityStatus": 0 }
Notes:
- You may add more than one userID to the masters, by separating each ID with a comma
- Make sure to customize the
botconfig.json
(such as the token and masters) to your needs
-
Create
ormconfig.json
in the Bottius root directory, and place the following configuration into the file:{ "type": "postgres", "url": "postgres://postgres:!DB_PASS!@localhost:5432/Bottius_DB", "entities": ["out/entities/persistent/*.js"], "migrations": ["out/migration/*.js"], "cli": { "migrationsDir": "source/migration" } }
Note:
- Realistically, the only thing you should need to change about the configurations is
!DB_PASS!
, which is the password you will give the Bottius database user.
- Realistically, the only thing you should need to change about the configurations is
-
Compile Bottius with TypeScript:
tsc
-
Configure the Bottius database:
sudo -u postgres -H sh -c "createuser -P Bottius"; sudo -u postgres -H sh -c "createdb -O Bottius Bottius_DB"
- When prompted to enter a password for the database user, provide the same password used when setting up
ormconfig.json
- On windows you may want to set up the database over pgadmin, a handy postgres database tool where you will need to create the
Bottius
database user and theBottius_DB
database manually
- When prompted to enter a password for the database user, provide the same password used when setting up
-
You are now ready to run Bottius by executing the following command in the Bottius root directory:
node out/bot.js
If you want to contribute to Bottius you might encounter that you want to store a thing in the database. In order to do that you must edit an existing type or create a new one, all types belong to source/Material/ Since we use TypeORM you can look up all the things there but here is a quick migration guide:
- edit the type of your choice
- compile
tsc
- in Bottius root type
typeorm migration:generate -n NameOfYourMigration
- tsc
And voilà your migration is done! You can find it in source/Migration
If something went wrong after a migration you can use typeorm migration:revert
If something went really wrong follow these steps:
- drop your database (restart the postgres server if a connection is still active)
- delete your migration in
source/Migration
- delete
out/
directory - compile
tsc
- run Bottius
And Bottius is like he was before the big migration fuckup