import type { PermissionStrings, SeyfertBaseChoiceableOption, SeyfertBasicOption, SeyfertChoice } from '../..'; import type { Attachment } from '../../builders'; import type { PluginMiddlewareDenialMetadata } from '../../client/plugins/types'; import type { GuildMemberStructure, GuildRoleStructure, InteractionGuildMemberStructure, UserStructure } from '../../client/transformers'; import type { AllChannels, AutocompleteInteraction } from '../../structures'; import { type APIApplicationCommandBasicOption, type APIApplicationCommandOption, ApplicationCommandOptionType, ApplicationCommandType, type ApplicationIntegrationType, type InteractionContextType, type LocaleString } from '../../types'; import type { Groups, ResolvedRegisteredMiddlewares } from '../decorators'; import type { CommandOptionWithType } from '../handle'; import type { CommandContext } from './chatcontext'; import type { ExtraProps, IgnoreCommand, OnOptionsReturnObject, SeyfertChannelMap, UsingClient } from './shared'; export interface ReturnOptionsTypes { [ApplicationCommandOptionType.Subcommand]: never; [ApplicationCommandOptionType.SubcommandGroup]: never; [ApplicationCommandOptionType.String]: string; [ApplicationCommandOptionType.Integer]: number; [ApplicationCommandOptionType.Boolean]: boolean; [ApplicationCommandOptionType.User]: InteractionGuildMemberStructure | UserStructure; [ApplicationCommandOptionType.Channel]: AllChannels; [ApplicationCommandOptionType.Role]: GuildRoleStructure; [ApplicationCommandOptionType.Mentionable]: GuildRoleStructure | InteractionGuildMemberStructure | GuildMemberStructure | UserStructure; [ApplicationCommandOptionType.Number]: number; [ApplicationCommandOptionType.Attachment]: Attachment; } export type AutocompleteCallback = (interaction: AutocompleteInteraction) => any; export type OnAutocompleteErrorCallback = (interaction: AutocompleteInteraction, error: unknown) => any; export type CommandBaseOption = SeyfertBaseChoiceableOption | SeyfertBasicOption; export type CommandBaseAutocompleteOption = (SeyfertBasicOption | SeyfertBaseChoiceableOption) & { autocomplete: AutocompleteCallback; onAutocompleteError?: OnAutocompleteErrorCallback; }; export type CommandAutocompleteOption = CommandBaseAutocompleteOption & { name: string; }; export type CommandOptionWithoutName = CommandBaseOption; export type CommandOption = CommandOptionWithoutName & { name: string; }; export type OptionsRecord = Record; type KeysWithoutRequired = { [K in keyof T]-?: NonNullable extends true ? never : K; }[keyof T]; type ContextOptionsAuxInternal = T['value'] extends (...args: any) => any ? Parameters[1]>[0] : NonNullable extends (...args: any) => any ? Parameters>[1]>[0] extends never ? T extends { channel_types?: infer C; } ? C extends readonly any[] ? C[number] extends keyof SeyfertChannelMap ? SeyfertChannelMap[C[number]] : never : never : T extends { choices?: infer C; } ? C extends readonly SeyfertChoice[] ? C[number]['value'] : never : never : Parameters>[1]>[0] : ReturnOptionsTypes[T['type']]; type ContextOptionsAux = { [K in Exclude>]: ContextOptionsAuxInternal; } & { [K in KeysWithoutRequired]?: ContextOptionsAuxInternal; }; export type ContextOptions = ContextOptionsAux; export declare class BaseCommand { middlewares: readonly (keyof ResolvedRegisteredMiddlewares)[]; __filePath?: string; __t?: { name: string | undefined; description: string | undefined; }; __autoload?: true; guildId?: string[]; name: string; type: number; nsfw?: boolean; description: string; defaultMemberPermissions?: bigint; integrationTypes: ApplicationIntegrationType[]; contexts: InteractionContextType[]; botPermissions?: bigint; name_localizations?: Partial>; description_localizations?: Partial>; options?: CommandOptionWithType[] | SubCommand[]; ignore?: IgnoreCommand; aliases?: string[]; props: ExtraProps; private static __getMiddlewareOwnerName; toJSON(): { name: BaseCommand["name"]; type: BaseCommand["type"]; nsfw: BaseCommand["nsfw"]; description: BaseCommand["description"]; name_localizations: BaseCommand["name_localizations"]; description_localizations: BaseCommand["description_localizations"]; guild_id: BaseCommand["guildId"]; default_member_permissions: string; contexts: BaseCommand["contexts"]; integration_types: BaseCommand["integrationTypes"]; }; reload(): Promise; onBeforeMiddlewares?(context: CommandContext): any; onBeforeOptions?(context: CommandContext): any; run?(context: CommandContext): any; onAfterRun?(context: CommandContext, error: unknown | undefined): any; onRunError?(context: CommandContext, error: unknown): any; onOptionsError?(context: CommandContext, metadata: OnOptionsReturnObject): any; onMiddlewaresError?(context: CommandContext, error: string, metadata: PluginMiddlewareDenialMetadata): any; onBotPermissionsFail?(context: CommandContext, permissions: PermissionStrings): any; onPermissionsFail?(context: CommandContext, permissions: PermissionStrings): any; onInternalError?(client: UsingClient, command: Command | SubCommand, error?: unknown): any; } export declare class Command extends BaseCommand { type: ApplicationCommandType; groups?: Parameters[0]; groupsAliases?: Record; __tGroups?: Record; toJSON(): { options: APIApplicationCommandOption[]; name: BaseCommand["name"]; type: BaseCommand["type"]; nsfw: BaseCommand["nsfw"]; description: BaseCommand["description"]; name_localizations: BaseCommand["name_localizations"]; description_localizations: BaseCommand["description_localizations"]; guild_id: BaseCommand["guildId"]; default_member_permissions: string; contexts: BaseCommand["contexts"]; integration_types: BaseCommand["integrationTypes"]; }; } export declare abstract class SubCommand extends BaseCommand { type: ApplicationCommandOptionType; group?: string; options?: CommandOptionWithType[]; toJSON(): { options: APIApplicationCommandBasicOption[]; name: BaseCommand["name"]; type: BaseCommand["type"]; nsfw: BaseCommand["nsfw"]; description: BaseCommand["description"]; name_localizations: BaseCommand["name_localizations"]; description_localizations: BaseCommand["description_localizations"]; guild_id: BaseCommand["guildId"]; default_member_permissions: string; contexts: BaseCommand["contexts"]; integration_types: BaseCommand["integrationTypes"]; }; abstract run(context: CommandContext): any; } export {};