T
T
Telmor2021-09-18 14:13:44
Python
Telmor, 2021-09-18 14:13:44

How to insert an image into an embed?

I have code:

@bot.command(aliases = ['магазин', 'SHOP', 'МАГАЗИН'])
async def shop(ctx):
    await ctx.channel.purge(limit = 1)
    with open('economy.json', 'r') as f:
        money = json.load(f)
    for role in money['shop']:
        msg = await ctx.send(
                embed=discord.Embed(title='Магазин',timestamp=ctx.message.created_at, description=f'**Роль:** <@&{role}> \n **Цена:** {money["shop"][role]["Cost"]}'),
                components=[
                    Button(style=ButtonStyle.red, label='Удалить', emoji='⛔')
                ])
        responce = await bot.wait_for('button_click', check=lambda message: message.author == ctx.author)
        if responce.component.label == 'Удалить':
            await msg.delete()

how can I put the set_thumbnail argument or something similar in it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
x4zx, 2021-09-18
@Telmor

There are two ways to pin an image for Embed:

emb.set_thumbnail - изображение будет в правом верхнем углу
и
emb.set_image - изображение будет большим под самим Embed

N
Nikita Mokhovikov, 2021-09-18
@mohovoy

If you want through set_thumbnail , then there is a site for generating Embed Discord

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question