File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,3 +47,26 @@ async def club_infos(
4747 ):
4848 await interaction .response .defer (thinking = True )
4949 await interaction .followup .send (embed = self .club_service .embed (club ))
50+
51+ @app_commands .command (name = "add_member" )
52+ @app_commands .autocomplete (club = autocomplete_club )
53+ async def add_club_member (
54+ self ,
55+ interaction : Interaction ,
56+ club : int ,
57+ member : Member ,
58+ ):
59+ await interaction .response .defer (thinking = True )
60+ club = next (
61+ (c for _id , c in self .settings .guild .clubs .items () if _id == club ), None
62+ )
63+ if not club :
64+ await interaction .followup .send ("Ce club n'a pas été trouvé" )
65+ return
66+ if not interaction .user .get_role (club .president_role_id ):
67+ await interaction .followup .send (
68+ "Seul le président du club peut utiliser cette commande"
69+ )
70+ return
71+ await member .add_roles (interaction .guild .get_role (club .member_role_id ))
72+ await interaction .followup .send ("Rôle attribué :thumbs_up:" )
You can’t perform that action at this time.
0 commit comments