From ea1ab953c767eef39b3f028307128baa7f853d71 Mon Sep 17 00:00:00 2001 From: GZod01 Date: Wed, 18 Dec 2024 09:19:19 +0100 Subject: [PATCH] araeporkaeropk --- main-bot.py | 21 +++++++++++---------- main.db | Bin 8192 -> 8192 bytes money_commands.py | 21 +++++++++++---------- perso_commands.py | 41 ++++++++++++++++++++++------------------- 4 files changed, 44 insertions(+), 39 deletions(-) diff --git a/main-bot.py b/main-bot.py index d9bebde..f373a35 100644 --- a/main-bot.py +++ b/main-bot.py @@ -16,16 +16,17 @@ logger = logging.getLogger() # _sql_table="""CREATE TABLE personnages ( -# nom_court varchar(255), -# nom_complet text, -# image text, -# histoire text, -# pouvoirs text, -# uuid TEXT, -# age INTEGER, -# sexe TEXT, -# money INTEGER DEFAULT 50, -# 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, +# money INTEGER DEFAULT 50, +# universe TEXT # )""" intents = discord.Intents.all() diff --git a/main.db b/main.db index 2b515835a6889ec41ee956b2d1fd09d1c907b121..ef664574924fd0090a04ece710b9d7136c737240 100644 GIT binary patch delta 83 zcmZp0XmFSyEy%^dz`z8=Fu*)f$C#gsK~E=u7bwKY_l<$?+s48UKCUKqMs{&!Wya>v e$^85u_;nOY^D@g)i;7bfLR=$4Hvi{m6aWBQlM+Gz delta 67 zcmZp0XmFSyEy&5hz`z8=Fu*iX$C#g!K~E=u7bwKY&&t5hx>-0 or await check_exist.fetchone() is not None: await interaction.response.send_message("Ce nom court est déjà utilisé",ephemeral=True) return histoire = story pouvoirs = powers - uuid=interaction.user.id - guild_id = interaction.guild.id + uuid=interaction.user.id if user_global_character else None + guild_id = interaction.guild.id if global_character else None image_blob_raw=await image.read() a = await self.bot.get_guild(1037663859621765160).get_channel(1317876780635394068).send(file=discord.File(io.BytesIO(image_blob_raw),filename=image.filename)) perso_image_url = a.attachments[0].url @@ -61,10 +67,7 @@ class PersoCommands(app_commands.Group): print(image.url) try: res=None - if global_character: - res = await self.bot.db.execute("INSERT INTO personnages (nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,image) VALUES (?,?,?,?,?,?,?,?)",(nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,perso_image_url)) - else: - res=await self.bot.db.execute("INSERT INTO personnages (nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,image,guild_id) VALUES (?,?,?,?,?,?,?,?,?)",(nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,perso_image_url,guild_id)) + res = await self.bot.db.execute("INSERT INTO personnages (nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,image,universe,guild_id) VALUES (?,?,?,?,?,?,?,?)",(nom_court,nom_complet,histoire,pouvoirs,age,sexe,uuid,perso_image_url,universe_code,guild_id)) print(res) await res.close() await self.bot.db.commit()