simwai / lol-ranks-bot

A Discord bot to assign roles based on League of Legends Rank
4 stars 6 forks source link
bot discord-bot javascript js nodejs

lol-ranks-bot

A Discord bot that allows users to verify their League of Legends summoner name and assigns roles based on their rank/elo in the game. Users must initiate the verification process themselves, and upon successful verification, the bot will grant them the appropriate rank role within the Discord server.

VS Code ESLint Prettier License: CC BY-NC 4.0

Prerequisites

Before you begin, ensure you have met the following requirements:

Install Node.js (v16.0 or higher) and NPM from Node.js official website.
Install Docker and Docker Compose on your server. Follow the official Docker guide for installation instructions.

Local Development Setup

Follow these steps to set up the bot for development purposes on your local machine:

  1. Clone the repository:
    • Navigate to the directory where you want to clone the repository.
    • Run git clone https://github.com/simwai/lol-ranks-bot.git.
    • Navigate to the cloned directory by running cd lol-ranks-bot.
  2. Install dependencies by running npm install.
  3. Copy config.json.example and name it config.json.
  4. Adjust the config values by editing config.json.
  5. Start the bot by running npm run-script start.

Server Deployment

Docker Deployment

To deploy the bot on a server using Docker, follow these steps:

  1. Clone the repository:
    • Navigate to the directory where you want to clone the repository.
    • Run git clone https://github.com/simwai/lol-ranks-bot.git.
    • Navigate to the cloned directory by running cd lol-ranks-bot.
  2. Copy config.json.example and name it config.json.
  3. Adjust the config values by editing config.json.
  4. Run docker compose up -d to build the Docker image and start the bot in detached mode.
  5. To stop the bot, run docker compose down.

PM2 Deployment

To deploy the bot on a server using PM2, follow these steps:

  1. Install PM2 globally by running npm install pm2 -g.
  2. Clone the repository:
    • Navigate to the directory where you want to clone the repository.
    • Run git clone https://github.com/simwai/lol-ranks-bot.git.
    • Navigate to the cloned directory by running cd lol-ranks-bot.
  3. Install dependencies by running npm install.
  4. Copy config.json.example and name it config.json.
  5. Adjust the config values by editing config.json.
  6. Start the bot using PM2 by running pm2 start src/index.js --name lol-ranks-bot.
  7. To ensure PM2 restarts the bot after reboots, run pm2 save

How the Bot Works

Settings

LICENSE

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Creative Commons License