foxlisk / nmg-league-bot Goto Github PK
View Code? Open in Web Editor NEWNMG League evil mastermind
Home Page: https://nmg-league.foxlisk.com/
License: MIT License
NMG League evil mastermind
Home Page: https://nmg-league.foxlisk.com/
License: MIT License
/schedule_race takes a little while now, because it creates a bunch of posts and stuff. it would be a better UX to have a loading thing i think.
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.
seems like a good way to make grievance-submission private? idk if this is good or not
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.
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
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
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
probably doesn't matter but would save us an API request sometimes
Players should be able to manage the lifecycle of their races via bot:
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
right now every new reaction creates a sirius-inbox post if there's >=2 players signed up, which means if someone selects 10 emoji, we'll get 10 sirius-inbox posts :\
this would involve logging in with discord and then logging in with twitch to link the two
proper rtgg integration is also a possibility
eliminate every unwrap()
, expect()
, etc. panicking before launch is fine, e.g. on missing config values, but should have absolutely no crashes once running.
this ticket will include i think all the stuff to run "a season"
so we need
anything else?
if a scheduled race gets rescheduled, we should roll back some state about commentators, events, etc
e.g. users should be able to change restreams_ok and racetime_username
it fails to create messages with empty bodies and stuff
races, when scheduled, should do things like:
right now i'm just sticking tons of message IDs on BracketRaceInfo
s 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 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.
we probably want some ORM. the ones i see so far are:
e.g. if you are scheduling a race on december 30th for january 2nd, that will not work right now
im not going to implement autocomplete yet. but i will (hopefully!) track places where it might be useful, in here
admins should be able to do things like mark a player as forfeited, or update their time/vod URL if necessary
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:
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.
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
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.
Guild commands are available only within the guild specified on creation. Guild commands update instantly. We recommend you use guild commands for quick testing, and global commands when they're ready for public use.
https://discord.com/developers/docs/interactions/application-commands#registering-a-command
if races get in bad states the cron just prints out shit like Error fetching runs for race 7b7e3fa9-d515-44a4-9759-d562a106c7d1: Did not find exactly 2 runs
forever, which sucks
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.