Interaction

How am I able to fetch the display name of a user in the interaction guild? I tried interaction.member.guild.name but it is returning the guild name only.
.setAuthor({name: `${interaction.member.guild.username}`, iconURL: interaction.user.displayAvatarURL()})
.setAuthor({name: `${interaction.member.guild.username}`, iconURL: interaction.user.displayAvatarURL()})
10 Replies
d.js toolkit
d.js toolkit10mo 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! - Marked as resolved by staff
d.js docs
d.js docs10mo ago
:property: GuildMember#displayName @14.15.2 The nickname of this member, or their user display name if they don't have one
sanj
sanjOP10mo ago
do i access this with interaction.member.displayName?
duck
duck10mo ago
yes
sanj
sanjOP10mo ago
it only returns my actual displayname, i want the guilds displayname in case i used a verification bot do I use interaction.guild.displayName in that instance
monbrey
monbrey10mo ago
I dont understand what you're asking interaction.member is the GuildMember instance of that person in that guild
sanj
sanjOP10mo ago
the displayName on the guild, not the user's displayName, i.e
No description
sanj
sanjOP10mo ago
server nickname *
monbrey
monbrey10mo ago
There is only displayName, which will be their nickname if they have one, or their global display name if they have one, or their username Yeah, so its what duck said Or interaction.member.nickname which will be their nickname, or null, no fallbacks
sanj
sanjOP10mo ago
Thank you all

Did you find this page helpful?