A discord bot that creates rank-based teams from a pool of players.
Currently, functionality is only for Valorant. Values for matchmaking are tuned for Valorant only because it is the only game I am comformtable with that does 10-mans. Other games will be added in the future, but that will require outside reference for how the difference between ranks "feels" in those games. Additionally, some games like League of Legends have more specialized roles than Valorant, functionality for that might need to be considered.
- Valorant
- CS:GO
- Leauge of Legends
- Overwatch/Overwatch 2 (will support 6v6 and 5v5 for each game's unique format)
This bot's main goal is to take a small pool of people and make teams. Although not limited to this, the audience in mind is scrimmaging discord servers (sometimes known as "10-mans" or "10-man servers") where people meet to play in custom lobbies. A common issue in these servers is that people have trouble picking teams when they do not know the others in the player pool, or when people are too indecisive. Player ranks are considered to make teams as balanced as possible, with some randomness still seeded in to ensure that the same pool of players will yield different teams every time.
This inspiration evolved as Valorant become a popular game in my active Discord servers. 10 minutes can easily fly by when people are trying to pick team captains and teams. Knowing each other so well makes it hard for us to pick out of a pool of people. This is either we people do not want to offend those left for last, or think too much about balancing teams. Although this idea started before Valorant was announced, these interactions gave the bot direction. MatchMaker fixes all of these issues, while also catering to the original audience.
If you want to add this bot a server you're in, ask an admin [or yourself if you are one ;)] to use this link for inviting MatchMaker. Click this to add the bot to your server :)
Hopefully I'm still talking to the admin. !commands will show you all of the avaiable commands for MatchMaker (using this as an admin will show more commands than a regular user), but the most important thing for setting up a collection system for player elo/ranks. This command is the !setup reaction, and should ONLY BE USED ONCE EVER. The only exception is if you delete the old message, and hopefully you've done that for a good reason.
Okay... the rest applies to all users, not just the admin. Once the admin has setup the bot, a message somewhere asking for your rank should show up, along with reactions. React to the message with your elo/rank in the appropriate, and it should be registered. Here's a bit about the other commands:
User Commands:
!match {num players}begins process of matchmaking with an expected {num players} players in the pool (e.g.!match 10). The MatchMaker will ask for a reaction from all player to be included, starting the processing of matchmaking.!rerollreattempts matching with the same players as the last!matchpool. For example, if teams are made with 8 set people,!rerollwill make new teams with those exact same people!setelo {elo}sets the elo of user to {elo}. {elo} is a string which supports capitalisation and lowercase (e.g.!setelo Radiant)!vreplies with the current release version of MatchMaker
Admin Commands:
!setup {#channel} {message}sends setup message of content {message} to {#channel} and prepares reactions for assigning elo. Message is optional, with default message as stand-in. Quotes around message are also optional (e.g. '!setup #roles "React your elo here"').- WARNING: THIS COMMAND SHOULD ONLY BE USED ONCE, UNLESS THE PREVIOUS MESSAGE IS DELETED
- Default message: "Please choose your rank by selecting the reaction that corresponds to it."
!setelo <@user> {elo}sets the elo of {@user} to {elo}. {elo} is a string which supports capitalisation and lowercase (e.g.!setelo @cherry_blossom gold)
A reminder that for further guidance, !commands will provide details on each command.
In order to download the code and make it your own, do the following:
- Download this repo from GitHub (look at releases for stable versions of this repo).
- Prepare your Node.js environment (npm init, npm install, all that jazz).
- Go to discord.com/deveopers and follow these instructions.
- When you get your token, incorporate it into your add.
dotenvis already included in the code, so just create a.envfile and create a secret with your token. The secret name isBOT_TOKEN, but you can change it if you want at the very bottom of thebot.jsfile. You can opt to use aconfig.jsonfile (like they do (here)[https://discordjs.guide/creating-your-bot/configuration-files.html]), but I prefer the.envbecause Heroku's secret is stored with the same variabeprocess.env.BOT_TOKENasdotenv. - To run your code locally, run
npm bot.jsin a terminal when in the same directory as the Node project. - If you wish to host it on a server, it does not take too many resources at all. I'm using a free Heroku instance for it. Just make sure to set a config variable for your token secret, as well as a buildpack for Node.
With that, you should be up and running your own server! As the project expands, more will be added.
For any questions, suggestions, or comments, contact me at [email protected].