Tycharis / pinscraper

A Discord bot that scrapes pins from a specified channel
MIT License
1 stars 0 forks source link

Build a bracket system #1

Open Tycharis opened 5 years ago

Tycharis commented 5 years ago

Challonge is small brain so building a bracket system that runs entirely within Discord (perhaps using embeds) would be less terrible to use

JoshuaHall commented 5 years ago

I'm doing some research on this, it seems some people have used a binary tree to represent a bracket. I'm trying to find a C# library first so we don't have to reinvent the wheel.

JoshuaHall commented 5 years ago

I'm thinking it might be a lot easier to just use Challonge, at least in the short term.

I made a very simple bracket system that constructs a bracket for any amount of players, but I haven't found an elegant way to actually change that bracket once it is made.

Challonge already has an API, and we get a pretty view of the bracket that is easily shareable without any work on our part. Spamming network requests to the API shouldn't be a big deal since I think it's going to be spaced out as people vote on a pin anyways. And we would likely also need to use a database to efficiently store the bracket data.

We could try to design it in such a way that the bot is bracket system agnostic, and later we can design one and drop it in.

Tycharis commented 5 years ago

The issue with Challonge is that the entrants have to be Challonge users. There is a weird thing where if you create a Challonge bracket without an account, you can input arbitrary values, but you have to make an account to run the bracket. If you try creating a new bracket after logging in, you are only allowed to input users. I don't believe the Challonge API will work for us.

JoshuaHall commented 5 years ago

You can input arbitrary strings as their usernames, I've already tried it with the beginnings of the wrapper thingy I've made and it works. For instance, this tournament has been created and interfaced with entirely through the API. The creation, the adding of the participants, the reporting of the scores, and none of them are actual Challonge accounts besides myself (to be clear you don't have to add yourself, I just did it to test and for fun).