cysabi / CheckpointBot

The bot for Checkpoint 1

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Checkpoint Bot

The bot for Checkpoint 1

This is a bot to help with tournament and verification season management for Checkpoint 1. It is partially derived from my rewrite of Radia, however, there are still many custom-built cogs.

Usage

This is for staff members, for non-staff members, type !help.

Season cog

Players are verified based on their ranks, and will recieve a rank role. Seasons are used to avoid outdated ranks, at the start of each new season, all of the rank roles are replaced.

Additionally, a Verified role is used to handle channel permissions and channel access. This role is not replaced each season. However, it may be pruned every couple of seasons.

Here is how the verification process works.

  1. A user makes a role request in the respective channel, showing proof of their rank and asking for the correct role.
  2. A Barista verifies the user and gives them the Verified role and their respective rank role.

The !season command group is used to manage season rank roles.

  • !season List the season roles. The command will also tell you the index of each tournament, this is important.
    • Alternatively, as an alias, you can use !season roles for the same result.
  • !season delete Removes the old season roles.
    • If you are afraid it will delete the wrong roles, you can double-check what roles it will be deleting by doing !season or !season list.
  • !season new <name> [delete=False] Creates new season roles, you are required to specify the name of the season.
    • <name>: Any name works, but if you specify a literal season (such as 'winter'), it will automatically convert it into an emoji.
    • [delete=False]: Additionally, you can specify to automatically call delete old season roles before creating new roles (!season new spring true).
  • !season prune Removes the Verified role from anyone without a season rank role.
    • This is helpful every couple of seasons when you want to remove the verified role from those who have neglected to request a role for a while.

Tourney cog

  • !whatis is used to quickly look up glossary terms, and tournament rules, such as "dc", "swiss", and "glossary" (yes, the glossary includes a glossary). Requires the google.json file (see Google Setup).

These commands are used like !whatis battlefy, if you omit the argument, the bot will automatically list all the possible options.

Final words

Thanks for reading, I hope this documentation section was helpful to you. If you have any questions, feel free to ask me @LeptoFlare.

Contributing

Running locally

Prerequisites

  1. Make sure you have Docker installed.
  2. A Google API project for the bot.

Google setup

  1. Enable the following API
  2. Go to the API & Services and navigate to credentials tab
  3. Click on + create credentials and create a new Service Accounts fill in the necessary field.
    • When you get to Role give it editor.
  4. Download the credentials files and rename it google.json
  5. Share the Google Sheet with the client_email from the json file.
  6. Copy the gsheet key from the url at https://docs.google.com/spreadsheets/d/{key}/edit, you will use this in the .env

Bot Setup

  1. Create a .env in the repository root:

    TOKEN = discord.bot.token
    GSHEET = gsheet_key
    SENTRY = "System Environment"  # Optional
    DEBUG = 1  # Optional

    Please know that there are no true or false values in .env files. If you want to set a key to false, set it to 0

  2. Run docker-compose up in the repository root.


Contact me · @LeptoFlare · lepto.tech

As always, distributed under the MIT license. See LICENSE for more information.

https://github.com/LeptoFlare/CheckpointBot

About

The bot for Checkpoint 1

License:GNU Lesser General Public License v2.1


Languages

Language:Python 99.2%Language:Dockerfile 0.8%