Get user's guild nickname

Osian

I have a discord bot that gets the nicknames of people, but nicknames do not seem to be exposed to me. The username is accessible however, the nickname is not:

client.on('interactionCreate', async interaction => {
var username = interaction.user.username; //accessible

I have also tried: interaction.member.displayName and looked at options under interaction.user however been unable to find something that allows me to get nicknames!

HippoBaguette

If you look at the documentation you can see that to get a nickname you just need interaction.member.nickname

Note:

  • Member may be null (for example if the interaction was not done in a guild, but in a DM)
  • .nickname can be undefined as the member may not have a nickname

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Discord.js how can i get user nickname using the user's id

Is it possible to get userid using user nickname?

How to get the user with guild.members.get()?

How to get username of user not in Discord guild?

How to get a user not sharing a guild with? Discordjs

Is there a way to get a user's ID from a mention without them being in the guild?

Edit a selected part of Discord guild nickname

How to get user id from nickname in discord.py?

Discord JS - Getting the nickname of a user who dm's the bot

Is there a way to get the guild's notification settings?

How to get Contact's Nickname Windows Phone 8.1

How to get the member's server nickname discord.py

Discord JS - How do you get the status of a user within a Guild?

How to get user avatar in specific guild from discord.py

JavaScript new Google Sign In - get user data: id, profile image and nickname

How to change someone's nickname when a user joins the server || Discord.py

How to get guild object using guild ID

Get a GuildMember's nickname and status type in Discord.js v12

How do i get the guild ID of a joined user/member (Discord.js)

how to add nickname calumn in user list wordpress?

Setting a unique user nickname in node express app

set nickname of fetched user discord js

(discord.py) How do I make it so that the bot automatically changes a specific user's nickname at a fixed time everyday?

nodejs discord get nickname from a users ID

Resetting GuildMember's Nickname | Discord.JS

Discord Bot Python - Changing Bot's nickname

Creating an invite and send it to an user that is not in your server/guild

How to add a role to a user in a specific guild

Discord.js: How to ban user that is not in the guild?