SquireBot is a Discord bot designed to run and manage tournaments entirely within a Discord.

Overview

Overview

SquireBot is a Discord bot designed to run and manage tournaments entirely within a Discord.

The current intended usecase is Magic: the Gathering tournaments, though it can be used outside that context.

Since SquireBot centralizes the tournament management experience completely inside Discord, tournaments can be interfaced with on both mobile and desktop platforms. This allows players to interact with the tournament from the table they are sit at, outside the venue, or digitally around the globe. This makes SquireBot ideal for both in-person and digital events.

Features

There are many new tournament softwares becoming available, and SquireBot aims to be an alterative to them. From the tournament organizer's perspective, SquireBot handles all major tournament logistics, including:

  • Managing player deck lists
  • Pairing players
  • Creating private voice channels and roles for a match
  • Notifing players about the end of time in round
  • Recording result of a match and confirmation from the other players
  • Reporting the standings of players
  • And more!

SquireBot is also flexible. It is a central goal to allow TOs to organize tournaments as they wish and for SquireBot to help them do so. If SquireBot doesn't have a feature, it will be taken into consideration.

From the player's perspective, SquireBot allows them to interact with a tournament from a service that they likely already have.

Setup

To get SquireBot working on your server, you need to do the following. First, add the default roles and channels that SquireBot will be using 1. Create a "Tournament Admin" Discord Role. 2. Create a "Tournament Judge" Discord Role. 3. Create a channel titled "match-pairings" 4. Create two channel category titled "Matches" and "More Matches".

Setup

To get this bot working on your server, you to only do a few things. First, add the bot to your server here. This will get the bot all necessary permissions, namely:

  • Manage roles and channels
  • Send messages
  • Read message history
  • Mention Everyone
  • Add Reactions

Note, SquireBot will never use @everyone but needs that permission so it can mention arbitary roles. SquireBot makes roles for each tournament and each match in a tournament and uses these roles to alert players about the status of their match (such as the recording of a result, result confirmation, and time in round).

Using SquireBot

SquireBot's commands are broken into three categories, player, judge, and admin commands. Each category is protected by the judge and admin roles. This prevents players from using judge commands and judges from using admin commands; however, admin can still use any command and judges can still use player commands. Since tournament admin are pinged when a player tries to use a command that they do not have permission to, the help message that SquireBot gives is catered to that user's role.

To see SquireBot's help message, use the command !squirebot-help. In that message will be the below links, which go into more depth about each command. There are two other links which are crash courses for new tournament admin and players. These are also linked in the help message.

Development

To run a new instance of SquireBot, you will need its prerequistes and dependencies. SquireBot is written in python3 (and run/tested in python3.8). Its only non-standard dependencies are the Discord API library and the python-dotenv library. Both are available via pip3.

Once its libraries are installed, you need an .env file. This is where you'll specify your Discord Auth token for the bot. If you only intend to run SquireBot, you'll need the following:

DISCORD_TOKEN=
   
MAX_COIN_FLIPS=
   

If you want to work on SquireBot and add features too, you'll want to add a value for the testing bot's token. While this could be the same token as SquireBot's, adding a bot account is free of charge and the added compartmentalization does not hurt.

TESTING_TOKEN=
   

Lastly, if you'd error messages logged in Discord, you can specify the IDs to a Discord guild and text channel where errors will be logged.

DEV_SERVER_ID=
   
ERROR_LOG_CHANNEL_ID=
   

Trice Bot Setup

SquireBot has integration with TriceBot, which helps organize players in Cockatrice as well as provides a single location to pull replay from. Follow the intrustion in its README to set it up. TriceBot should be ran on the same machine as SquireBot on https://127.0.0.1:8000 with SSL enabled. It is recommended to use nginx to expose the tricebot replay downloads to the WAN (reverse proxy https to API_URL) you can you nginx to hide the /api/* endpoints as well.

The auth token for TriceBot should be put into the .env file with:

TRICE_BOT_AUTH_TOKEN=
   
API_URL=
   
    : 
    https://127.0.0.1:8000>

    EXTERN_URL=
     



   
Comments
  • [Dev]: Deadlocks

    [Dev]: Deadlocks

    I thought that I was careful and avoided opportunities for deadlocks. I was incorrect. Both DashMap::get() and DashMap::get_mut() can deadlock, which are used extensively. This should be rare but was the core issue behind #23. Either a more measured approach to acquisition needs to be implemented or those maps need to be swapped for an async type.

    bug in progress 
    opened by TylerBloom 3
  • Dev: Logging

    Dev: Logging

    Currently, there is no logging happening in the v2 pre-release. This will make fixing bugs rather difficult.

    Ideally, any panics or issues with Discord would be logged locally and, when possible, sent to the error log on the dev server. The after_command event handler should be helpful for this.

    feature in progress 
    opened by TylerBloom 3
  • [Feat]: Match Result Reply with Match Status

    [Feat]: Match Result Reply with Match Status

    When a match result is entered (and maybe even when its confirmed), the reply should include a match status embed. That way, players know what they are entering/confirming.

    good first issue feature 
    opened by TylerBloom 2
  • Dev: Hang ups

    Dev: Hang ups

    Some things, such as making duplicate roles, seem to cause hang ups. This seems somewhat random, but creating multiple tournaments with the same name seems to do the trick. This also seems to cause everything to hang up. No new commands will be processed (from any server) until the hang up is resolved.

    bug 
    opened by TylerBloom 2
  • [Bug]: Inconsistent Player Ordering in Round Embed

    [Bug]: Inconsistent Player Ordering in Round Embed

    What went wrong:

    Between constructions of the Round status embed, the player order can change. This stems from the Round storing players in a HashSet.

    Expected behavior:

    This ordering should be consistent.

    General Info:

    There is an issue out in SquireLib (Rounds Track Player Order) that will help remedy this.

    bug good first issue 
    opened by TylerBloom 1
  • [Feat]: Commanders not in Deck Embed

    [Feat]: Commanders not in Deck Embed

    Description:

    Currently, commanders don't appear in deck embeds. This is because the sorted deck struct only consumes the mainboard of a deck.

    The solution you'd like:

    The sorted deck should also track commanders.

    good first issue feature todo 
    opened by TylerBloom 1
  • [Feat]: Status and Standings Update Command

    [Feat]: Status and Standings Update Command

    The status and standings messages are updated automatically. This is great, but it makes it hard to know if they have been updated (besides waiting). There should be a command to force update these.

    feature 
    opened by TylerBloom 1
  • Dev: Command Usage

    Dev: Command Usage

    Serenity has macros that allow you to add use cases and examples for commands. These examples show up in the help command. All commands need to be annotated with these.

    documentation good first issue 
    opened by TylerBloom 1
  • Changed scoring from 3 per win to N+1

    Changed scoring from 3 per win to N+1

    According to the specs on the MSTR

    Added a parameter to the player#getMatchPoints so that the tournament object can pass the number of players per pod to it. This way it still works for 1v1 events.

    Ignore the whitespace changes, my editor automatically removes those on save (which is a good thing actually)

    opened by fbatista 1
  • [Feat]: Table Numbers as Round Identifiers

    [Feat]: Table Numbers as Round Identifiers

    Description:

    Often, table numbers suffice as round identifiers for active rounds. This should be supported by SB (and SquireLib).

    The solution you'd like:

    To specify a table number, the number can be prefixed a T in order to distinguish between round numbers.

    Alternatives:

    Alternatively, match numbers are likely to be used less as identifiers, so we can default to table numbers and use R and/or M to specify match numbers.

    good first issue feature todo 
    opened by TylerBloom 0
  • [Bug]: Operations commands don't update status

    [Bug]: Operations commands don't update status

    Any command that wraps a GuildTournamentAction::Operation does not update the tournament status, but it should. Unfortunately, not all operations should update the status. For ease, it will probably be easiest if this always updates the status. This should add minimal overhead.

    bug todo 
    opened by TylerBloom 0
  • [Bug]: Dropping players can cause panic

    [Bug]: Dropping players can cause panic

    What went wrong:

    A player left the server and should have been automatically dropped. This did not happen. Instead, the tournament admin had to drop the player using that player's id. This causes a panic when SB tries to remove that player's role. This led to the tournament admin being confused about if it worked.

    Solution:

    Remove the unwrap when getting a player to remove their role.

    bug todo 
    opened by TylerBloom 0
  • [Bug]: Deck Check not Working

    [Bug]: Deck Check not Working

    What went wrong:

    Often, the deck check command doesn't work. This is seemed to happen after the first round, but I have not been able to reproduce the behavior. First occurred during Okotoberfest 2022.

    bug todo 
    opened by TylerBloom 1
  • [Feat]: Smarter Panic Checks in Logging

    [Feat]: Smarter Panic Checks in Logging

    Description:

    Currently, a command has a TTL of 10 seconds before the logging system thinks a panic has occurred. This should be more dynamic as commands that send multiple requests to Discord take much longer.

    The solution you'd like:

    We should log every await point and/or call to Discord. The logging system should then only detect when more than 10 seconds have passed since the last logged operation.

    good first issue feature todo 
    opened by TylerBloom 0
  • [Dev]: Remove Unwraps

    [Dev]: Remove Unwraps

    There have been a number of bugs found whose origin is a dubious unwrap call. We should have a goal of removing every call to unwrap to avoid such problems.

    bug good first issue feature in progress 
    opened by TylerBloom 0
  • [Dev]: Tournament and Discord Sync

    [Dev]: Tournament and Discord Sync

    It is possible that, for one reason or another, parts of a tournament's representation in a server fall out of sync with the actual tournament object, ex a round is created but the role doesn't exist or people don't have the role. There should be mechanisms to help sync the Discord components with the tournament. Note that the reverse is not true. For example, removing a role/channel from Discord should not remove a match.

    feature todo 
    opened by TylerBloom 0
Owner
null
a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project

Aircord ??️ a discord libary that use to make discord bot with low efficiency and bad performance because I don't know how to manage the project Examp

Aircord 2 Oct 24, 2021
A secure and customizable bot for controlling cross-server announcements and interactions within Discord

DiscordBot A secure and customizable bot for controlling cross-server announcements and interactions within Discord. Within the code of the bot, you c

Jacob Dorfmeister 1 Jan 22, 2022
A discord bot written in discord.py to manage custom roles assigned to boosters of your server.

BBotty A discord bot written in discord.py to manage custom roles assigned to boosters of your server. v0.0.1-alpha released! This version is incomple

Oui002 1 Nov 27, 2021
A simple message content sniping Discord bot which you can run yourself! Sniping API pulled from isobot and Arch bot

Discord Snipe Bot This is a bot made with the same message content sniping API from isobot and Arch bot. It's default prefix is -, however you can als

notsniped 5 Aug 11, 2022
Opasium AI was specifically designed for the Opasium Games discord only. It is a bot that covers the basic functions of any other bot.

OpasiumAI Opasium AI was specifically designed for the Opasium Games discord only. It is a bot that covers the basic functions of any other bot. Insta

Dan 3 Oct 15, 2021
A multipurpose bot designed to make Discord better for everyone, written in Python.

Hadum A multipurpose bot that makes Discord better for everyone Features A Fully Functional Moderation component: manage your staff, members and permi

null 1 Jan 25, 2022
Satoshi is a discord bot template in python using discord.py that allow you to track some live crypto prices with your own discord bot.

Satoshi ~ DiscordCryptoBot Satoshi is a simple python discord bot using discord.py that allow you to track your favorites cryptos prices with your own

Théo 2 Sep 15, 2022
A Python wrapper for discord slash-commands, designed to extend discord.py.

dislash.py An extending library for discord.py that allows to build awesome slash-commands. ⭐

null 173 Dec 19, 2022
❤️ Hi There Im EzilaX ❤️ A next gen powerful telegram group manager bot 😱 for manage your groups and have fun with other cool modules Made By Sadew Jayasekara 🔥

❤️ EzilaX v1 ❤️ Unmaintained. The new repo of @EzilaXBot is Public. (It is no longer based on this source code. The completely rewritten bot available

Sadew Jayasekara 18 Nov 24, 2021
❤️A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules

Natsuki Based on Python Telegram Bot Contributors Video Tutorial: Complete guide on deploying @TheNatsukiBot's clone on Heroku. ☆ Video by Sadew Jayas

Pawan Theekshana 8 Oct 6, 2022
Amanda-A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules.

Amanda-A next gen powerful telegram group manager bot for manage your groups and have fun with other cool modules.

Team Amanda 4 Oct 21, 2022
A bot framework for Reddit to manage threads, wiki pages, widgets, menus and more.

Sub Manager Sub Manager is a bot framework for Reddit to automate a variety of tasks on one or more subreddits, and can be configured and run without

r/SpaceX 3 Aug 26, 2022
A Telegram Bot to manage your music channel with some cool features.

Music Channel Manager V2 A Telegram Bot to manage your music channel with some cool features like appending your predefined username to the musics tag

null 11 Oct 21, 2022
A surviv.io bot that helps you manage you clan in surviv.io!

Scooter-Surviv.io-Clan-Bot A Surviv.io Discord Bot This is a bot that helps manage your surviv.io clan! Read below for more!!. Features Lets you creat

cosmic|duck 1 Jan 3, 2022
Senexia - A powerful telegram bot to manage your groups as effectively as possible

⚡ Kenechi bot ⚡ A Powerful, Smart And Simple Group Manager ... Written with AioG

Akhi 2 Jan 11, 2022
Elon Muschioso is a Telegram bot that you can use to manage your computer from the phone.

elon Elon Muschioso is a Telegram bot that you can use to manage your computer from the phone. what does it do? Elon Muschio makes a connection from y

null 4 Feb 28, 2022
A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py)

Articuno (discord-interactions) A small and fun Discord Bot that is written in Python and discord-interactions (with discord.py) Get started If you wa

Blue 8 Dec 26, 2022
Create a Neo4J graph of users and roles trust policies within an AWS Organization.

AWS_ORG_MAPPER This tool uses sso-oidc to authenticate to the AWS organization. Once authenticated the tool will attempt to enumerate all users and ro

Ruse 24 Jul 28, 2022
ShadowClone allows you to distribute your long running tasks dynamically across thousands of serverless functions and gives you the results within seconds where it would have taken hours to complete

ShadowClone allows you to distribute your long running tasks dynamically across thousands of serverless functions and gives you the results within seconds where it would have taken hours to complete

null 240 Jan 6, 2023