Giter Site home page Giter Site logo

foxlisk / nmg-league-bot Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 935 KB

NMG League evil mastermind

Home Page: https://nmg-league.foxlisk.com/

License: MIT License

Rust 94.04% CSS 0.03% JavaScript 1.64% Shell 0.15% PLpgSQL 1.47% SCSS 2.18% TypeScript 0.49%

nmg-league-bot's People

Contributors

foxlisk avatar requiemofspirit avatar

Watchers

 avatar

nmg-league-bot's Issues

edit commentators on confirmed races

i often want to get a 1-comm race in front of ZSR but then be able to add comms to it later. currently i don't have a good way of doing this.

reformat into lib with bins

its really nice, as i learned on the alttp queue bot project, to have the code structured mainly in a lib that i can write binaries off of. for example it'd be nice to be able to write a CLI tool to manipulate the database. but right now that would be very difficult.

error handling

i think the way to do this might be to have handle_interaction dispatch to methods that return Result<InteractionResponse, String>. if they return an InteractionResponse, we respond to the original interaction with it; otherwise we send an error to the admin (async?) webhook.

probably String is worse and we want an error type - perhaps actually the error type encodes async vs admin messaging

reify bracket race info state?

that is to say, have a state field with options such as UNSCHEDULED, SCHEDULED, COMMENTARY_CONFIRMED, RESTREAM_CONFIRMED and maybe something like FINISHED to top it off

interaction custom IDs could have useful info

right now we have the "message id" tracked in the db, and custom IDs on interactions are like start_run

but presumably it would be fine to have custom IDs be like start_run_12345 and have that link back to races?

I don't know if that's user visible data or not, though; this is only a reasonable plan if the labels are never exposed to the end user

Race management operations

Players should be able to manage the lifecycle of their races via bot:

  • scheduling
  • asyncing if necessary
  • reporting times/winner/just the racetime room probably

i would like this to do neat things like "your opponent has scheduled a race for <time>. does this look right?" but maybe that's unnecessary

link accounts together properly

this would involve logging in with discord and then logging in with twitch to link the two

proper rtgg integration is also a possibility

get to zero panics after launch

eliminate every unwrap(), expect(), etc. panicking before launch is fine, e.g. on missing config values, but should have absolutely no crashes once running.

Model seasons

this ticket will include i think all the stuff to run "a season"

so we need

  • Season
  • Bracket
  • (possibly Category)
  • Round
  • Pairing (once again, this line of work does not involve constructing pairings, just being able to model them)

anything else?

Handle ZSR/comm/event stuff

races, when scheduled, should do things like:

  • Create events
  • Create a place for commentators to volunteer
  • Let ZSR know that there's stuff to be scheduled
  • Possibly publish to an external calendar?
  • sync things up (make sure the event, the messages ZSR deals with, etc, are all synced up)

model messages better?

right now i'm just sticking tons of message IDs on BracketRaceInfos and sort of remembering what the channel_id is supposed to be

i kind of want to write down the channel_id as well, but that's a terrible number of fields for a model IMO

so it would be something like creating a messsages table and FKing it which also seems awful

so idk

a simpler way to keep discord state correct

a bunch of stuff is reactive right now that should probably be more stable

e.g. the information about "who has signed up to comm a race" only exists in the form of reactions in discord

you could imagine a world in which we write down everything. and then user interactions simply write state down, and there's some sort of worker task that enforces state coherence.

basically, i'm worried about complexity here. when some unexpected user action occurs - say, rescheduling a race that has commentators already assigned - are we really gonna clean up all state appropriately? it would be nice to be able to idempotently ensure it.

Investigate orms

we probably want some ORM. the ones i see so far are:

  • ormx - seems very lightweight, but also very easy to drop in. not that i have that much db code to worry about yet or anything.
  • diesel - seems very heavyweight. it's not async but i don't actually think that matters. also it seems like work to provide an async version is coming along.
  • sea orm - seems somewhere in between, weightclass wise. based on sqlx so probably an easier migration story - also actually has a migration story, or at least a "get started from an existing db" story: https://www.sea-ql.org/sea-orm-tutorial/ch01-04-entity-generation.html. this doesn't seem that great. just like aesthetically, or ergonomically, the queries and stuff look gross to work with
  • rbatis - this looks extremely non-ergonomic

autocomplete

im not going to implement autocomplete yet. but i will (hopefully!) track places where it might be useful, in here

  • create bracket
  • report race
  • generate pairings

handle race rescheduling better

right now we leave all the old stuff around and just create a new "commportunities" post

it would be good to do some things such as:

  • delete the old commportunities post (if commentary not scheduled yet)
  • delete the existing zsr post (if commentary already scheduled)
  • potentially alert sirius/zsr to the new state of affairs more forcefully (with a new message or perhaps even a ping)

Let users create their own async races

Right now this has to go through an admin, which is like 10% so that an admin is involved and 90% because it was simpler to implement. I think letting players handle their own asyncs would be fine, though.

better state handling in async races

right now we're sort of counting on the message interactions to be in sync with the race state, but we should be more careful about that. at the minimum, we want to know about any discrepancies, even if we can't do much about them

twilight?

either serenity isn't a great pick for this or i just personally don't care for it, because i am finding it increasingly frustrating to use. maybe look into popping in twilight.

warn on signups if conflicts are known

chex signed up for comms when he had a race of his own an hour later; probably we can call this out somewhere (in #sirius-inbox if nothing else) to avoid in the future

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.