types(AutocompleteOption): backport fix and improve types

v13.8.1
This commit is contained in:
March 7th
2022-06-17 12:48:45 +07:00
parent 206c699844
commit 1cf045050c
2 changed files with 24 additions and 3 deletions

View File

@@ -240,10 +240,19 @@ class CommandInteractionOptionResolver {
return option?.message ?? null;
}
/**
* The full autocomplete option object.
* @typedef {Object} AutocompleteFocusedOption
* @property {string} name The name of the option
* @property {ApplicationCommandOptionType} type The type of the application command option
* @property {string} value The value of the option
* @property {boolean} focused Whether this option is currently in focus for autocomplete
*/
/**
* Gets the focused option.
* @param {boolean} [getFull=false] Whether to get the full option object
* @returns {string|number|ApplicationCommandOptionChoice}
* @returns {string|AutocompleteFocusedOption}
* The value of the option, or the whole option if getFull is true
*/
getFocused(getFull = false) {