HandleCommand
Signature
export declare class HandleCommandProperties
4Methods
28constructorautocompletecontextMenucontextMenuMessagecontextMenuUserentryPointchatInputmodalmessageComponentinteractionmessageargsParserresolveCommandFromContentgetCommandFromContentresolveByNamemakeResolvergetParentMessageCommandgetCommandcheckPermissionsfetchChannelfetchUserfetchMemberfetchRolerunGlobalMiddlewaresrunMiddlewaresmakeMenuCommandrunOptionsargsOptionsParser
Properties
client: UsingClient;private runAutocomplete;private resolveCommandFromNameParts;private commandCanRunInGuild;Methods
constructorConstructorconstructor(client: UsingClient);autocomplete(interaction: AutocompleteInteraction, optionsResolver: OptionResolverStructure, command?: CommandAutocompleteOption): Promise<void>;contextMenu(command: ContextMenuCommand, interaction: MessageCommandInteraction | UserCommandInteraction, context: MenuCommandContext<MessageCommandInteraction | UserCommandInteraction>): Promise<any>;contextMenuMessage(command: ContextMenuCommand, interaction: MessageCommandInteraction, context: MenuCommandContext<MessageCommandInteraction>): Promise<any>;contextMenuUser(command: ContextMenuCommand, interaction: UserCommandInteraction, context: MenuCommandContext<UserCommandInteraction>): Promise<any>;entryPoint(command: EntryPointCommand, interaction: EntryPointInteraction, context: EntryPointContext): Promise<any>;chatInput(command: Command | SubCommand, interaction: ChatInputCommandInteraction, resolver: OptionResolverStructure, context: CommandContext): Promise<any>;modal(interaction: ModalSubmitInteraction): Promise<void>;messageComponent(interaction: ComponentInteraction): Promise<void>;interaction(body: APIInteraction, shardId: number, __reply?: __InternalReplyFunction): Promise<void>;message(rawMessage: GatewayMessageCreateDispatchData, shardId: number): Promise<any>;argsParser(content: string, _command: SubCommand | Command, _message: MessageStructure): Record<string, string>;resolveCommandFromContent(content: string, _prefix: string, _message: GatewayMessageCreateDispatchData): CommandFromContent & { argsContent?: string;};getCommandFromContent(commandRaw: string[], guildId?: string): CommandFromContent;resolveByName(fullName: string, guildId?: string): CommandFromContent | undefined;Resolves a message command by its full name. Guild-scoped commands require a matching `guildId`; without one, they intentionally resolve to `undefined`.
makeResolver(...args: Parameters<(typeof Transformers)['OptionResolver']>): OptionResolverStructure;getParentMessageCommand(rawParentName: string, guildId?: string): Command | ContextMenuCommand | undefined;getCommand<T extends Command | ContextMenuCommand | EntryPointCommand>(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<APIChannel> | null;fetchUser(_option: CommandOptionWithType, query: string): Promise<APIUser> | null;fetchMember(_option: CommandOptionWithType, query: string, guildId: string): Promise<APIGuildMember> | null;fetchRole(_option: CommandOptionWithType, query: string, guildId?: string): Promise<APIRole> | null;runGlobalMiddlewares(command: Command | ContextMenuCommand | SubCommand | EntryPointCommand, context: CommandContext<{}, never> | MenuCommandContext<any> | EntryPointContext): Promise<false | { error?: string; metadata?: PluginMiddlewareDenialMetadata; pass?: boolean;}>;runMiddlewares(command: Command | ContextMenuCommand | SubCommand | EntryPointCommand, context: CommandContext<{}, never> | MenuCommandContext<any> | EntryPointContext): Promise<false | { error?: string; metadata?: PluginMiddlewareDenialMetadata; pass?: boolean;}>;makeMenuCommand(body: APIApplicationCommandInteraction, shardId: number, __reply?: __InternalReplyFunction): void | { command: ContextMenuCommand; interaction: UserCommandInteraction<boolean> | MessageCommandInteraction<boolean>; context: MenuCommandContext<UserCommandInteraction<boolean> | MessageCommandInteraction<boolean>, never>;};runOptions(command: Command | SubCommand, context: CommandContext, resolver: OptionResolverStructure): Promise<boolean>;argsOptionsParser(command: Command | SubCommand, message: GatewayMessageCreateDispatchData, args: Record<string, string>, resolved: MakeRequired<ContextOptionsResolved>): Promise<{ errors: { name: string; error: string; fullError: MessageCommandOptionErrors; }[]; options: APIApplicationCommandInteractionDataBasicOption[];}>;