11from discord import app_commands
22import asyncio
3- from config import os , bot , tree , logger ,discord , TOKEN
4- from tools import help , clear_slash ,start_Session ,Wait ,presentation_bot
3+ from config import os , bot , tree , logger , discord , TOKEN
4+ from tools import help , clear_slash , start_Session , Wait , presentation_bot
55import error_embed as embed
66import classement as ldb
77from admin_command import ban
@@ -23,28 +23,6 @@ async def on_ready():
2323# _______________________________________________________________________________________________________________________________
2424
2525
26- @tree .command (name = "ping" , description = "Répond avec Pong !" )
27- async def ping_slash (interaction : discord .Interaction ):
28- await interaction .response .send_message ("🏓 Pong !" )
29-
30- # _______________________________________________________________________________________________________________________________
31-
32-
33- @tree .command (name = "say" , description = "Répète ton message" )
34- @app_commands .describe (message = "Le message à répéter" )
35- async def say_slash (interaction : discord .Interaction , message : str ):
36- await interaction .response .send_message (f"💬 { message } " )
37-
38- # _______________________________________________________________________________________________________________________________
39-
40-
41- @tree .command (name = "salut" , description = "Salue quelqu’un" )
42- async def salut_slash (interaction : discord .Interaction ):
43- await interaction .response .send_message (f"👋 Salut { interaction .user .mention } !" )
44-
45- # _______________________________________________________________________________________________________________________________
46-
47-
4826@tree .command (name = "clear" , description = "Supprime des messages (admin uniquement)" )
4927@app_commands .describe (nombre = "Nombre de messages à supprimer" )
5028async def clearing_tool (interaction : discord .Interaction , nombre : int ):
@@ -85,6 +63,7 @@ async def submit(interaction: discord.Interaction, premier: str, deuxieme: str,
8563
8664# _______________________________________________________________________________________________________________________________
8765
66+
8867@tree .command (name = "pronos_qualif" , description = "Enregistre tes pronos ou modifie les si tu l'a déja fait par le passé(max 1 fois)" )
8968@app_commands .describe (premier = "Le premier" , deuxieme = "Le deuxième" , troisieme = "Le troisième" )
9069async def submit_qualif (interaction : discord .Interaction , premier : str , deuxieme : str , troisieme : str ):
@@ -112,34 +91,38 @@ async def submit_qualif(interaction: discord.Interaction, premier: str, deuxieme
11291
11392# _______________________________________________________________________________________________________________________________
11493
94+
11595@tree .command (name = "visualisation" , description = "Te montre tes pronos" )
116- async def visu (interaction : discord .Interaction ):
96+ async def visu (interaction : discord .Interaction ):
11797 await interaction .response .defer (ephemeral = True )
11898 await pr .visualisation (interaction )
11999# _______________________________________________________________________________________________________________________________
120100
101+
121102@tree .command (name = "leaderboard" , description = "Affiche le clasement des membres" )
122103async def leaderboard (interaction : discord .Interaction ):
123104 await interaction .response .defer ()
124105 embed = ldb .Leaderboard ()
125- await interaction .followup .send (content = None ,embed = embed )
106+ await interaction .followup .send (content = None , embed = embed )
126107 logger .info (f'{ interaction .user } à regarder le leaderbord' )
127-
108+
128109# _______________________________________________________________________________________________________________________________
129-
110+
111+
130112@tree .command (name = "admin_ban" , description = "AC-03" )
131- @app_commands .describe (member = "Membre à bannnir" , reason = "Raison du bannissement" , article = "Le ou les articles qu'il a enfreint" )
113+ @app_commands .describe (member = "Membre à bannnir" , reason = "Raison du bannissement" , article = "Le ou les articles qu'il a enfreint" )
132114async def bannissement (interaction : discord .Interaction , member : discord .Member , reason : str , article : str ):
133115 if interaction .user .guild_permissions .ban_members :
134116 await interaction .response .defer (ephemeral = True )
135117 await ban (interaction , member , reason , article )
136118 logger .info (f"{ interaction .user .name } à banni { member } " )
137-
119+
138120 else :
139121 await embed .chat_you_dont_have_perm (interaction )
140-
122+
141123# _______________________________________________________________________________________________________________________________
142-
124+
125+
143126@tree .command (name = "admin_open" , description = "Ouvre une session de pronostics pour un temp donné" )
144127@app_commands .describe (duration = "temps en heures" )
145128async def create (interaction : discord .Interaction , duration : float ):
@@ -160,9 +143,10 @@ async def create(interaction: discord.Interaction, duration: float):
160143 else :
161144 await interaction .response .defer (ephemeral = True )
162145 await interaction .followup .send (embed = await embed .permError (interaction ))
163-
146+
164147# _______________________________________________________________________________________________________________________________
165148
149+
166150@tree .command (name = "admin_close" , description = "Ferme la session de pronos" )
167151async def close (interaction : discord .Interaction ):
168152 await interaction .response .defer (ephemeral = True )
@@ -187,6 +171,7 @@ async def close(interaction: discord.Interaction):
187171
188172# _______________________________________________________________________________________________________________________________
189173
174+
190175@tree .command (name = "session" , description = "Configure manuellement la session des pronos récupère ses résultats, et update le leaderboard" )
191176@app_commands .describe (saison = "Année de la saison" , location = "Nom du Circuit" , type = "Type de l'événement(Q pour qualif, ou R pour course)" )
192177async def session (interaction : discord .Interaction , saison : int , location : str , type : str ):
@@ -211,15 +196,16 @@ async def session(interaction: discord.Interaction, saison: int, location: str,
211196 await interaction .followup .send ("Le Leaderboard est à jour" )
212197 else :
213198 await interaction .followup .send (embed = await embed .permError (interaction ))
214-
199+
215200# _______________________________________________________________________________________________________________________________
216201
202+
217203@tree .command (name = "admin_getresult" , description = "Mettre à jour l'api" )
218204async def maj_api (interaction : discord .Interaction ):
219205 interaction .response .defer ()
220206 if interaction .user .guild_permissions .administrator :
221207 await interaction .response .send_message ("⏳ Mise à jour en cours..." )
222-
208+
223209 try :
224210 result = f1api .getResults ()
225211
@@ -256,6 +242,7 @@ async def status(interaction: discord.Interaction):
256242
257243# _______________________________________________________________________________________________________________________________
258244
245+
259246@tree .command (name = "admin_stop" , description = "Stop le fonctionnement auto du bot" )
260247async def stop (interaction : discord .Interaction ):
261248 await interaction .response .defer (ephemeral = True )
@@ -310,6 +297,8 @@ async def auto_mod(interaction: discord.Interaction):
310297 ldb .saveResults ()
311298 if (os .path .exists ("data/Pronos.json" )):
312299 os .remove ("data/Pronos.json" )
300+
301+
313302@tree .command (name = "admin_launch" , description = "Lance le fonctionnement auto du bot" )
314303async def launch (interaction : discord .Interaction ):
315304 if interaction .user .guild_permissions .administrator :
@@ -320,9 +309,10 @@ async def launch(interaction: discord.Interaction):
320309 else :
321310 await interaction .response .defer (ephemeral = True )
322311 await interaction .followup .send (embed = await embed .permError (interaction ), ephemeral = True )
323-
312+
324313# _______________________________________________________________________________________________________________________________
325314
315+
326316@bot .event
327317async def on_message (message : discord .Message ):
328318 # Nos ID pour pouvoir etre les seuls à pouvoir lancer la commande
@@ -343,18 +333,20 @@ async def on_message(message: discord.Message):
343333 asyncio .sleep (5 )
344334 pass
345335 await message .delete ()
346-
336+
347337# _______________________________________________________________________________________________________________________________
348338
339+
349340@tree .command (name = "presentation" , description = "Laisse moi me présenter et aide moi à trouver mon nom !" )
350341async def presentation (interaction : discord .Interaction ):
351342 await interaction .response .defer (ephemeral = True )
352343 await interaction .followup .send (f"{ interaction .user .mention } , va voir tes MP !" , ephemeral = False )
353344 await presentation_bot (interaction )
354345 logger .info (f"{ interaction .user } a demandé la présentation du BOT" )
355-
346+
356347# _______________________________________________________________________________________________________________________________
357348
349+
358350@tree .command (name = "rules" , description = "Affiche le règlement d'usage du BOT" )
359351async def reglement (interaction : discord .Interaction ):
360352 await interaction .response .defer (ephemeral = True )
0 commit comments