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
d.js toolkit
d.js toolkit4mo ago
- 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!
duck
duck4mo ago
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
Baltraz
BaltrazOP4mo ago
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
treble/luna
treble/luna4mo ago
note that getMember can return null if the member isnt in the server
Baltraz
BaltrazOP4mo ago
aint used d.js in ages basically doing no coding anymore rly just fixing a small issue i got rn
treble/luna
treble/luna4mo ago
so handle accordingly
Baltraz
BaltrazOP4mo ago
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
Want results from more Discord servers?
Add your server