can't get avatar per server with user.ID

Hi guys, so there is my problem, I have an avatar command that displays avatar per server & default avatar, this actually works very good but only without any mentions.

When I try to mention someone by ID or @ instead of showing me their avatar per server it shows MY avatar, but the default button works fine.

I get avatar per user via message.member.displayAvatarURL and default avatar via user.displayAvatarURL

I know what's the problem but I don't really know how to fix it, the principal problem is that message.member.displayAvatarURL doesn't get the ID that I mention in a message, while message.member.displayAvatarURL does, for example:
//this is console.log();

-------------------------------
 message.mentions.users.first:  923090610028683265

 usuario:  923090610028683265

 member.user:  700076432076046396, TRKako#0833 //this is the thing that is wrong, this should be 923090610028683265(mentioned ID) instead of 700076432076046396(my ID)

 user:  923090610028683265, TRKbot V13 test#8659

 message.mentions.members.first:  923090610028683265
-------------------------------
image.png
image.png
Was this page helpful?