Reputation: 119
Is it possible to set the embed image as the bot's profile picture?
If user's:
embed=discord.Embed(title="This is my profile pick")
embed.set_author(name="name", icon_url=ctx.author.avatar.url)
so if I wanted to set thumbnail or image as bot's avatar, what would would I do?
I tried:
embed.set_author(name=bot.name, icon_url=bot.avatar.url)
but it does not work. How can I this?
Upvotes: 0
Views: 4425
Reputation: 1
There're 2 ways, first you could just do it manually like
embed.set_image(url='bot avatar url')
but i really dont recommend this way since its not dynamic and it won't work if you ever change the avatar of bot in future so, try this code this will work
@bot.command()
async def botavatar(ctx):
BotAvatar = bot.user.avatar_url
embed = discord.Embed(
title=f'{bot.user.name}\'s Avatar:',
color=discord.Colour.red())
embed.set_image(url=f'{BotAvatar}')
await ctx.send(embed=embed)
Upvotes: 0
Reputation: 1439
You need to access the user
attribute on your bot first.
embed.set_author(name="name", icon_url=bot.user.avatar.url)
Or
embed.set_author(name="name", icon_url=bot.user.avatar_url)
Depending on your discord.py version.
Upvotes: 2
Reputation: 46
^ ^ ^ After add thumbnail
for thumbnail add this embed.set_thumbnail(url=ctx.author.avatar_url)
Upvotes: 0