diff --git a/packages/discord.js/src/structures/CommandInteractionOptionResolver.js b/packages/discord.js/src/structures/CommandInteractionOptionResolver.js index 621dbf44e1f2..b59f6328e40c 100644 --- a/packages/discord.js/src/structures/CommandInteractionOptionResolver.js +++ b/packages/discord.js/src/structures/CommandInteractionOptionResolver.js @@ -294,14 +294,13 @@ class CommandInteractionOptionResolver { /** * Gets the focused option. - * @param {boolean} [getFull=false] Whether to get the full option object - * @returns {string|AutocompleteFocusedOption} - * The value of the option, or the whole option if getFull is true + * @returns {AutocompleteFocusedOption} + * The whole object of the option that is focused */ - getFocused(getFull = false) { + getFocused() { const focusedOption = this._hoistedOptions.find(option => option.focused); if (!focusedOption) throw new DiscordjsTypeError(ErrorCodes.AutocompleteInteractionOptionNoFocusedOption); - return getFull ? focusedOption : focusedOption.value; + return focusedOption; } } diff --git a/packages/discord.js/typings/index.d.ts b/packages/discord.js/typings/index.d.ts index c28be62901c2..ef876764c293 100644 --- a/packages/discord.js/typings/index.d.ts +++ b/packages/discord.js/typings/index.d.ts @@ -1312,8 +1312,7 @@ export class CommandInteractionOptionResolver['member' | 'role' | 'user']> | null; public getMessage(name: string, required: true): NonNullable['message']>; public getMessage(name: string, required?: boolean): NonNullable['message']> | null; - public getFocused(getFull: true): AutocompleteFocusedOption; - public getFocused(getFull?: boolean): string; + public getFocused(): AutocompleteFocusedOption; } export class ContextMenuCommandInteraction extends CommandInteraction {