import { type APIApplicationCommandInteractionDataOption, type APIAttachment, type APIInteractionDataResolved, type APIInteractionDataResolvedChannel, type APIRole, type APIUser } from "discord-api-types/v10"; import type { ChatInputConfig } from "../../types/config.ts"; import type { CommandInteraction, GetOptionFn } from "../../types/interaction.ts"; import type { Requirable } from "../../types/utilities.ts"; export interface OptionValueGetters | undefined = undefined> { /** Return the option as a subcommand - Option type must be `Subcommand` */ subcommand: () => { /** * Get an option from the subcommand * @param name The name of the option * @param required Whether the option is required */ getOption: T extends object ? GetOptionFn : CommandInteraction["getOption"]; name: N; }; /** Return the option as a subcommand group - Option type must be `SubcommandGroup` */ subcommandGroup: () => { /** * Get a subcommand from the group * @param name The name of the subcommand */ getSubcommand: T extends object ? [number]["name"], O extends Extract[number], { name: N; }>>(name: N) => ReturnType["subcommand"]> | undefined : (name: N) => ReturnType["subcommand"]> | undefined; name: N; }; /** Return the option's value as a string - Option type must be `String` */ string: () => string; /** Return the option's value as an integer - Option type must be `Integer` */ integer: () => number; /** Return the option's value as a boolean - Option type must be `Boolean` */ boolean: () => boolean; /** Get the user from the option - Option type must be `User` */ user: () => APIUser; /** Get the channel from the option - Option type must be `Channel` */ channel: () => APIInteractionDataResolvedChannel; /** Get the role from the option - Option type must be `Role` */ role: () => APIRole; /** Get the mentionable from the option - Option type must be `Mentionable` */ mentionable: () => APIUser | APIRole; /** Return the option's value as a number - Option type must be `Number` */ number: () => number; /** Get the attachment from the option - Option type must be `Attachment` */ attachment: () => APIAttachment; } export declare function getOption(name: N, required: R, options: APIApplicationCommandInteractionDataOption[], resolved?: APIInteractionDataResolved): Requirable>;