This commit is contained in:
GZod01 2024-12-15 15:04:42 +01:00
parent 15b9549bcb
commit bfac4eef96
2 changed files with 13 additions and 2 deletions

4
README.md Normal file
View file

@ -0,0 +1,4 @@
private_env.py:
```py
bot_token="YOUR_BOT_TOKEN"
```

View file

@ -27,5 +27,12 @@ class PersoCommands(app_commands.Group):
image_blob=await image.read() image_blob=await image.read()
print(nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,guild_id) print(nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,guild_id)
print(image.filename) print(image.filename)
await self.bot.db.execute("INSERT INTO personnages (nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,guild_id,image) VALUES (?,?,?,?,?,?,?,?,?)",(nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,guild_id,image_blob)) try:
res = await self.bot.db.execute("INSERT INTO personnages (nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,guild_id,image) VALUES (?,?,?,?,?,?,?,?,?)",(nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,guild_id,image_blob))
print(res)
await res.close()
except Exception as e:
print(e)
await interaction.response.send_message("Erreur lors de la création du personnage",ephemeral=True)
return
await interaction.response.send_message("Personnage créé",ephemeral=True)