Skip to content

pachev/gsbot

Repository files navigation

Gear Score Bot for Black Desert Online

GSBOT Build And Tests Discord Server

Description

A python application to help manage guild members and their gear score for Black Desert Online. The link to view this data visually is at https://gsbot.pachevjoseph.com

Requirements

  • Python 3.6+
  • Mongodb
  • discord.py

Optional

Running With Docker And Docker Compose

This assumes that you have docker and docker-compose installed

Ensure that you have setup a file called config.ini in the root directory. There is a sample file called config.ini.example to use as a template. After, run the following command:

docker-compose up

This will build the gsbot along with all dependencies and start it using the token you've provided.

Running Locally

Python Virtual Environment

This project is best ran in a virtual environment. You can use pyvenv, which comes with python 3 and greater. The virtual enviroment lets you run different versions of python and packages from other projects.

Installation (Unix)

First install python3+ on your machine which should come with pip. If not, download from link provided.

  1. python3 -m venv env - Create a virtual environment in the env folder
  2. source env/bin/activate - Load the environment
  3. pip install -r requirements.txt - Install dependencies
  4. deactivate - Unloads the environment

Installation (Windows)

Note - Most documentation is for unix systems. Differences between windows and unix are: env\Scripts\ instead of env/bin/ and libraries go in env\Lib\ rather than env/lib/)

First install python3+ on your machine and then download and install pip. Then from the root of the project run:

  1. pip install virtualenv - Install virtualenv if not already done soCreate a virtual environment in the venv folder
  2. virtualenv venv - This creates will create a series of directories and scripts
  3. venv/Scripts/activate - Load the enviroment (There should be a (venv) before the current directory path name
  4. pip install -r requirements.txt - Install dependencies
  5. deactivate - Unloads the environment

Once your dependencies are installed, there are a couple of steps you need to do before running.

  1. create aconfig.ini file inside of the main directory
  2. Setup config file like the example below: If you would like to give your users the ability to attach files directly when updating gear pictures, then create a cloudinary account and fill out the fields appropriately under 'cloudinary' settings
[auth]
token = ... #This is where you put your bot token that you get from discord
user = test
pwd = test

[cloudinary]
has_cloud_storage = False
cloud_name = some_name
api_key = some_api_key
api_secret = some_api_secret

[db]
name = gsbot
port = 27017
host = database
character_collection = character
server_collection = server
member_collection = member
historical_collection = historical
  1. Have an instance of mongodb running with the a db that has the same name that is inside of the config file. The bot, as it stands, is configured to connect to a localhost instance of mongo on port 27017. If you would like different configurations, make sure you change the config file accordingly.

Thanks to

A python application using discord.py