export class CommandInteractionOptionResolver<Cached extends CacheType = CacheType>A resolver for command interaction options.
readonlyclient : Client
The client that instantiated this.
readonlydata : readonly CommandInteractionOption<Cached>[]
The interaction options array.
readonlyresolved : Readonly<CommandInteractionResolvedData<Cached>> | null
The interaction resolved data
get(name: stringrequired: true) : CommandInteractionOption<Cached>
Gets an option by its name.
Returns: The option, if found.
getAttachment(name: stringrequired: true) : NonNullable<CommandInteractionOption<Cached>['attachment']>
Gets an attachment option.
Returns: The value of the option, or null if not set and not required.
getChannel<Type? extends ChannelType = ChannelType
>() : Extract<NonNullable<CommandInteractionOption<Cached>['channel']>, { type: Type extends ChannelType.PublicThread | ChannelType.AnnouncementThread ? ChannelType.PublicThread | ChannelType.AnnouncementThread : Type; }>
Type? extends ChannelType = ChannelType
Gets a channel option.
Returns: The value of the option, or null if not set and not required.
getFocused(getFull: true) : AutocompleteFocusedOption
Gets the focused option.
Returns: The value of the option, or the whole option if getFull is true
getMember(name: string) : NonNullable<CommandInteractionOption<Cached>['member']> | null
Gets a member option.
Returns: The value of the option, or null if the user is not present in the guild or the option is not set.
getMentionable(name: stringrequired: true) : NonNullable<CommandInteractionOption<Cached>['member' | 'role' | 'user']>
Gets a mentionable option.
Returns: The value of the option, or null if not set and not required.
getMessage(name: stringrequired: true) : NonNullable<CommandInteractionOption<Cached>['message']>
Gets a message option.
Returns: The value of the option, or null if not set and not required.
getRole(name: stringrequired: true) : NonNullable<CommandInteractionOption<Cached>['role']>
Gets a role option.
Returns: The value of the option, or null if not set and not required.
getSubcommand(required?: true) : string
Gets the selected subcommand.
Returns: The name of the selected subcommand, or null if not set and not required.
getSubcommandGroup(required: true) : string
Gets the selected subcommand group.
Returns: The name of the selected subcommand group, or null if not set and not required.
getUser(name: stringrequired: true) : NonNullable<CommandInteractionOption<Cached>['user']>
Gets a user option.
Returns: The value of the option, or null if not set and not required.