Paul Weinmann
Paul Weinmann

Reputation: 23

Discord.py get my actual avatar url and name

Im am right now creating an info command for my discord bot and want to make a footer in an embed with the developers/my name and avatar. But now if I add my name and avatar url to the field then when I change name or avatar the informations in the footer will still stay the same.

Is there something I can use, to get my own avatr url and name just like I get the ctx.author.avatar_url and ctx.author?

Or is threre something like bot.owner?

This is my code:

user_me = ?

em = discord.Embed()
em.set_footer(icon_url=user_me.avatar_url, text=user_me)

Upvotes: 0

Views: 1185

Answers (1)

Aditya Tomar
Aditya Tomar

Reputation: 1639

You need to use your id, and from that you can create a user object.

user = await bot.fetch_user(<your_id>)
em = discord.Embed()
em.set_footer(icon_url=user.avatar_url, text=user.name)

Upvotes: 1

Related Questions