Ajoute des vérifications pour le nom court dans la commande de création de personnage : empêche les espaces et les doublons.
This commit is contained in:
parent
5ca76937f9
commit
73cd00c872
1 changed files with 7 additions and 0 deletions
|
@ -42,6 +42,13 @@ class PersoCommands(app_commands.Group):
|
||||||
if image.content_type!="image/png" and image.content_type!="image/jpeg":
|
if image.content_type!="image/png" and image.content_type!="image/jpeg":
|
||||||
await interaction.response.send_message("L'image doit être un fichier PNG ou JPEG",ephemeral=True)
|
await interaction.response.send_message("L'image doit être un fichier PNG ou JPEG",ephemeral=True)
|
||||||
return
|
return
|
||||||
|
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:
|
||||||
|
await interaction.response.send_message("Ce nom court est déjà utilisé",ephemeral=True)
|
||||||
|
return
|
||||||
histoire = story
|
histoire = story
|
||||||
pouvoirs = powers
|
pouvoirs = powers
|
||||||
uuid=interaction.user.id
|
uuid=interaction.user.id
|
||||||
|
|
Loading…
Reference in a new issue