Title

Home


dota-ihl-bot

node Travis (.org) Coveralls github David Greenkeeper 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

  • Matchmaking Discord bot
  • League settings customization
  • Multiple lobby queue options
    • Player Draft - Automatically selected captains take turns picking teams
    • Autobalanced - Automatically created teams based on badge or inhouse Elo rating
    • Challenge - Players challenge each other to captain—followed by player draft
  • Dota 2 lobby hosting
  • Match stats tracking
    • Leaderboard
    • Inhouse Elo rating

Requirements

Installation

Runtime

Getting Started

Clone and install the dota-ihl-bot package.

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

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

# Install dependencies
$ rm package-lock.json
$ npm install
  • Note: package-lock.json is deleted before running npm install to work around current bugs with npm failing to install git dependencies.

    # Not deleting package-lock.json gives an error
    $ npm install
    npm ERR! code ENOLOCAL
    npm ERR! Could not install from "node_modules/steam/steam-resources@github:seishun/node-steam-resources#v1.2.0" as it does not contain a package.json file.

    Alternatively, just running npm ci will work.

dota-ihl-bot uses the dotenv module to load environment variables from a .env file, so you'll 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=

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

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