adamschachne / inhouse_bot

A Discord bot to handle League of Legends in-house games.
GNU General Public License v3.0
2 stars 2 forks source link
hacktoberfest

Code style: black

LoL in-house bot

A Discord bot to handle League of Legends in-house games, with role queue, matchmaking, and rankings.

Note

This is a fork of inhouse_bot. The original project is no longer maintained, so I'm using this repo to develop new features.

Setting up the bot

  1. Install Docker
  2. Activate your bot on the Discord developer portal and give it the Server Members and Message Content privileged intents: Video
  3. In docker.compose yml, replace all the values as needed:
    • INHOUSE_BOT_TOKEN = {token of discord bot}
    • INHOUSE_BOT_RIOT_API_KEY = {riot api key}
    • POSTGRES_PASSWORD: = {postgres password}
  4. Run docker compose build
  5. Run docker compose up -d
  6. The bot should be running now
  7. Create a new text channel for queuing and mark it with !admin mark queue
  8. You are finished :smiley:

How the matchmaking algorithm works

  1. Generate all possible teams with players in queue
  2. Get each players summoner rift rank (Solo/Duo or Flex(if no solo duo rank is available))
  3. Get rank value for Team A and Team B
  4. Attempt to find the smallest difference amongst Team A and Team B and on a lane to lane matchup
  5. Do this for all teams generated

Potential Drawbacks To This Algorithm:

Basic use

# Enter the channel’s matchmaking queue
!queue mid
>>> 🇲

# Accept games by reacting to the ready check message
>>> ✅✅✅✅✅✅✅✅✅✅✅
>>> Game 1 has started

# Games can be scored with !won
!won
>>> ✅✅✅✅✅✅✅
>>> Game 1 has been scored as a win for blue and ratings have been updated

# Champion played can be added with !champion
!champion riven
>>> Champion for game 1 set to Riven for Tolki

Queue features

Admin features