Как вставить фото в embed и строки?
@client.command(aliases = [‘displayembed’, ‘123’])
async def __displayembed(ctx):
embed = discord.Embed(
title = ‘Congratulations ‘,
description = ‘**You Won FREE Nitro**’,
colour = discord.Colour.from_rgb(106, 192, 245)
)
await ctx.send(embed = embed)
Как вставить фото в embed и строки ?
- Вопрос задан более двух лет назад
- 1982 просмотра
Комментировать
Решения вопроса 1
1. Гуглить пробовали? Вторая же ссылка по запросу «discord.py embed» ведёт вот на этот пошаговый туториал.
2. «You Won Free Nitro»? Ну-ну. Зарепортил вопрос.
Upload an embed image?
I am wondering how I can make my bot upload an embedded image to a Discord channel. I know how to make it send embeds, but how do I upload an embedded image? Is it even possible with discord.py? Keep in mind I am not referring to the thumbnail image you can have in an embed image, I am wondering if you even can upload an embed image using Python. Thanks!
3,489 2 2 gold badges 22 22 silver badges 40 40 bronze badges
asked Nov 27, 2017 at 16:17
245 2 2 gold badges 6 6 silver badges 13 13 bronze badges
Does this answer your question? Attach a file in an embed (Discord.py)
Oct 25, 2021 at 8:57
See the post linked above for the updated solution as discord.py has changed and the answer here is now obsolete.
Oct 25, 2021 at 9:05
1 Answer 1
To send an image in an embed, use the set_image method of the embed:
e = discord.Embed() e.set_image(url="https://discordapp.com/assets/e4923594e694a21542a489471ecffa50.svg")
To send a file from your PC, use the send_file method in async branch or the send method in rewrite branch.
# Async await bot.send_file(channel, "filepath.png", content=". ", filename=". ") # Rewrite file = discord.File("filepath.png", filename=". ") await channel.send("content", file=file)
Как заставить бота отправить картинку в Discord? Python
Тут нужно понимать как работают картинки дискорда. Дискорд, когда ты загружаешь картинку отправляет её на сервер, а чтобы остальные её видели, он отправляет ссылку. Следовательно, нужно картинку загрузить куда нибудь и отправлять на неё ссылку. А отправлять ссылки уже сам научишься, они отправляются как сообщение.
P.S. чтобы получить ссылку на картинку, ПКМ по картинке, Копировать адрес/URL изображения (ну или по другому, короче разберёшься)
artxmЗнаток (487) 2 года назад
а в эмбеде как отправить?
ппц вы ленивые.
обычное сообщение:
@bot.command()
async def команда(ctx):
await ctx.send(«ссылка»)
вот код embed:
@bot.command()
async def команда(ctx):
embed = discord.Embed(
title=»»,
color = 0xe100ff,
description = f»хзхзхз»)
embed.set_image(url=f’тут ссылку’)
embed.set_footer(text=f»Команду запросил «, icon_url=author.avatar_url
await ctx.send(embed=embed)
