This commit is contained in:
Emmy D'Anello 2025-03-15 10:31:28 +01:00
parent 61f8215a4a
commit fa8a5da027
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85

10
bot.py
View File

@ -119,7 +119,7 @@ async def carte(ctx: commands.Context):
await ctx.send(message, file=discord.File(f, filename="battle4suisse.png"))
@bot.command(brief=f"Capture un canton pour son équipe : {prefix}capturer CODE_CANTON [EQUIPE]")
@bot.command(brief=f"Capture un canton pour son équipe : {PREFIX}capturer CODE_CANTON [EQUIPE]")
async def capturer(ctx: commands.Context, canton: CodeCanton, *, couleur: Couleur | None = None):
if couleur is None:
author_id = ctx.author.id
@ -143,7 +143,7 @@ async def capture_error(ctx, error):
await ctx.send(str(error))
@bot.command(brief=f"Verrouille un canton sur la carte pour son équipe : {prefix}verrouiller CODE_CANTON [EQUIPE]")
@bot.command(brief=f"Verrouille un canton sur la carte pour son équipe : {PREFIX}verrouiller CODE_CANTON [EQUIPE]")
async def verrouiller(ctx: commands.Context, canton: CodeCanton, *, couleur: Couleur | None = None):
if couleur is None:
author_id = ctx.author.id
@ -161,7 +161,7 @@ async def verrouiller(ctx: commands.Context, canton: CodeCanton, *, couleur: Cou
return await carte(ctx)
@bot.command(brief=f"Réinitialise l'état de capture d'un canton : {prefix}reset CODE_CANTON")
@bot.command(brief=f"Réinitialise l'état de capture d'un canton : {PREFIX}reset CODE_CANTON")
async def reset(ctx: commands.Context, canton: CodeCanton):
data['cantons'][canton]['capture'] = None
data['cantons'][canton]['verrouille'] = False
@ -171,7 +171,7 @@ async def reset(ctx: commands.Context, canton: CodeCanton):
return await carte(ctx)
@bot.command(brief=f"Rejoindre une équipe : {prefix}equipe EQUIPE")
@bot.command(brief=f"Rejoindre une équipe : {PREFIX}equipe EQUIPE")
async def equipe(ctx: commands.Context, couleur: Couleur):
author_id = ctx.author.id
for membres_equipe in data['equipes'].values():
@ -183,7 +183,7 @@ async def equipe(ctx: commands.Context, couleur: Couleur):
await ctx.send(f"Équipe {couleur} rejointe")
@bot.command(brief=f"Affiche la liste des noms des défis : {prefix}defis [capture | vol]")
@bot.command(brief=f"Affiche la liste des noms des défis : {PREFIX}defis [capture | vol]")
async def defis(ctx: commands.Context, *, type_defi: Literal['capture', 'vol'] = "capture"):
await ctx.send(f"Liste des défis de {type_defi} :\n" + "\n".join(f"* {defi['id']} : {defi['nom']}" for defi in DEFIS[type_defi]))