Timeout Error
Hello!
After this message you can see my current Code. I have a problem, that firstly, i get the error right here:
And secondly, if i just remove this, i get the error, from the
but the user i test it on is not above the bot at all.
7 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!You are getting a user object from your slash command options, you have to get a MEMBER object to access their permissions, roles, and other methods like kick or timeout, etc
Despite sounding similar there is a distinct difference between users and members in Discord:
- User: global Discord user data (global avatar, username, tag, id)
- GuildMember: user data associated to a guild (guild, nickname, roles, voice, guild avatar, etc.)
- Conversion: User ➞ GuildMember | GuildMember ➞ User
* Note: Events received in cached guilds will often have both the member and user available, eg.
interaction.user
and interaction.member
instead of
options.getUser()
use options.getMember()
and you should also check if the command is being used in a guild and not a dm
or register this command with .setDMPermission(false)
to not register it on DMSthank you, now i get the error from:
and the user is not above me
i did that, seems like the error is gone, but now i got the new one, like i said
the error is?