How do you get a discord users profile picture by ID?

Question:

Let’s just say a user is not in the same server as the bot but you have the user’s user id how can i get the users profile picture like that?

Asked By: Wolf

||

Answers:

async def fake(self, ctx, user_id):
    user = await self.bot.fetch_user(user_id)
    print(user)
    await ctx.send(user.avatar.url)

fetch makes an api call

Answered By: Flow
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.