Améliore la vérification du nom court dans la commande de création de personnage : ajoute une vérification de l'existence et corrige la requête SQL.
This commit is contained in:
parent
73cd00c872
commit
a405fcd16d
1 changed files with 2 additions and 2 deletions
|
@ -45,8 +45,8 @@ class PersoCommands(app_commands.Group):
|
||||||
if " " in nom_court:
|
if " " in nom_court:
|
||||||
await interaction.response.send_message("Le nom court ne doit pas contenir d'espaces",ephemeral=True)
|
await interaction.response.send_message("Le nom court ne doit pas contenir d'espaces",ephemeral=True)
|
||||||
return
|
return
|
||||||
check_exist = await self.bot.db.execute("SELECT * FROM personnages WHERE nom_court=?",(nom_court))
|
check_exist = await self.bot.db.execute("SELECT * FROM personnages WHERE nom_court=?",nom_court)
|
||||||
if await check_exist.fetchone() is not None:
|
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)
|
await interaction.response.send_message("Ce nom court est déjà utilisé",ephemeral=True)
|
||||||
return
|
return
|
||||||
histoire = story
|
histoire = story
|
||||||
|
|
Loading…
Reference in a new issue