Corrige l'indentation dans la création de la table personnages et ajuste la fonction d'autocomplétion pour inclure le paramètre 'current'.

This commit is contained in:
GZod01 2024-12-16 13:18:54 +01:00
parent 9eb30bb00c
commit 1837078c73
2 changed files with 10 additions and 10 deletions

View file

@ -7,15 +7,15 @@ import io
_sql_table="""CREATE TABLE personnages (
nom_court varchar(255),
nom_complet text,
image text,
histoire text,
pouvoirs text,
uuid TEXT,
age INTEGER,
sexe TEXT,
guild_id INTEGER NULL
nom_court varchar(255),
nom_complet text,
image text,
histoire text,
pouvoirs text,
uuid TEXT,
age INTEGER,
sexe TEXT,
guild_id INTEGER NULL
)"""
async def setup(bot:GammaRPBot):
@ -81,7 +81,7 @@ class PersoCommands(app_commands.Group):
embed = await perso_embed(self.bot,row)
await interaction.response.send_message(f"Affichage de {row["nom_complet"]}({row["nom_court"]})",embed=embed)
@show_character.autocomplete(name="short_name")
async def autocomplete_short_name(self,interaction:discord.Interaction):
async def autocomplete_short_name(self,interaction:discord.Interaction,current:str):
res = await self.bot.db.execute("SELECT nom_court FROM personnages WHERE uuid=? AND (guild_id=? OR guild_id IS NULL)",(interaction.user.id,interaction.guild.id))
rows = await res.fetchall()
await res.close()