League of Legends stats in Slack
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
lib
services
utils
.eslintrc
.gitignore
Dockerfile
README.md
app.js
package.json
riot.txt

README.md

League of Legends stats in Slack

At work we use Slack for day-to-day business and shenanigans. We are also a bunch of avid League of Legends players. My idea was to combine the two and add LoL-stats straight in to our #gaming-channel!

Tech

Installation

Three environment variables need to be setup before starting.

LOL_GLOBAL=https://global.api.pvp.net/api/lol/static-data/{region}
LOL_BASE=https://eune.api.pvp.net/api/lol/{region}
RIOT_API_KEY=[YOUR-API-KEY]
$ git clone https://github.com/believer/lol-slack.git
$ cd lol-slack
$ npm install
$ npm start

This starts one POST route at http://localhost:3000/lol. So to test it post a JSON object on the form of for example:

{
  "text": "wins <summonerName>"
}

Testing

Slack have provided a great way for testing the message formatting right here. Each command also have a direct TRY IT link with a typical message and the response has a URL directly to the Slack formatting. This is how the message will look in the chat, instead of just looking at the JSON that the API reponds with ;)

Slash commands

The service responds to slash commands, i.e. /lol as a message. The available commands are listed below.

  • region = eune, euw, na and so on default: eune
  • platform = eun1, euw1, na1 and so on default: eun1

/lol freeToPlay

TRY IT!

Displays the current champions who are free to play.

freeToPlay command

/lol help

TRY IT!

Display the help message only to the user who requested the help. (Also responds if provided command does not exist)

help command

/lol latest <summonerName> <region>

TRY IT!

Displays statistics from a summoner's latest game.

latest command

/lol league <summonerName> <region>

TRY IT!

Displays division and stats for a summoner.

league command

/lol masteryScore <summonerName> <region>

TRY IT!

Displays total mastery score of a summoner.

masteryScore command

/lol rankedMatches <summonerName> <region>

TRY IT!

Displays ranked matches from the last 24 hours.

rankedMatches command

/lol status <region>

TRY IT!

Displays the current status of the servers in a region.

status command

/lol team <summonerName> <region>

TRY IT!

Displays the teams of a summoner.

team command

/lol topThreeChamps <summonerName> <region> <platform>

TRY IT!

Displays the top three champions for a given summoner name.

topThreeChamps command

/lol wins <summonerName> <region>

TRY IT!

Display the number of wins of a summoner.

wins command