Need help? Check the wiki or create an issue.
- 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
Installation
- Git
- npm 6.4.1+ (Tested with 6.9.0)
- svn - Required to install steam-resources, a dependency of node-dota2.
Runtime
- Node.js 10+ (Tested with 10.9.0)
- PostgreSQL 9.5+ (Tested with 9.5.14)
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.
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
-
Note:
package-lock.json
is deleted before runningnpm 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
to install will work.
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
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
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
$ npm test
Major dependencies:
- discord.js - Discord API library
- Commando - discord.js command framework
- node-dota2 - Dota 2 bot library
- Sequelize - SQL ORM
- winston - Logging
Testing:
Thanks to the Reddit Dota 2 League for support and testing!
- ISC License
- Copyright 2019 © devilesk