8000 GitHub - n8ventures/lol-ranks-bot: A Discord bot to assign roles based on League of Legends Rank
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A Discord bot to assign roles based on League of Legends Rank

Notifications You must be signed in to change notification settings

n8ventures/lol-ranks-bot

{"props":{"initialPayload":{"allShortcutsEnabled":false,"path":"/","repo":{"id":821396354,"defaultBranch":"master","name":"lol-ranks-bot","ownerLogin":"n8ventures","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2024-06-28T12:53:39.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/25238367?v=4","public":true,"private":false,"isOrgOwned":false},"currentUser":null,"refInfo":{"name":"master","listCacheKey":"v0:1719579221.3242712","canEdit":false,"refType":"branch","currentOid":"f1a6b4e2cd641a3274268a102e265f883e2dabdb"},"tree":{"items":[{"name":".husky","path":".husky","contentType":"directory"},{"name":".vscode","path":".vscode","contentType":"directory"},{"name":"assets/img","path":"assets/img","contentType":"directory","hasSimplifiedPath":true},{"name":"locales","path":"locales","contentType":"directory"},{"name":"src","path":"src","contentType":"directory"},{"name":"tests/data-handlers","path":"tests/data-handlers","contentType":"directory","hasSimplifiedPath":true},{"name":".eslintignore","path":".eslintignore","contentType":"file"},{"name":".eslintrc","path":".eslintrc","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".prettierrc","path":".prettierrc","contentType":"file"},{"name":"Dockerfile","path":"Dockerfile","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"config.example.json","path":"config.example.json","contentType":"file"},{"name":"docker-compose.yml","path":"docker-compose.yml","contentType":"file"},{"name":"package-lock.json","path":"package-lock.json","contentType":"file"},{"name":"package.json","path":"package.json","contentType":"file"}],"templateDirectorySuggestionUrl":null,"readme":null,"totalCount":16,"showBranchInfobar":true},"fileTree":null,"fileTreeProcessingTime":null,"foldersToFetch":[],"treeExpanded":false,"symbolsExpanded":false,"isOverview":true,"overview":{"banners":{"shouldRecommendReadme":false,"isPersonalRepo":false,"showUseActionBanner":false,"actionSlug":null,"actionId":null,"showProtectBranchBanner":false,"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_repo","releasePath":"/n8ventures/lol-ranks-bot/releases/new?marketplace=true","showPublishActionBanner":false},"interactionLimitBanner":null,"showInvitationBanner":false,"inviterName":null,"actionsMigrationBannerInfo":{"releaseTags":[],"showImmutableActionsMigrationBanner":false,"initialMigrationStatus":null}},"codeButton":{"contactPath":"/contact","isEnterprise":false,"local":{"protocolInfo":{"httpAvailable":true,"sshAvailable":null,"httpUrl":"https://github.com/n8ventures/lol-ranks-bot.git","showCloneWarning":null,"sshUrl":null,"sshCertificatesRequired":null,"sshCertificatesAvailable":null,"ghCliUrl":"gh repo clone n8ventures/lol-ranks-bot","defaultProtocol":"http","newSshKeyUrl":"/settings/ssh/new","setProtocolPath":"/users/set_protocol"},"platformInfo":{"cloneUrl":"https://desktop.github.com","showVisualStudioCloneButton":false,"visualStudioCloneUrl":"https://windows.github.com","showXcodeCloneButton":false,"xcodeCloneUrl":"xcode://clone?repo=https%3A%2F%2Fgithub.com%2Fn8ventures%2Flol-ranks-bot","zipballUrl":"/n8ventures/lol-ranks-bot/archive/refs/heads/master.zip"}},"newCodespacePath":"/codespaces/new?hide_repo_select=true\u0026repo=821396354"},"popovers":{"rename":null,"renamedParentRepo":null},"commitCount":"171","overviewFiles":[{"displayName":"README.md","repoName":"lol-ranks-bot","refName":"master","path":"README.md","preferredFileType":"readme","tabName":"README","richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch1 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003elol-ranks-bot\u003c/h1\u003e\u003ca id=\"user-content-lol-ranks-bot\" class=\"anchor\" aria-label=\"Permalink: lol-ranks-bot\" href=\"#lol-ranks-bot\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eA 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.\u003c/p\u003e\n\u003cp dir=\"auto\"\u003e\u003ca href=\"https://code.visualstudio.com/\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/f5b0c98044b969b3dc8c75a27994e2af98db9dbf69e66f25391e1b160d637f27/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4944452d5653253230436f64652d3641304441442e737667\" alt=\"VS Code\" data-canonical-src=\"https://img.shields.io/badge/IDE-VS%20Code-6A0DAD.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://eslint.org/\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/7e08c6d3dff8ee8ab179db0e4edaf662236b3beddf6179c3be9343f0aba49c55/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f45534c696e742d25453225394325413825323076696f6c65742e7376673f7374796c653d666c6174266c6f676f3d65736c696e74266c6f676f436f6c6f723d776869746526636f6c6f723d384132424532266c6162656c436f6c6f723d343534353435\" alt=\"ESLint\" data-canonical-src=\"https://img.shields.io/badge/ESLint-%E2%9C%A8%20violet.svg?style=flat\u0026amp;logo=eslint\u0026amp;logoColor=white\u0026amp;color=8A2BE2\u0026amp;labelColor=454545\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://prettier.io/\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/a0374b74603517ceb57284650d087ef9af1d8582d6e3f600424a9c361bbfa1f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50726574746965722d25453225394325413825323076696f6c65742e7376673f7374796c653d666c6174266c6f676f3d7072657474696572266c6f676f436f6c6f723d776869746526636f6c6f723d384132424532266c6162656c436f6c6f723d343534353435\" alt=\"Prettier\" data-canonical-src=\"https://img.shields.io/badge/Prettier-%E2%9C%A8%20violet.svg?style=flat\u0026amp;logo=prettier\u0026amp;logoColor=white\u0026amp;color=8A2BE2\u0026amp;labelColor=454545\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003ca href=\"https://creativecommons.org/licenses/by-nc/4.0/\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/a9eac3172e62c1be9735fcef679868ae4cb6de7e944b44c5dc7de5104a23a5ab/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d434325323042592d2d4e43253230342e302d3933373044422e7376673f7374796c653d666c6174266c6162656c436f6c6f723d34353435343526636f6c6f723d393337304442\" alt=\"License: CC BY-NC 4.0\" data-canonical-src=\"https://img.shields.io/badge/License-CC%20BY--NC%204.0-9370DB.svg?style=flat\u0026amp;labelColor=454545\u0026amp;color=9370DB\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePrerequisites\u003c/h2\u003e\u003ca id=\"user-content-prerequisites\" class=\"anchor\" aria-label=\"Permalink: Prerequisites\" href=\"#prerequisites\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eBefore you begin, ensure you have met the following requirements:\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eFor local development:\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eNode.js (v16.0 or higher)\u003c/li\u003e\n\u003cli\u003eNPM (usually comes with Node.js)\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eFor server deployment:\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eNode.js (v16.0 or higher)\u003c/li\u003e\n\u003cli\u003eDocker and Docker Compose (for Docker deployment)\u003c/li\u003e\n\u003cli\u003ePM2 (for PM2 deployment)\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLocal Development Setup\u003c/h2\u003e\u003ca id=\"user-content-local-development-setup\" class=\"anchor\" aria-label=\"Permalink: Local Development Setup\" href=\"#local-development-setup\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eFollow these steps to set up the bot for development purposes on your local machine:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eInstall Node.js (v16.0 or higher) and NPM from \u003ca href=\"https://nodejs.org/en/download/\" rel=\"nofollow\"\u003eNode.js official website\u003c/a\u003e.\u003c/li\u003e\n\u003cli\u003eClone the repository:\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eOpen your terminal.\u003c/li\u003e\n\u003cli\u003eNavigate to the directory where you want to clone the repository.\u003c/li\u003e\n\u003cli\u003eRun \u003ccode\u003egit clone https://github.com/simwai/lol-ranks-bot.git\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eNavigate to the cloned directory by running \u003ccode\u003ecd lol-ranks-bot\u003c/code\u003e.\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003eInstall dependencies by running \u003ccode\u003enpm install\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eAdjust the config values by editing \u003ccode\u003econfig.json\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eStart the bot by running \u003ccode\u003enpm run-script start\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eServer Deployment\u003c/h2\u003e\u003ca id=\"user-content-server-deployment\" class=\"anchor\" aria-label=\"Permalink: Server Deployment\" href=\"#server-deployment\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eDocker Deployment\u003c/h3\u003e\u003ca id=\"user-content-docker-deployment\" class=\"anchor\" aria-label=\"Permalink: Docker Deployment\" href=\"#docker-deployment\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo deploy the bot on a server using Docker, follow these steps:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eInstall Docker and Docker Compose on your server. Follow the \u003ca href=\"https://docs.docker.com/get-docker/\" rel=\"nofollow\"\u003eofficial Docker guide\u003c/a\u003e for installation instructions.\u003c/li\u003e\n\u003cli\u003eClone the repository (see Local Development Setup step 2).\u003c/li\u003e\n\u003cli\u003eAdjust the config values by editing \u003ccode\u003econfig.json\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eRun \u003ccode\u003edocker compose up -d\u003c/code\u003e to build the Docker image and start the bot in detached mode.\u003c/li\u003e\n\u003cli\u003eTo stop the bot, run \u003ccode\u003edocker compose down\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003ePM2 Deployment\u003c/h3\u003e\u003ca id=\"user-content-pm2-deployment\" class=\"anchor\" aria-label=\"Permalink: PM2 Deployment\" href=\"#pm2-deployment\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eTo deploy the bot on a server using PM2, follow these steps:\u003c/p\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eInstall Node.js (v16.0 or higher) and NPM on your server.\u003c/li\u003e\n\u003cli\u003eInstall PM2 globally by running \u003ccode\u003enpm install pm2 -g\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eClone the repository (see Local Development Setup step 2).\u003c/li\u003e\n\u003cli\u003eInstall dependencies by running \u003ccode\u003enpm install\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eAdjust the config values by editing \u003ccode\u003econfig.json\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eStart the bot using PM2 by running \u003ccode\u003epm2 start index.js --name lol-ranks-bot\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eTo ensure PM2 restarts the bot after reboots, run \u003ccode\u003epm2 save\u003c/code\u003e\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eHow the Bot Works\u003c/h2\u003e\u003ca id=\"user-content-how-the-bot-works\" class=\"anchor\" aria-label=\"Permalink: How the Bot Works\" href=\"#how-the-bot-works\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003eUsers trigger the verification process by a command in Discord.\u003c/li\u003e\n\u003cli\u003eThe bot verifies the user's League of Legends summoner name.\u003c/li\u003e\n\u003cli\u003eOnce verified, the bot checks the user's rank/elo in League of Legends.\u003c/li\u003e\n\u003cli\u003eThe bot assigns a corresponding rank role and verified role to the user in the Discord server based on their League of Legends rank/elo.\u003c/li\u003e\n\u003cli\u003eThe bot keeps the lol ranks of the verified users up-to-date by running periodically.\u003c/li\u003e\n\u003cli\u003eThe bot does not automatically assign roles to all users; each user must initiate the verification process.\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eSettings\u003c/h2\u003e\u003ca id=\"user-content-settings\" class=\"anchor\" aria-label=\"Permalink: Settings\" href=\"#settings\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003echannels\u003c/code\u003e = Set the ID of the channels that will be used for the Bot to send the messages (optional)\u003c/p\u003e\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\u003ccode\u003ehelp\u003c/code\u003e - Default channel to help members with bot-related issues\u003c/li\u003e\n\u003c/ul\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eguildID\u003c/code\u003e = ID of your server (\u003ca href=\"https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-\" rel=\"nofollow\"\u003eTutorial\u003c/a\u003e)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003ediscordToken\u003c/code\u003e = Tokens of your bot, used to authorize API requests and carry all of your bot user’s permissions (\u003ca href=\"https://discord.com/developers/docs/getting-started#configuring-a-bot\" rel=\"nofollow\"\u003eTutorial\u003c/a\u003e)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eriotToken\u003c/code\u003e = Riot development API key (\u003ca href=\"https://developer.riotgames.com/docs/lol#:~:text=Before%20you%20start%20reading%20this%20documentation%20you%20need%20to%20first%20login%20with%20your%20Riot%20Games%20account.%20Once%20you%20do,%20a%20Developer%20Portal%20account%20is%20created%20for%20you!%20This%20action%20also%20generates%20a%20basic%20development%20API%20key%20that%20is%20associated%20with%20your%20account.\" rel=\"nofollow\"\u003eTutorial\u003c/a\u003e)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003estatus\u003c/code\u003e = The Discord bot status\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eranks\u003c/code\u003e = The names of your rank roles on your Discord server\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003erankIconNames\u003c/code\u003e = The names of you rank icons on your Discord server\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eregion\u003c/code\u003e = The LoL API endpoint region\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003etimeZone\u003c/code\u003e = Your timezone, you can find all timezones \u003ca href=\"https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List\" rel=\"nofollow\"\u003ehere\u003c/a\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003elanguage\u003c/code\u003e = Select your general language according to the filename inside the \u003ccode\u003elocales\u003c/code\u003e folder (name only, no extension)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eeloRoleLanguage\u003c/code\u003e = Select your rank role language\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003everifiedRoleLanguage\u003c/code\u003e = Select your verified role language\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eenableCronJob\u003c/code\u003e = Enables automatic update of ranks every \u003ccode\u003eX\u003c/code\u003e time, defined in \u003ccode\u003ecronTab\u003c/code\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003ecronTab\u003c/code\u003e = Defines how often the ranks will be updated if \u003ccode\u003eenableCronJob\u003c/code\u003e is \u003ccode\u003etrue\u003c/code\u003e\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003econcurrentRequests\u003c/code\u003e = Defines the number of concurrent requests to the API (See \u003ca href=\"https://developer.riotgames.com/#:~:text=RATE%20LIMITS\" rel=\"nofollow\"\u003eRate Limits\u003c/a\u003e after login)\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003erequestTime\u003c/code\u003e = Set the request time in milliseconds\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003esetVerifiedRole\u003c/code\u003e = Sets the verified role, when somebody has got an elo role\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eenableVerification\u003c/code\u003e = Enables summoner name verification\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003e\u003ccode\u003eenableTierUpdateMessages\u003c/code\u003e = Enable bot to send messages on configured channel for rank up/down\u003c/p\u003e\n\u003c/li\u003e\n\u003cli\u003e\n\u003cp dir=\"auto\"\u003eTo enable rank icons on messages (like this \u003ca target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/7af58f14b28e4ae359b817575397ce918b35054a47c19ea2ce19305835810119/68747470733a2f2f7261772e636f6d6d756e697479647261676f6e2e6f72672f6c61746573742f706c7567696e732f7263702d66652d6c6f6c2d7374617469632d6173736574732f676c6f62616c2f64656661756c742f696d616765732f72616e6b65642d6d696e692d6372657374732f6368616c6c656e6765722e706e67\"\u003e\u003cimg alt=\"Challenger Icon\" style=\"width: 18px; max-width: 100%;\" src=\"https://camo.githubusercontent.com/7af58f14b28e4ae359b817575397ce918b35054a47c19ea2ce19305835810119/68747470733a2f2f7261772e636f6d6d756e697479647261676f6e2e6f72672f6c61746573742f706c7567696e732f7263702d66652d6c6f6c2d7374617469632d6173736574732f676c6f62616c2f64656661756c742f696d616765732f72616e6b65642d6d696e692d6372657374732f6368616c6c656e6765722e706e67\" data-canonical-src=\"https://raw.communitydragon.org/latest/plugins/rcp-fe-lol-static-assets/global/default/images/ranked-mini-crests/challenger.png\"\u003e\u003c/a\u003e) you need to add custom emojis on your server (\u003ca href=\"https://support.discord.com/hc/en-us/articles/360036479811-Custom-Emojis\" rel=\"nofollow\"\u003eTutorial\u003c/a\u003e)). The icons are inside the \u003ccode\u003eassets/img\u003c/code\u003e folder (Please do not change the name of the icons or the bot will not be able to identify them)\u003c/p\u003e\n\u003c/li\u003e\n\u003c/ul\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eLICENSE\u003c/h2\u003e\u003ca id=\"user-content-license\" class=\"anchor\" aria-label=\"Permalink: LICENSE\" href=\"#license\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003eThis work is licensed under a \u003ca href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\" rel=\"nofollow\"\u003eCreative Commons Attribution-NonCommercial-ShareAlike 4.0 International License\u003c/a\u003e.\u003cbr\u003e\u003cbr\u003e\u003ca href=\"http://creativecommons.org/licenses/by-nc-sa/4.0/\" rel=\"nofollow\"\u003e\u003cimg alt=\"Creative Commons License\" src=\"https://camo.githubusercontent.com/62be294f71c9a1885f9cd8f54aa8b8bd42d432fd14b5393a8b25bcd1f34daa42/68747470733a2f2f692e6372656174697665636f6d6d6f6e732e6f72672f6c2f62792d6e632d73612f342e302f38387833312e706e67\" data-canonical-src=\"https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c/article\u003e","loaded":true,"timedOut":false,"errorMessage":null,"headerInfo":{"toc":[{"level":1,"text":"lol-ranks-bot","anchor":"lol-ranks-bot","htmlText":"lol-ranks-bot"},{"level":2,"text":"Prerequisites","anchor":"prerequisites","htmlText":"Prerequisites"},{"level":2,"text":"Local Development Setup","anchor":"local-development-setup","htmlText":"Local Development Setup"},{"level":2,"text":"Server Deployment","anchor":"server-deployment","htmlText":"Server Deployment"},{"level":3,"text":"Docker Deployment","anchor":"docker-deployment","htmlText":"Docker Deployment"},{"level":3,"text":"PM2 Deployment","anchor":"pm2-deployment","htmlText":"PM2 Deployment"},{"level":2,"text":"How the Bot Works","anchor":"how-the-bot-works","htmlText":"How the Bot Works"},{"level":2,"text":"Settings","anchor":"settings","htmlText":"Settings"},{"level":2,"text":"LICENSE","anchor":"license","htmlText":"LICENSE"}],"siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fn8ventures%2Flol-ranks-bot"}}],"overviewFilesProcessingTime":0}},"appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-2e7f7047116e.js","githubDevUrl":null,"enabled_features":{"copilot_workspace":null,"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true,"github_models_repo_integration":false}}}}
 
 

Repository files navigation

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:

  • For local development:
    • Node.js (v16.0 or higher)
    • NPM (usually comes with Node.js)
  • For server deployment:
    • Node.js (v16.0 or higher)
    • Docker and Docker Compose (for Docker deployment)
    • PM2 (for PM2 deployment)

Local Development Setup

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

  1. Install Node.js (v16.0 or higher) and NPM from Node.js official website.
  2. Clone the repository:
    • Open your terminal.
    • 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. 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. Install Docker and Docker Compose on your server. Follow the official Docker guide for installation instructions.
  2. Clone the repository (see Local Development Setup step 2).
  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 Node.js (v16.0 or higher) and NPM on your server.
  2. Install PM2 globally by running npm install pm2 -g.
  3. Clone the repository (see Local Development Setup step 2).
  4. Install dependencies by running npm install.
  5. Adjust the config values by editing config.json.
  6. Start the bot using PM2 by running pm2 start index.js --name lol-ranks-bot.
  7. To ensure PM2 restarts the bot after reboots, run pm2 save

How the Bot Works

  • Users trigger the verification process by a command in Discord.
  • The bot verifies the user's League of Legends summoner name.
  • Once verified, the bot checks the user's rank/elo in League of Legends.
  • The bot assigns a corresponding rank role and verified role to the user in the Discord server based on their League of Legends rank/elo.
  • The bot keeps the lol ranks of the verified users up-to-date by running periodically.
  • The bot does not automatically assign roles to all users; each user must initiate the verification process.

Settings

  • channels = Set the ID of the channels that will be used for the Bot to send the messages (optional)

    • help - Default channel to help members with bot-related issues
  • guildID = ID of your server (Tutorial)

  • discordToken = Tokens of your bot, used to authorize API requests and carry all of your bot user’s permissions (Tutorial)

  • riotToken = Riot development API key (Tutorial)

  • status = The Discord bot status

  • ranks = The names of your rank roles on your Discord server

  • rankIconNames = The names of you rank icons on your Discord server

  • region = The LoL API endpoint region

  • timeZone = Your timezone, you can find all timezones here

  • language = Select your general language according to the filename inside the locales folder (name only, no extension)

  • eloRoleLanguage = Select your rank role language

  • verifiedRoleLanguage = Select your verified role language

  • enableCronJob = Enables automatic update of ranks every X time, defined in cronTab

  • cronTab = Defines how often the ranks will be updated if enableCronJob is true

  • concurrentRequests = Defines the number of concurrent requests to the API (See Rate Limits after login)

  • requestTime = Set the request time in milliseconds

  • setVerifiedRole = Sets the verified role, when somebody has got an elo role

  • enableVerification = Enables summoner name verification

  • enableTierUpdateMessages = Enable bot to send messages on configured channel for rank up/down

  • To enable rank icons on messages (like this Challenger Icon) you need to add custom emojis on your server (Tutorial)). The icons are inside the assets/img folder (Please do not change the name of the icons or the bot will not be able to identify them)

LICENSE

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

Creative Commons License

About

A Discord bot to assign roles based on League of Legends Rank

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 98.3%
  • Dockerfile 1.5%
  • Shell 0.2%
0