Wrong docs..?
Hey, can someone please explain this as I've spent 2+ hours on it lol.
Basically on the docs it says to use
const user = interaction.options.getUser('target');
guild.members.unban(user);
When it's completely wrong.
To ban via discordID you should use
const target = interaction.options.getUser('target');
await interaction.guild.bans.remove(target);
Kinda stupid if the only thing that can solve this is AI...5 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 staffthey're both valid
the errors you were showing in #djs-help-v14 were unrelated to these methods
Okay um I'm very retarded...
So basically I was doing guild.members.unban(target); - Without awat interaction.guild.members.unban(target);
Is that the cause of it? Also my variables
Sorry I just didn't understand anything and my brain went blank in that moment...
I mean it's good to actually handle your promises, but that wouldn't be the cause of https://discord.com/channels/222078108977594368/824411059443204127/1153406796657086594
that error is only caused by calling
getUser
on an option other than a user/mentionable option
this is why qjuh asked whether you redeployed your commands
you said you had done so, but it's entirely possible that either:
- you only redeployed your commands when trying it as a string option
- your file wasn't saved
or in general there was some small mixup that has since been resolvedYeah, I did user instead of target and when I used target then user was the actual variable. Overall I just had a lot of it mixed up