Skip to content
Discussion options

You must be logged in to vote

The many .get() methods on the CommandInteractionOptionResolver all return null if your specified option does not exist. Does this help you?

Before you could have done:

const options = <CommandInteraction>.options;

if (options.has("option name")) {
  // There exists a specified option name!
}

Presently, you can do this:

const options = <CommandInteraction>.options;

if (options.get("option name") !== null) {
  // There exists a specified option name!
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Floffah
Comment options

@Jiralite
Comment options

Answer selected by Floffah
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