Trouble with user's nicknames and usernames

Hey hey! I’m making a Roblox verification bot and I’m trying to fix an error where if their Roblox username is the exact same as their discord username it can’t update their roles. I’m trying to get their username or their nickname depending on which one is set. Here is my code

   var user = message.mentions.members.first();
   var nick = user.nickname || user.
   console.log(nick)

what is user. ? Do you mean to have a period at the end?

Try this:

   var user = message.mentions.members.first();
   var nick = user.nickname || user
   console.log(nick)

Hi all apologies for the late reply. I got this by using a string split. I split this at the # and filtered only the 1st part. Thanks to all who tried to help. :smile: