-
so i saw that slash command options in the form of a collection were replaced by the CommandInteractionOptionResolver, this only has .get methods, will this ever get .has methods or are they redundant? |
Beta Was this translation helpful? Give feedback.
Answered by
Jiralite
Jul 19, 2021
Replies: 1 comment 2 replies
-
The many 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!
} |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Floffah
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The many
.get()
methods on theCommandInteractionOptionResolver
all returnnull
if your specified option does not exist. Does this help you?Before you could have done:
Presently, you can do this: