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
- 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 OPrunning under djs v14.13.0, just fyi
<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 forokay, i will test here
worked!
thanks a lot