Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

discord.py embed avatar command

So I’ve been trying to make a discord.py command that sends the mentioned users avatar in a embed.

this is what i have so far

@client.command()
async def v1_3(ctx, user: discord.User):
    avurl = user.avatar_url
    embed=discord.Embed(title=f"{user.name}", description=f"{avurl}", color=0xf20202)
    await ctx.send(embed=embed)

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

so what your doing is putting the url in the description field, what you wanna do is:

@client.command()
async def v1_3(ctx, user: discord.User):
        embed = discord.Embed(title=f'{user.name}' , color = 0xf20202)
        avurl = user.avatar_url
        e.set_image(url=f'{avurl}')
        await ctx.send(embed=embed)

this will send the embed with the users avatar

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading