import { type MessageStructure, type OptionResolverStructure, Transformers } from '../client/transformers'; import type { MakeRequired } from '../common'; import { type __InternalReplyFunction, AutocompleteInteraction, type ChatInputCommandInteraction, type ComponentInteraction, type EntryPointInteraction, type MessageCommandInteraction, type ModalSubmitInteraction, type UserCommandInteraction } from '../structures'; import type { PermissionsBitField } from '../structures/extra/Permissions'; import { type APIApplicationCommandInteraction, type APIApplicationCommandInteractionDataBasicOption, type APIInteraction, ApplicationCommandOptionType, type GatewayMessageCreateDispatchData } from '../types'; import { Command, type CommandAutocompleteOption, CommandContext, type CommandOption, type ContextMenuCommand, type ContextOptionsResolved, type EntryPointCommand, EntryPointContext, MenuCommandContext, type MessageCommandOptionErrors, SubCommand, type UsingClient } from '.'; export type CommandOptionWithType = CommandOption & { type: ApplicationCommandOptionType; }; export interface CommandFromContent { command?: Command | SubCommand; parent?: Command; fullCommandName: string; } export declare class HandleCommand { client: UsingClient; constructor(client: UsingClient); autocomplete(interaction: AutocompleteInteraction, optionsResolver: OptionResolverStructure, command?: CommandAutocompleteOption): Promise; private runAutocomplete; contextMenu(command: ContextMenuCommand, interaction: MessageCommandInteraction | UserCommandInteraction, context: MenuCommandContext): Promise; contextMenuMessage(command: ContextMenuCommand, interaction: MessageCommandInteraction, context: MenuCommandContext): Promise; contextMenuUser(command: ContextMenuCommand, interaction: UserCommandInteraction, context: MenuCommandContext): Promise; entryPoint(command: EntryPointCommand, interaction: EntryPointInteraction, context: EntryPointContext): Promise; chatInput(command: Command | SubCommand, interaction: ChatInputCommandInteraction, resolver: OptionResolverStructure, context: CommandContext): Promise; modal(interaction: ModalSubmitInteraction): Promise; messageComponent(interaction: ComponentInteraction): Promise; interaction(body: APIInteraction, shardId: number, __reply?: __InternalReplyFunction): Promise; message(rawMessage: GatewayMessageCreateDispatchData, shardId: number): Promise; argsParser(content: string, _command: SubCommand | Command, _message: MessageStructure): Record; resolveCommandFromContent(content: string, _prefix: string, _message: GatewayMessageCreateDispatchData): CommandFromContent & { argsContent?: string; }; getCommandFromContent(commandRaw: string[], guildId?: string): CommandFromContent; /** * Resolves a message command by its full name. * * Guild-scoped commands require a matching `guildId`; without one, they intentionally resolve to `undefined`. */ resolveByName(fullName: string, guildId?: string): CommandFromContent | undefined; private resolveCommandFromNameParts; makeResolver(...args: Parameters<(typeof Transformers)['OptionResolver']>): OptionResolverStructure; getParentMessageCommand(rawParentName: string, guildId?: string): Command | ContextMenuCommand | undefined; private commandCanRunInGuild; getCommand(data: { guild_id?: string; name: string; }): T | undefined; checkPermissions(app: PermissionsBitField, bot: bigint): ("CreateInstantInvite" | "KickMembers" | "BanMembers" | "Administrator" | "ManageChannels" | "ManageGuild" | "AddReactions" | "ViewAuditLog" | "PrioritySpeaker" | "Stream" | "ViewChannel" | "SendMessages" | "SendTTSMessages" | "ManageMessages" | "EmbedLinks" | "AttachFiles" | "ReadMessageHistory" | "MentionEveryone" | "UseExternalEmojis" | "ViewGuildInsights" | "Connect" | "Speak" | "MuteMembers" | "DeafenMembers" | "MoveMembers" | "UseVAD" | "ChangeNickname" | "ManageNicknames" | "ManageRoles" | "ManageWebhooks" | "ManageGuildExpressions" | "UseApplicationCommands" | "RequestToSpeak" | "ManageEvents" | "ManageThreads" | "CreatePublicThreads" | "CreatePrivateThreads" | "UseExternalStickers" | "SendMessagesInThreads" | "UseEmbeddedActivities" | "ModerateMembers" | "ViewCreatorMonetizationAnalytics" | "UseSoundboard" | "CreateGuildExpressions" | "CreateEvents" | "UseExternalSounds" | "SendVoiceMessages" | "SetVoiceChannelStatus" | "SendPolls" | "UseExternalApps" | "PinMessages" | "BypassSlowmode")[] | undefined; fetchChannel(_option: CommandOptionWithType, query: string): Promise | null; fetchUser(_option: CommandOptionWithType, query: string): Promise | null; fetchMember(_option: CommandOptionWithType, query: string, guildId: string): Promise | null; fetchRole(_option: CommandOptionWithType, query: string, guildId?: string): Promise | null; runGlobalMiddlewares(command: Command | ContextMenuCommand | SubCommand | EntryPointCommand, context: CommandContext<{}, never> | MenuCommandContext | EntryPointContext): Promise; runMiddlewares(command: Command | ContextMenuCommand | SubCommand | EntryPointCommand, context: CommandContext<{}, never> | MenuCommandContext | EntryPointContext): Promise; makeMenuCommand(body: APIApplicationCommandInteraction, shardId: number, __reply?: __InternalReplyFunction): void | { command: ContextMenuCommand; interaction: UserCommandInteraction | MessageCommandInteraction; context: MenuCommandContext | MessageCommandInteraction, never>; }; runOptions(command: Command | SubCommand, context: CommandContext, resolver: OptionResolverStructure): Promise; argsOptionsParser(command: Command | SubCommand, message: GatewayMessageCreateDispatchData, args: Record, resolved: MakeRequired): Promise<{ errors: { name: string; error: string; fullError: MessageCommandOptionErrors; }[]; options: APIApplicationCommandInteractionDataBasicOption[]; }>; }