devilesk / dota-ihl-bot

A Discord bot for hosting Dota 2 inhouse leagues.
https://devilesk.github.io/dota-ihl-bot/
ISC License
8 stars 8 forks source link
discord-bot dota2


dota-ihl-bot

node Travis (.org) Coveralls github David Greenkeeper badge Snyk badge GitHub Discord

A Discord bot for hosting Dota 2 inhouse leagues.

Need help? Check the wiki or create an issue.

Table of Contents

Features

Requirements

Local Setup

Installation

Runtime

Docker Setup

Getting Started

Clone the dota-ihl-bot repository.

# Clone this repository
$ git clone https://github.com/devilesk/dota-ihl-bot

dota-ihl-bot uses the dotenv module to load environment variables from a .env file, so you'll need to create one now.

# Create an empty .env configuration file
$ touch .env

Use the following template to fill in your .env file. Check the wiki page for more details.

DB_NAME=ihl
DB_USERNAME=postgres
DB_PASSWORD=password
DB_HOST=127.0.0.1
DB_PORT=5432
DB_LOG_SQL=false

MATCH_POLL_INTERVAL=5000
STEAM_API_KEY=

TOKEN=
COMMAND_PREFIX=!
OWNER_DISCORD_ID=

LOGGER_SILENT=false
LOGGER_LEVEL=debug
LOGGER_EXCEPTIONLOGFILE=exceptions.log
LOGGER_DIRNAME=logs
LOGGER_FILENAME=application-%DATE%.log
LOGGER_DATEPATTERN=YYYY-MM-DD-HH
LOGGER_ZIPPEDARCHIVE=true
LOGGER_MAXSIZE=20m
LOGGER_MAXFILES=14d

CLIENT_ID=
CLIENT_SECRET=
CALLBACK_URL=
PORT=
STEAM_RETURN_URL=
STEAM_REALM=

If you want to install and run everything locally yourself, then continue to Local Setup.

If you want to install and run with Docker, then skip to Docker Setup.

Local Setup

Install the dota-ihl-bot package.

# Go into the repository
$ cd dota-ihl-bot

# Delete dependency lock file
$ rm package-lock.json

# Install dependencies
$ npm install

Create the Postgres database.

# Create PostgreSQL database and run migrations
$ npm run db:init

Now you're ready to start the bot.

# Run the bot
$ npm start

Docker Setup

First, you'll need to build the docker container.

# Build the docker container
$ make

Now you can run the container and start developing in it.

# Run the container for development
$ make dev

To run in production, you'll need a .env file called .env.production.

# Run with production configuration
$ make prod

Documentation

Check the wiki for user documentation.

Bot command README documentation in commands/<group> folders:

Code documentation hosted on github pages and generated using JSDoc.

# Generate docs
$ npm run docs

Tests

$ npm test

Built With

Major dependencies:

Testing:

Acknowledgements

Thanks to the Reddit Dota 2 League for support and testing!

License

forthebadge