CSSS / csss-site-backend

CSSS Website Backend (2024 - Present)
2 stars 0 forks source link

interface with CSSS-WEBSITE discord application #31

Open EarthenSky opened 3 days ago

EarthenSky commented 3 days ago

CSSS discord has several bots (called discord applications): Wall-e, eve, and csss-website. Wall-e is a whole project undergoing renovations, and with different goals than the website.

We'd like to query the csss discord server with things like "which people have which executive roles", or "who has access to which channels". We'll want to display this information to the dashboard so that executives can be notified if someone has permission that they shouldn't (ie. transitioned officer). Historically this was automated, however the execs / mods would prefer to have direct control. In addition, we'll want some api calls to modify permissions as well (a dashboard interface), but we should leave that for a future issue.

It looks like we can use discord's http api to get the info we're looking for.

Requirements:

If you're not sure what we're looking for specifically, please ask so we're all on the same page. If you have any questions please lmk!

EarthenSky commented 2 days ago

We need to stay beneath the rate limit of 50 requests per second (& 10k per 10 minutes), which should (hopefully) be pretty easy https://discord.com/developers/docs/topics/rate-limits#rate-limits

DerpyWasHere commented 1 day ago

Specifically, this is just asking for the api to return data right? Any specific format you want that back in? Otherwise I'll default to JSON.

micahdbak commented 1 day ago

^^^ yo good question, @EarthenSky are you asking for this to be an API or functions to be used internally by the server?

EarthenSky commented 23 hours ago

Specifically, this is just asking for the api to return data right? Any specific format you want that back in? Otherwise I'll default to JSON.

^^^ yo good question, @EarthenSky are you asking for this to be an API or functions to be used internally by the server?

Internal use only. I'm seeing this as a module with no endpoints, then we'll eventually write a /admin_dashboard_info endpoint (or something) that will use this module to get info or do stuff. We'll also want to use / extend this module for officer onboarding.

Seeing as this is a module, there should be functions which return python dicts & lists (essentially parsed json). Ex: def all_channels_in_category(category_name: str) -> list[str]

EarthenSky commented 23 hours ago

One possible issue I'm seeing is that I'm not 100% sure if we'll need the above functions (listed under requirements), as some other access pattern might work better. If you think that maybe there could be a better set of functions to access the data above (after you read into the discord API), please let us know & do so!