Second iteration of the original Not Clash discord bot. Written in JavaScript and utilizes Node.js, discord.js, and SQLite.
Facilitates League of Legends matches and stores player and match information in SQLite database.
- Download JavaScript.
- Download Node.
- Clone/download repository.
- Configure config.json
- TOKEN:
String: Discord bot token
- Go to discord developer portal.
- Click application.
- Click bot.
- Under
TOKEN
, reset token and then save the resulting token to config.json.
- clientId:
String: Discord bot client id
- Go to discord developer portal.
- Click application.
- Click OAuth2.
- Under
CLIENT ID
, press copy.
- D:
Int: Effect of difference on probability to win or lose, higher = less effect
- K:
Int: Maximum value a player's elo can change from one match
- TOKEN:
- Run
npm install
In project directory, run the following commands.
node deploy-commands.js
to update the bot's commands.node .
to start the bot.
- Run
/start
command.- Select players to particpate in the game.
- Match information should be displayed.
- To swap players, run
/swap player1 player2
. - To finish match, run
/finish matchid team
.- Variable
matchid
can be found on the bottom left of the match embed. - Variable
team
is either 1 or 2, the team that won.
- Variable
- Converted from prefix to slash commands.
- Multiple matches can happen concurrently due to match information being stored in the SQLite database.
- Atomicity and coherency are implemented using locks.
- Modularized, components are stored in an easy-to-follow manner and allow for great mutablility.
- New commands.
- Responses are more specific, terse, and offer more insight into statistics.
- Match history.
Complete information can be seen by running /help command_name
when bot is running.
cancel matchid
Cancels an ongoing match.
commands
Information about all commands in Not Clash v2 bot.
finish matchid team
Completes match and updates player/match information.
help command
Help message for Not Clash v2 bot.
info
Information about the Not Clash v2 bot.
leaderboard [n1] [n2]
Displays the leaderboard.
register [player] [primary] [secondary]
Registers player to the database.
role [primary] [secondary]
Changes user's role.
roll n1 [n2]
Random number from 1 to n1 or from n1 to n2, inclusive.
start [type]
Starts the League of Legends game.
stats [player]
Display's player's stats.
swap matchid player1 player2
Swaps two players in a match.
Not Clash is an idea based off the original League of Legends event called "Clash" where teams of 5 players face off against one another in a bracket tournament. Thus, "Not Clash" borrows that idea and instead of a tournament, it facilitates League of Legends custom matches and stores player information into SQLite database.
Start Match Command |
User Selection Menu |
Selecting 10 Users |
Generated Match |
Information Message |
Leaderboard |
Changing Role |
- Update README with images.
- Implement a queue with operations
- Choose type of matchmaking.
- Plan: To choose the match details, set customId to "selectUsers"
- Check for the matchType using regex (like HTML link)
- Display match history
- Overall match history
- Player match history
- Choose player to hop to in leaderboard
- Running two commands concurrently will result in database errors cause of locks...
- Fix: Implement a queue in interactionCreate.js that pushes to a queue and then procesess it one by one.