cant get the user option
i have a subcommand with a
user
option and a string
option. Im trying to use autocomplete in the string option. And im trying to get the user
option data inside autocomplete()
function. but i cant get the user data by interaction.options.getUser()
, it return null
but when i log interaction.options
it logs
i can't figure out how i can get { value: '757912235908661299', type: 6, name: 'member' }
9 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.interaction.options.getUser(optionName)
In your case "member"
that returns null
inside autocomplete function
And
interaction.options.get("member").value
?wait that returned the id of that user
Yeah, thats what you asked isnt it?
yeah thanks
iirc you cant get the user from an autocomplete directly
If you need it you can use client.users.fetch(id)
yeah ill do that i was confused why
interaction.options.getUser()
returned null
anyways thanks