Git Product home page Git Product logo

inhousebot's Introduction

🤖 InHouseBot

An in-house Discord bot that drafts 2 teams and has a MMR system was made for any game that you play 5v5.

⌨️ Commands:

/addplayer
  • Adds a player to the list of the players (only players added can use another commands expect: /help). A player starts with 50mmr points.

    • options:
      • player - Select a user from discord server.
/lobby
  • Creates a lobby, then players can use /join to enter the lobby
/join
  • Join a created lobby. When the lobby reaches 10 players, the bot will make the 2 teams equalized based on mmr.
/lobbyresult
  • When a game is defined use /lobbyresult to record the result of the lobby, this will also update mmrs and wins/loses/games of the players of the lobby. The players of the winner team wins 5mmr points, the players of loser team lose 5mmr points.

    • options:
      • lobbynumber - The number of the lobby we wanna defined the result.
      • winnerteam - The team that won the lobby.
/leave
  • Leave from a created lobby joinned before. Notice: you can't leave a lobby alredy in progress.
/playerinfo
  • Shows info of a player.
    • options:
      • player - Select a player from discord server
/deletelobby
  • Deletes a lobby openned (undefined teams) or in progress (defined teams).
    • options:
      • lobbynumber - The number of the lobby we wanna delete.
/ranking
  • Shows ranking of players based on selected option.
    • options:
      • option - Select between: Top 10 MMR, Bot 10 MMR, Top 10 Wins or Top 10 Loses
/allplayers
  • Shows all players who have been added to the inhouse.
/help
  • Shows commands info.

📦 How to use:

You need to have node.js installed and a Discord account.

Clone the project.

Install required packages into the project:

npm install

Now copy the .env.example file to .env file to the project:

cp .env.example .env

Now, you need to create a bot in the discord developer portal. Click on New Application and give it a cool name. On the General Information tab copy the APPLICATION ID and past on the CLIENT_ID variable on .env file, like this example:

TOKEN=
CLIENT_ID=0123456789876543210

Now, on the Bot tab, click on "Reset Token" to generate a new Token. Copy the token to the .env file:

Remember, it's crucial not to share this token with anyone else.

The .env file should be like this example:

TOKEN=EXAMPLE01234TOKEN
CLIENT_ID=0123456789876543210

THIS IS A VERY IMPORTANT STEP:

On the 'OAuth2' tab, under the 'OAuth2 URL Generator' session, select bot and applications.commands. Then, in the 'BOT PERMISSIONS' section, check the Administrator checkbox. This will generate the link to add the bot to a server. Simply paste the generated link into your browser to add the bot to your server.

Now, run the command:

npm start

The bot is now up and running! Head over to your server and enjoy it!

Notice: The bot may take up to 5 minutes to register the commands.

⚠️ This bot cannot operate on multiple servers simultaneously within the same project because the database only works for one server. If you use the bot on more than one server, the data will be messed up.

Author:

Katson Matheus html html html html

inhousebot's People

Contributors

katson1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

inhousebot's Issues

top10

Creating a top10 mmr or wins

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.