Skip to content

Object destructuring causes undefined (interaction.options) #8865

Closed Answered by MrMythicalYT
IsmaelTrentin asked this question in Q&A
Discussion options

You must be logged in to vote

This would be due to you unbinding the this, when destructuring. As you can see here, it tries to access this interally

const option = this._getTypedOption(name, ApplicationCommandOptionType.Integer, ['value'], required);

Destructuring these methods is not a good idea. If you really wanted to, make sure you bind it to the interaction.options object again.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@IsmaelTrentin
Comment options

Answer selected by Jiralite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants