From cd7112a57983b0213acc30b8bfe787f4220cc6ff Mon Sep 17 00:00:00 2001 From: GZod01 Date: Mon, 16 Dec 2024 13:40:56 +0100 Subject: [PATCH] a --- perso_commands.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/perso_commands.py b/perso_commands.py index e715e0d..50707e5 100644 --- a/perso_commands.py +++ b/perso_commands.py @@ -94,8 +94,18 @@ class PersoCommands(app_commands.Group): rows = await res.fetchall() await res.close() return [app_commands.OptionChoice(name=row["nom_court"],value=row["nom_court"]) for row in rows] - @app_commands.command(name="lister",description="Liste tous les personnages") - async def list_characters(self,interaction:discord.Interaction,output_hidden:bool=False): + @app_commands.command(name="lister",description="Liste les personnages sur le serveur") + async def list_characters(self,interaction:discord.Interaction,output_hidden:bool=True): + res = await self.bot.db.execute("SELECT * FROM personnages WHERE guild_id=? OR guild_id IS NULL",(interaction.guild.id,)) + rows = await res.fetchall() + await res.close() + embeds = [] + for row in rows: + embeds.append(await perso_embed(self.bot,row)) + await interaction.response.send_message("Liste des personnages",embeds=embeds,ephemeral=output_hidden) + + @app_commands.command(name="lister_tout",description="Liste tous les personnages") + async def list_characters(self,interaction:discord.Interaction,output_hidden:bool=True): #admin if interaction.user.id !=super_owner_id: await interaction.response.send_message("Vous n'avez pas la permission d'exécuter cette commande",ephemeral=True)