From 1ef1071a8cbfd32a8c5541ed1a4a4a6aa74fce6d Mon Sep 17 00:00:00 2001 From: Steele Farnsworth Date: Sat, 18 Jan 2025 15:12:47 -0500 Subject: [PATCH 1/2] Remove april fools 2024 role IDs (the roles have been deleted) --- bot/constants.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bot/constants.py b/bot/constants.py index 1ee4cb8..2f259f5 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -187,10 +187,6 @@ class _Roles(EnvConfig, env_prefix="ROLE_"): bots: int = 277546923144249364 moderation_team: int = 267629731250176001 - team_list: int = 1222691191582097418 - team_dict: int = 1222691368653033652 - team_tuple: int = 1222691399246286888 - Roles = _Roles() From d08079d47d1b147b001605fadeaff4c4f67dc3a7 Mon Sep 17 00:00:00 2001 From: Steele Farnsworth Date: Sat, 18 Jan 2025 15:21:09 -0500 Subject: [PATCH 2/2] Automatically unassign permanent code jam roles with codejam end command.\n\nAlso adds the code jam team lead role to constants --- bot/constants.py | 1 + bot/exts/code_jams/_cog.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bot/constants.py b/bot/constants.py index 2f259f5..cb99720 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -181,6 +181,7 @@ class _Roles(EnvConfig, env_prefix="ROLE_"): event_runner: int = 940911658799333408 summer_aoc: int = 988801794668908655 code_jam_participants: int = 991678713093705781 + code_jam_team_leads: int = 1262472493755797594 code_jam_support: int = 1254657197535920141 helpers: int = 267630620367257601 aoc_completionist: int = 1191547731873894440 diff --git a/bot/exts/code_jams/_cog.py b/bot/exts/code_jams/_cog.py index d9644ad..a08f0c9 100644 --- a/bot/exts/code_jams/_cog.py +++ b/bot/exts/code_jams/_cog.py @@ -96,7 +96,7 @@ async def announce(self, ctx: commands.Context) -> None: @commands.has_any_role(Roles.admins, Roles.events_lead) async def end(self, ctx: commands.Context) -> None: """ - Delete all code jam channels. + Delete all code jam channels and team-specific roles. A confirmation message is displayed with the categories and channels that are going to be deleted, by pressing "Confirm" the deletion @@ -142,6 +142,13 @@ async def end(self, ctx: commands.Context) -> None: view=confirm_view ) await confirm_view.wait() + + # Unassign the code jam participant and team lead roles, without deleting the roles themselves + for permanent_role_id in (Roles.code_jam_team_leads, Roles.code_jam_participants): + permanent_role = await ctx.guild.get_role(permanent_role_id) + for user in permanent_role.members: + await user.remove_roles(permanent_role) + await ctx.send("Code Jam has officially ended! :sunrise:") @codejam.command()