python-discord / sir-robin

Our event bot, for managing community events.
MIT License
18 stars 14 forks source link

Integrate Code Jam Management into Sir Robin's CJ Extension #49

Closed D0rs4n closed 2 years ago

D0rs4n commented 2 years ago

Okay, so Code Jam Management has been integrated into Sir Robin's CJ extension..but What changed?

First and foremost.. Roles!

I have added back team roles, and have updated the flows (later on those) accordingly!

Flows:

Creation flow:

So, cj create behaves a tiny bit differently. From now on, when you issue the command with a csv, you'll be sent a prompt to confirm, whether we actually want all that.. 😎 , you'll see how many channels, and roles will be created. Upon confirmation the roles and channel will be created, and another prompt will pop up. That's a new thing, you can announce the teams just by clicking Announce Teams. That'll send a message with a view(discord.ui.View) attached, to announcements pinging the participants. The view is a persistent(!!) view, hence it'll work across bot restarts. But what does that view do? It'll query the newly added Code Jam Management system, and send an ephemeral message to the user with all the details regarding their teams. Members, and the team channels will be pinged, for easy use, so no need to browse images in announcements hoping to find your team. (Just kidding I had no problems with it during the last two years)

Delete flow:

That's implemented the same way, except the channel and roles ids are queried from the CJMGMT (that's how I'm going to refer to Code Jam Management from now on). The confirmation prompt uses discord views from now on, the list of channels and roles scheduled to be deleted will still be uploaded to pydis paste and attached as footer to the confirmation view.

Commands:

Note: Test helpers, and _autospec have been ported from bot, that might make a diff a bit bigger, but it was necessary. Also if you want to change on any of the texts, I'm open to suggestions, since those are official announcements after all. :)

if you have questions on how to set it up, don't hesitate to ping me or DM me on Discord. (Necessary env vars, will update docs on that(?), if needed.:

)

D0rs4n commented 2 years ago

move and remove commands need confirmation step.

Done in 37a023a

D0rs4n commented 2 years ago

If anyone would like to give suggestions regarding the wording, please do. I can easily change them, the core part is done, so now the wording the "priority".

D0rs4n commented 2 years ago

Since you asked for one, I've gone through and reviewed all the language in this PR. It all looks great to me, I have no objections.. and I'm pretty anal when it comes to language.

I think this seems ready to merge, once the linter is appeased. Looks like there's some trailing whitespace to sort out.

Shouldn't have happened, I pushed a patch, the linter should work.