diff --git a/perso_commands.py b/perso_commands.py index 861859e..6077c31 100644 --- a/perso_commands.py +++ b/perso_commands.py @@ -3,6 +3,7 @@ import discord from GammaRPBot_Define import GammaRPBot import aiosqlite import base64 +import io _sql_table="""CREATE TABLE personnages ( @@ -82,7 +83,7 @@ async def perso_embed(bot:GammaRPBot,perso_datas)->discord.embeds.Embed: perso_image = perso_datas["image"] #data:image/png;base64,xxxxxx perso_image_b64=perso_image.split(",")[1] perso_image_raw = base64.b64decode(perso_image_b64) - perso_image_file = discord.File(perso_image_raw) + perso_image_file = discord.File(io.BytesIO(perso_image_raw)) a = await bot.get_guild(1037663859621765160).get_channel(1317876780635394068).send(file=perso_image_file) print(a.attachments) perso_image_url = a.attachments[0].url