How do I add user's avatar in embed title? discord.py

Xiao Poor

Here is my code example.

@client.command()
async def test(ctx):
  test = discord.Embed(
        title=f"{ctx.author.avatar_url}",
        #skip
    )

    await ctx.send(embed=test)

I am trying to make it like this, but it's not working.

loloToster

Instead of title attribute set author attribute using set_author() method. Like this:

@client.command()
async def test(ctx):
    test = discord.Embed()
    test.set_author(name="title", icon_url=ctx.author.avatar_url)
    await ctx.send(embed=test)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to get a user's avatar with their id in discord.py?

User's avatar discord.py 2.0

discord.py :: How do I make on_message_delete ignore a certain user / role via an embed?

How can I add multiple hyperlinks into a discord.py Embed?

How do I put a member's image and nick on embed? (w/ discord.py)

How do I put discord.py help command in an embed?

discord.py embed avatar command

How to add buttons to an embed in discord.py

How do I mention a user with the blue highlight in Discord Embed?

Discord.json How can I resize avatar in an embed?

Discord.py: How do I add an image in my discord bot's rich presence?

discord.py - Cannot get average colour of a user's avatar

Get user's avatar with their ID in discord.py

Discord.py I want a avatar command for discord.py and if I don't mention a member, the bot should post my own avatar. How can i do that?

Discord.JS embed: User avatar in footer

how do i mention a user using user's id in discord.py

How to get user avatar in specific guild from discord.py

How do I get someone's user through a mention with discord.py

How do i add a reaction to a certain person's message in discord.py?

How do assign a user's message to a variable in discord.py?

How do I take in user input in discord.py

How do I get the ID of an user in Discord.py

Discord.py: How do I get a user from a UserID?

How do I check if a user has a role in discord.py?

discord.py Check content of embed title

How do i add a cooldown or a ratelimit to this event? discord.py

How do I fix not being able to have 2 embed commands discord bot PY

How do I make an embed in discord?

How can i add Aliases to This discord bot command and how can i embed the bot's response?