Getting User Guild Avatar/Banner

Hi I'd like to know how can i get the user's avatar and banner in the current guild Currently I get the user info from
let currentUser =
message.mentions.users.size > 0
|| message.mentions.users.first()
let currentUser =
message.mentions.users.size > 0
|| message.mentions.users.first()
5 Replies
d.js toolkit
d.js toolkit15mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
adam
adamOP15mo ago
Latest discord.js version
d.js docs
d.js docs15mo ago
Despite sounding similar there is a distinct difference between users and members in Discord: • User: global Discord user data (global avatar, username, tag, id) • GuildMember: user data associated to a guild (guild, nickname, roles, voice, guild avatar, etc.) • Conversion: User ➞ GuildMember | GuildMember ➞ User
Syjalo
Syjalo15mo ago
Your code make no sense. Your currentUser will be either true or undefined
adam
adamOP15mo ago
oh yeah sorry let currentUser = message.mentions.users.first() how can i get the guild icon for the user? I got that part over with, now I'm trying to get the banner whats the method for the GuildMember bannerURL ? nah, i dont think there is a guildmember banner yet ?? alrightt thanks a lott!! for anyones reference later on:
let currentUser =
message.mentions.users.first()

let t = await currentGuild.members.fetch(currentUser.id)
console.log(t.avatarURL({ size: 1024 }))
let currentUser =
message.mentions.users.first()

let t = await currentGuild.members.fetch(currentUser.id)
console.log(t.avatarURL({ size: 1024 }))
Want results from more Discord servers?
Add your server