Skip to content
This repository has been archived by the owner on Jun 24, 2023. It is now read-only.

Self Hosting

Evyn Price edited this page Feb 23, 2021 · 3 revisions

How do I run my own instance of the bot?

First, create a new bot user by heading over to https://discord.com/developers/ and signing in with your Discord account. Create a new application, give it a name, and then click on "Bot" on the left side of the panel.

Discord Developer Applications Portal Discord Developer new Application

Then, give the bot a name and click the "copy" button under Token. This is your API token, and will be used later in the bot configuration. Never reveal your API token to anyone!

Note: Server Members Intent must be checked for activity logs to function properly.

Discord Developer Bot Application

Docker configuration

DockerHub Repository

Barista Bot currently supports both SQLite and MySQL databases. MySQL is recommended for production and docker instances of the bot.

Required Environment Variables

Key Example Value
BOT_TOKEN yourToken
BOT_PREFIX b.
BOT_ADMINID yourDiscordUserId
DATABASE MYSQL
DB_URL db:3306/yourDatabase
DB_USER databaseUser
DB_PASS databasePassword

Example Docker-Compose file

version: "2"

services:
  db:
    image: mysql:5.7
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: pass
      MYSQL_DATABASE: barista_db
      MYSQL_USER: barista
      MYSQL_PASSWORD: pass
      
  barista_client:
   image: evynprice/baristabot:latest
   restart: unless-stopped
   environment:
     BOT_TOKEN: yourToken
     BOT_PREFIX: b.
     BOT_ADMINID: 214045916246573057
     DATABASE: MYSQL
     DB_URL: db:3306/barista_db
     DB_USER: barista
     DB_PASS: pass

.jar configuration

Download the latest artifact from Jenkins and move it into a new folder

Create a new file .env.local in that directory. Copy the contents from the sample file in the GitHub repository and paste them into this new file

Fill in the required fields. DATABASE, DB_URL, DB_USER, and DB_PASS are only required if you are using a MySQL Database.

Example:

Key Value
BOT_TOKEN yourToken
BOT_PREFIX b.
BOT_ELEVATED yourUserId
DATABASE (Optional) MYSQL
DB_URL (Optional) localhost:3306/baristabot
DB_USER barista
DB_PASS password

Save the env configuration file.

In the bot directory, run the command java -jar {jar-name}.jar