From a405fcd16de958f9bc277b199121ec48c4c7d684 Mon Sep 17 00:00:00 2001 From: GZod01 Date: Mon, 16 Dec 2024 13:35:18 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9liore=20la=20v=C3=A9rification=20du=20n?= =?UTF-8?q?om=20court=20dans=20la=20commande=20de=20cr=C3=A9ation=20de=20p?= =?UTF-8?q?ersonnage=20:=20ajoute=20une=20v=C3=A9rification=20de=20l'exist?= =?UTF-8?q?ence=20et=20corrige=20la=20requ=C3=AAte=20SQL.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perso_commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/perso_commands.py b/perso_commands.py index d33e08c..6f88abb 100644 --- a/perso_commands.py +++ b/perso_commands.py @@ -45,8 +45,8 @@ class PersoCommands(app_commands.Group): if " " in nom_court: await interaction.response.send_message("Le nom court ne doit pas contenir d'espaces",ephemeral=True) return - check_exist = await self.bot.db.execute("SELECT * FROM personnages WHERE nom_court=?",(nom_court)) - if await check_exist.fetchone() is not None: + check_exist = await self.bot.db.execute("SELECT * FROM personnages WHERE nom_court=?",nom_court) + if check_exist.rowcount>0 or await check_exist.fetchone() is not None: await interaction.response.send_message("Ce nom court est déjà utilisé",ephemeral=True) return histoire = story