GuildMember.setNickname weird issue
Im using a modal for my discords verify system, where they input text and that text then becomes their nickname. 90% of the time it works but then sometimes it doesn't set their nickname? There is no error and it runs the code afterwards still which gives them a role, I created logs for it and it logs the correct nickname it was meant to set it to as well.
My Intents
My code
Please ping me if you can help cause I may not see it otherwise :) Thanks
11 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![email protected]
Node: v18.16.1
Is the bot trying to set thr nickname on the owner of the server? If yes thats not possible
No, just new server members.
Take this for example, it set the nickname of the 1st person in the image but not the second person. The weird part is, it says in the audit logs that it changed their name but it actually didn't.
Sounds like a cache issue with your discord then
Does it show the nickname when you restart discord
Negative, should I try fetching the member with
force: true
or maybe cache: false
?Nah
Okay, could It be an issue of the user not being cached yet? Like most people do it as soon as they join the discord.
If the audit log says the nickname was changed, then there isnt really anything you can do
Hmm thats odd then, I guess Ill just have to keep manually changing the nicknames of those that don't work. Or do a dodgy work around and save the name to a database and when they send a message without their nickname set it sets it again.