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:
parent
9eb30bb00c
commit
1837078c73
2 changed files with 10 additions and 10 deletions
Binary file not shown.
|
@ -7,15 +7,15 @@ import io
|
||||||
|
|
||||||
|
|
||||||
_sql_table="""CREATE TABLE personnages (
|
_sql_table="""CREATE TABLE personnages (
|
||||||
nom_court varchar(255),
|
nom_court varchar(255),
|
||||||
nom_complet text,
|
nom_complet text,
|
||||||
image text,
|
image text,
|
||||||
histoire text,
|
histoire text,
|
||||||
pouvoirs text,
|
pouvoirs text,
|
||||||
uuid TEXT,
|
uuid TEXT,
|
||||||
age INTEGER,
|
age INTEGER,
|
||||||
sexe TEXT,
|
sexe TEXT,
|
||||||
guild_id INTEGER NULL
|
guild_id INTEGER NULL
|
||||||
)"""
|
)"""
|
||||||
|
|
||||||
async def setup(bot:GammaRPBot):
|
async def setup(bot:GammaRPBot):
|
||||||
|
@ -81,7 +81,7 @@ class PersoCommands(app_commands.Group):
|
||||||
embed = await perso_embed(self.bot,row)
|
embed = await perso_embed(self.bot,row)
|
||||||
await interaction.response.send_message(f"Affichage de {row["nom_complet"]}({row["nom_court"]})",embed=embed)
|
await interaction.response.send_message(f"Affichage de {row["nom_complet"]}({row["nom_court"]})",embed=embed)
|
||||||
@show_character.autocomplete(name="short_name")
|
@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))
|
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()
|
rows = await res.fetchall()
|
||||||
await res.close()
|
await res.close()
|
||||||
|
|
Loading…
Reference in a new issue