returned user from getUser option
when u get the requested user from interaction.options.getUser or whatever its called thats supplies a "member" right? and not a "user" aka your in the scope of the guild
8 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!a
GuildMember
is User
in the scope of the guild
getUser
returns the value of the user option (a User
)
getMember
returns the value of the user option as a GuildMember
:method: CommandInteractionOptionResolver#getMember()
@14.15.3
Gets a member option.
:method: CommandInteractionOptionResolver#getUser() @14.15.3
Gets a user option.ok im doing getUser so ill change it to getMember and then i can just <var>.roles.add and add roles like dat
also hey mark i seen u typing
been a little while
note that getMember can return null if the member isnt in the server
aint used d.js in ages basically doing no coding anymore rly just fixing a small issue i got rn
so handle accordingly
it will only ever be in the server as its a bot for 1 sole server so im fine there but thanks for the hint