File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,10 +182,13 @@ async def handover(
182182 await new_pres .add_roles (role_pres , reason = f"Passation du club : { club .name } " )
183183 await new_treso .add_roles (role_treso , reason = f"Passation du club : { club .name } " )
184184 category = utils .get (guild .categories , id = club .category_id )
185- if category .name == club .name + " [inactif]" :
186- await category .edit (position = 4 , name = club .name )
187-
188- await category .edit (position = 4 )
185+ if category .name .endswith ("[inactif]" ):
186+ await category .edit (name = club .name )
187+ highest_inactive = utils .find (
188+ lambda c : c .name .endswith ("[inactif]" ),
189+ sorted (guild .categories , key = lambda c : c .position ),
190+ )
191+ await category .move (above = highest_inactive )
189192 # why 4 ? because in our server we have 3 prime categories
190193
191194 async def stop_club (self , club : DiscordClub , guild : Guild ):
You can’t perform that action at this time.
0 commit comments