Get member "in-server" nickname

How can i properly get the username of a member in a server? I tried to use <Message>.author.displayName under messageCreate callback but it returned the "global" username (in case of a specific member that didn't migrated to the new format yet, the user#0000 format). How can i safely fetch the user that was set to be use inside the guild?
4 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! - Marked as resolved by OP
Vico
VicoOP15mo ago
running under djs v14.13.0, just fyi
Squid
Squid15mo ago
<Message>.author is a global User instance, and <Message>.member is a server-specific GuildMember instance <Message>.member.displayName is probably what you're looking for
Vico
VicoOP15mo ago
okay, i will test here worked! thanks a lot
Want results from more Discord servers?
Add your server