{"version":3,"sources":["../../src/utils.ts","../../src/base-decorators.ts","../../src/djs-decorators.ts","../../src/piece-decorators.ts"],"names":["target","DecoratorIdentifiers","PermissionsBitField","PermissionFlagsBits","isDMChannel","UserError","isGuildBasedChannel","isNullish","container","ApplicationCommandType"],"mappings":";;;;;;;;;;;AAiCO,SAAS,sBAAsB,EAAsC,EAAA;AAC3E,EAAO,OAAA,EAAA;AACR;AAFgB,MAAA,CAAA,qBAAA,EAAA,uBAAA,CAAA;AAST,SAAS,qBAAiE,EAA+B,EAAA;AAC/G,EAAO,OAAA,EAAA;AACR;AAFgB,MAAA,CAAA,oBAAA,EAAA,sBAAA,CAAA;AA8BT,SAAS,0BAA2B,CAAA,YAAA,EAAoC,QAA6B,GAAA,MAAY,MAA4B,EAAA;AACnJ,EAAA,OAAO,qBAAsB,CAAA,CAAC,OAAS,EAAA,YAAA,EAAc,UAAe,KAAA;AACnE,IAAA,MAAM,SAAS,UAAW,CAAA,KAAA;AAC1B,IAAA,IAAI,CAAC,MAAA,EAAc,MAAA,IAAI,MAAM,6CAA6C,CAAA;AAC1E,IAAA,IAAI,OAAO,MAAW,KAAA,UAAA,EAAkB,MAAA,IAAI,MAAM,0DAA0D,CAAA;AAE5G,IAAW,UAAA,CAAA,KAAA,mBAAuB,MAAA,CAAA,eAAA,eAAA,CAAA,GAAkD,IAAa,EAAA;AAChG,MAAA,MAAM,MAAS,GAAA,MAAM,YAAa,CAAA,GAAG,IAAI,CAAA;AACzC,MAAO,OAAA,MAAA,GAAS,MAAO,CAAA,IAAA,CAAK,IAAM,EAAA,GAAG,IAAI,CAAA,GAAI,QAAS,CAAA,IAAA,CAAK,IAAM,EAAA,GAAG,IAAI,CAAA;AAAA,KAFtD,EAAA,iBAAA,CAAA;AAAA,GAInB,CAAA;AACF;AAXgB,MAAA,CAAA,0BAAA,EAAA,4BAAA,CAAA;AAmBT,SAAS,WAAA,CAA8B,QAAW,OAA0C,EAAA;AAClG,EAAO,OAAA,IAAI,MAAM,MAA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A,0BAAA;AAAA,gBACR,CAAC,YAAY,IAAK,CAAA,SAAA,CAAU,SAAS,OAAO,CAAA,CAAE,OAAQ,CAAAA,iCAAA,CAAuB,IAAI,CAAA;AAAA,gBACjF,IAAK,CAAA;AAAA,eACN;AACA,cAAA;AAAA;AACD;AACD;AAGD,QAAA,IAAI,gBAAkB,EAAA,OAAO,gBAAiB,CAAA,IAAA,CAAK,MAAM,QAAQ,CAAA;AAAA,OA1B5B,EAAA,6BAAA,CAAA;AA6BtC,MAAO,OAAA,OAAA;AAAA;AACR,GACA,CAAA;AAED,EAAkC,iCAAA,CAAA,GAAA,CAAI,SAAS,QAAQ,CAAA;AACvD,EAAkC,iCAAA,CAAA,GAAA,CAAI,UAAU,OAAO,CAAA;AAEvD,EAAO,OAAA,OAAA;AACR;AApDS,MAAA,CAAA,mCAAA,EAAA,qCAAA,CAAA","file":"index.cjs","sourcesContent":["/**\n * The function precondition interface.\n */\nexport interface FunctionPrecondition {\n\t/**\n\t * The arguments passed to the function or class' method.\n\t */\n\t(...args: any[]): boolean | Promise<boolean>;\n}\n\n/**\n * The fallback interface, this is called when the function precondition returns or resolves with a falsy value.\n */\nexport interface FunctionFallback {\n\t/**\n\t * The arguments passed to the function or class' method.\n\t */\n\t(...args: any[]): unknown;\n}\n\n/**\n * Utility to make a method decorator with lighter syntax and inferred types.\n *\n * ```typescript\n * // Enumerable function\n *\tfunction enumerableMethod(value: boolean) {\n *\t\treturn createMethodDecorator((_target, _propertyKey, descriptor) => {\n *\t\t\tdescriptor.enumerable = value;\n *\t\t});\n *\t}\n * ```\n * @param fn The method to decorate\n */\nexport function createMethodDecorator(fn: MethodDecorator): MethodDecorator {\n\treturn fn;\n}\n\n/**\n * Utility to make a class decorator with lighter syntax and inferred types.\n * @param fn The class to decorate\n * @see {@link ApplyOptions}\n */\nexport function createClassDecorator<TFunction extends (...args: any[]) => void>(fn: TFunction): ClassDecorator {\n\treturn fn;\n}\n\n/**\n * Utility to make function preconditions.\n *\n * ```typescript\n * // No fallback (returns undefined)\n * function requireGuild(value: number) {\n *   return createFunctionPrecondition((message: Message) =>\n *     message.guild !== null\n *   );\n * }\n *\n * // With fallback\n * function requireGuild(\n *   value: number,\n *   fallback: () => unknown = () => undefined\n * ) {\n *   return createFunctionPrecondition(\n *     (message: Message) => message.guild !== null,\n *     fallback\n *   );\n * }\n * ```\n * @since 1.0.0\n * @param precondition The function that defines whether or not the function should be run, returning the returned value from fallback\n * @param fallback The fallback value that defines what the method should return in case the precondition fails\n */\nexport function createFunctionPrecondition(precondition: FunctionPrecondition, fallback: FunctionFallback = (): void => undefined): MethodDecorator {\n\treturn createMethodDecorator((_target, _propertyKey, descriptor) => {\n\t\tconst method = descriptor.value;\n\t\tif (!method) throw new Error('Function preconditions require a [[value]].');\n\t\tif (typeof method !== 'function') throw new Error('Function preconditions can only be applied to functions.');\n\n\t\tdescriptor.value = async function descriptorValue(this: (...args: any[]) => any, ...args: any[]) {\n\t\t\tconst canRun = await precondition(...args);\n\t\t\treturn canRun ? method.call(this, ...args) : fallback.call(this, ...args);\n\t\t} as unknown as undefined;\n\t});\n}\n\n/**\n * Creates a new proxy to efficiently add properties to class without creating subclasses\n * @param target The constructor of the class to modify\n * @param handler The handler function to modify the constructor behavior for the target\n * @hidden\n */\nexport function createProxy<T extends object>(target: T, handler: Omit<ProxyHandler<T>, 'get'>): T {\n\treturn new Proxy(target, {\n\t\t...handler,\n\t\tget: (target, property) => {\n\t\t\tconst value = Reflect.get(target, property);\n\t\t\treturn typeof value === 'function' ? (...args: readonly unknown[]) => value.apply(target, args) : value;\n\t\t}\n\t});\n}\n","import { createMethodDecorator } from './utils';\n\n/**\n * Decorator that sets the enumerable property of a class field to the desired value.\n * @param value Whether the property should be enumerable or not\n */\nexport function Enumerable(value: boolean) {\n\treturn (target: object, key: string) => {\n\t\tReflect.defineProperty(target, key, {\n\t\t\tenumerable: value,\n\t\t\tset(this: unknown, val: unknown) {\n\t\t\t\tReflect.defineProperty(this as object, key, {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: value,\n\t\t\t\t\tvalue: val,\n\t\t\t\t\twritable: true\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Decorator that sets the enumerable property of a class method to the desired value.\n * @param value Whether the method should be enumerable or not\n */\nexport function EnumerableMethod(value: boolean) {\n\treturn createMethodDecorator((_target, _propertyKey, descriptor) => {\n\t\tdescriptor.enumerable = value;\n\t});\n}\n","import { isDMChannel, isGuildBasedChannel } from '@sapphire/discord.js-utilities';\nimport { UserError } from '@sapphire/framework';\nimport { isNullish } from '@sapphire/utilities';\nimport { PermissionFlagsBits, PermissionsBitField, type BaseInteraction, type Message, type PermissionResolvable } from 'discord.js';\nimport { createFunctionPrecondition, type FunctionFallback } from './utils';\n\nexport enum DecoratorIdentifiers {\n\tRequiresClientPermissionsGuildOnly = 'requiresClientPermissionsGuildOnly',\n\tRequiresClientPermissionsMissingPermissions = 'requiresClientPermissionsMissingPermissions',\n\tRequiresUserPermissionsGuildOnly = 'requiresUserPermissionsGuildOnly',\n\tRequiresUserPermissionsMissingPermissions = 'requiresUserPermissionsMissingPermissions'\n}\n\nconst DMAvailablePermissions = new PermissionsBitField(\n\t~new PermissionsBitField([\n\t\t//\n\t\tPermissionFlagsBits.AddReactions,\n\t\tPermissionFlagsBits.AttachFiles,\n\t\tPermissionFlagsBits.EmbedLinks,\n\t\tPermissionFlagsBits.ReadMessageHistory,\n\t\tPermissionFlagsBits.SendMessages,\n\t\tPermissionFlagsBits.UseExternalEmojis,\n\t\tPermissionFlagsBits.ViewChannel\n\t]).bitfield & PermissionsBitField.All\n);\n\nconst DMAvailableUserPermissions = new PermissionsBitField(\n\t~new PermissionsBitField([\n\t\tPermissionFlagsBits.AddReactions,\n\t\tPermissionFlagsBits.AttachFiles,\n\t\tPermissionFlagsBits.EmbedLinks,\n\t\tPermissionFlagsBits.ReadMessageHistory,\n\t\tPermissionFlagsBits.SendMessages,\n\t\tPermissionFlagsBits.UseExternalEmojis,\n\t\tPermissionFlagsBits.ViewChannel,\n\t\tPermissionFlagsBits.UseExternalStickers,\n\t\tPermissionFlagsBits.MentionEveryone\n\t]).bitfield & PermissionsBitField.All\n);\n\n/**\n * Allows you to set permissions required for individual methods. This is particularly useful for subcommands that require specific permissions.\n * @remark This decorator applies to the client that is to execute the command. For setting permissions required user of the command see {@link RequiresUserPermissions}\n * @remark This decorator makes the decorated function asynchronous, so any result should be `await`ed.\n * @param permissionsResolvable Permissions that the method should have.\n * @example\n * ```typescript\n * import { ApplyOptions, RequiresClientPermissions } from '@sapphire/decorators';\n * import { Subcommand } from '@sapphire/plugin-subcommands';\n * import type { Message } from 'discord.js';\n *\n * (at)ApplyOptions<Subcommand.Options>({\n * \taliases: ['cws'],\n * \tdescription: 'A basic command with some subcommands',\n * \tsubCommands: ['add', 'remove', 'reset', { input: 'show', default: true }]\n * })\n * export default class extends Subcommand {\n *     // Anyone should be able to view the result, but not modify\n * \tpublic async show(message: Message) {\n * \t\treturn message.channel.send('Showing!');\n * \t}\n *\n * \t(at)RequiresClientPermissions('BAN_MEMBERS') // This subcommand requires the client to be able to ban members.\n * \tpublic async add(message: Message) {\n * \t\treturn message.channel.send('Adding!');\n * \t}\n *\n * \t(at)RequiresClientPermissions('BAN_MEMBERS') // This subcommand requires the client to be able to ban members.\n * \tpublic async remove(message: Message) {\n * \t\treturn message.channel.send('Removing!');\n * \t}\n *\n * \t(at)RequiresClientPermissions('BAN_MEMBERS') // This subcommand requires the client to be able to ban members.\n * \tpublic async reset(message: Message) {\n * \t\treturn message.channel.send('Resetting!');\n * \t}\n * }\n * ```\n */\nexport const RequiresClientPermissions = (...permissionsResolvable: PermissionResolvable[]): MethodDecorator => {\n\tconst resolved = new PermissionsBitField(permissionsResolvable);\n\tconst resolvedIncludesServerPermissions = Boolean(resolved.bitfield & DMAvailablePermissions.bitfield);\n\n\treturn createFunctionPrecondition((context: Message | BaseInteraction) => {\n\t\tconst { channel } = context;\n\t\tconst member = context.guild?.members.me;\n\n\t\tif (resolvedIncludesServerPermissions && isDMChannel(channel)) {\n\t\t\tthrow new UserError({\n\t\t\t\tidentifier: DecoratorIdentifiers.RequiresClientPermissionsGuildOnly,\n\t\t\t\tmessage: 'Sorry, but that command can only be used in a server because I do not have sufficient permissions in DMs'\n\t\t\t});\n\t\t}\n\n\t\tif (isGuildBasedChannel(channel) && !isNullish(member)) {\n\t\t\tconst missingPermissions = channel.permissionsFor(member).missing(resolved);\n\n\t\t\tif (missingPermissions.length) {\n\t\t\t\tthrow new UserError({\n\t\t\t\t\tidentifier: DecoratorIdentifiers.RequiresClientPermissionsMissingPermissions,\n\t\t\t\t\tmessage: `Sorry, but I am not allowed to do that. I am missing the permissions: ${missingPermissions}`,\n\t\t\t\t\tcontext: {\n\t\t\t\t\t\tmissing: missingPermissions\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t});\n};\n\n/**\n * Allows you to set permissions required for individual methods. This is particularly useful for subcommands that require specific permissions.\n * @remark This decorator applies to the user of the command. For setting permissions required for the client see {@link RequiresClientPermissions}\n * @remark This decorator makes the decorated function asynchronous, so any result should be `await`ed.\n * @param permissionsResolvable Permissions that the method should have.\n * @example\n * ```typescript\n * import { ApplyOptions, RequiresUserPermissions } from '@sapphire/decorators';\n * import { Subcommand } from '@sapphire/plugin-subcommands';\n * import type { Message } from 'discord.js';\n *\n * (at)ApplyOptions<Subcommand.Options>({\n * \taliases: ['cws'],\n * \tdescription: 'A basic command with some subcommands',\n * \tsubCommands: ['add', 'remove', 'reset', { input: 'show', default: true }]\n * })\n * export default class extends Subcommand {\n *     // Anyone should be able to view the result, but not modify\n * \tpublic async show(message: Message) {\n * \t\treturn message.channel.send('Showing!');\n * \t}\n *\n * \t(at)RequiresUserPermissions('BAN_MEMBERS') // This subcommand requires the user of the command to be able to ban members.\n * \tpublic async add(message: Message) {\n * \t\treturn message.channel.send('Adding!');\n * \t}\n *\n * \t(at)RequiresUserPermissions('BAN_MEMBERS') // This subcommand requires the user of the command to be able to ban members.\n * \tpublic async remove(message: Message) {\n * \t\treturn message.channel.send('Removing!');\n * \t}\n *\n * \t(at)RequiresUserPermissions('BAN_MEMBERS') // This subcommand requires the user of the command to be able to ban members.\n * \tpublic async reset(message: Message) {\n * \t\treturn message.channel.send('Resetting!');\n * \t}\n * }\n * ```\n */\nexport const RequiresUserPermissions = (...permissionsResolvable: PermissionResolvable[]): MethodDecorator => {\n\tconst resolved = new PermissionsBitField(permissionsResolvable);\n\tconst resolvedIncludesServerPermissions = Boolean(resolved.bitfield & DMAvailableUserPermissions.bitfield);\n\n\treturn createFunctionPrecondition((context: Message | BaseInteraction) => {\n\t\tconst { channel } = context;\n\t\tconst member = context.guild?.members.me;\n\n\t\tif (resolvedIncludesServerPermissions && isDMChannel(channel)) {\n\t\t\tthrow new UserError({\n\t\t\t\tidentifier: DecoratorIdentifiers.RequiresUserPermissionsGuildOnly,\n\t\t\t\tmessage: 'Sorry, but that command can only be used in a server because you do not have sufficient permissions in DMs'\n\t\t\t});\n\t\t}\n\n\t\tif (isGuildBasedChannel(channel) && !isNullish(member)) {\n\t\t\tconst missingPermissions = channel.permissionsFor(member).missing(resolved);\n\n\t\t\tif (missingPermissions.length) {\n\t\t\t\tthrow new UserError({\n\t\t\t\t\tidentifier: DecoratorIdentifiers.RequiresUserPermissionsMissingPermissions,\n\t\t\t\t\tmessage: `Sorry, but you are not allowed to do that. You are missing the permissions: ${missingPermissions}`,\n\t\t\t\t\tcontext: {\n\t\t\t\t\t\tmissing: missingPermissions\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t});\n};\n\n/**\n * Requires the message to be run in a guild context, this decorator requires the first argument to be a {@link Message} or {@link BaseInteraction} instance which includes all interaction types\n * @since 1.0.0\n * @param fallback The fallback value passed to {@link createFunctionPrecondition}\n */\nexport function RequiresGuildContext(fallback: FunctionFallback = (): void => undefined): MethodDecorator {\n\treturn createFunctionPrecondition((context: Message | BaseInteraction) => context.guild !== null, fallback);\n}\n\n/**\n * Requires the message to be run in a dm context, this decorator requires the first argument to be a {@link Message} or {@link BaseInteraction} instance which includes all interaction types\n * @since 1.0.0\n * @param fallback The fallback value passed to {@link createFunctionPrecondition}\n */\nexport function RequiresDMContext(fallback: FunctionFallback = (): void => undefined): MethodDecorator {\n\treturn createFunctionPrecondition((context: Message | BaseInteraction) => context.guild === null, fallback);\n}\n","import { container, type ApplicationCommandRegistryRegisterOptions, type Command, type Piece } from '@sapphire/framework';\nimport type { Container } from '@sapphire/pieces';\nimport type { Ctor } from '@sapphire/utilities';\nimport {\n\tApplicationCommandType,\n\ttype ContextMenuCommandBuilder,\n\ttype SlashCommandBuilder,\n\ttype SlashCommandOptionsOnlyBuilder,\n\ttype SlashCommandSubcommandsOnlyBuilder\n} from 'discord.js';\nimport { createClassDecorator, createProxy } from './utils';\n\nconst applicationDecoratorsMap = new WeakMap<CommandTarget<any>, DecoratorMap<any>[]>();\nconst proxyApplicationCommandToOriginal = new WeakMap<CommandTarget<any>, CommandTarget<any>>();\nconst originalApplicationCommandToProxy = new WeakMap<CommandTarget<any>, CommandTarget<any>>();\n\n/**\n * Decorator function that applies given options to any Sapphire piece\n * @param optionsOrFn The options or function that returns options to pass to the piece constructor\n * @example\n * ```typescript\n * import { ApplyOptions } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import type { Message } from 'discord.js';\n *\n * @ApplyOptions<Command.Options>({\n *   description: 'ping pong',\n *   enabled: true\n * })\n * export class UserCommand extends Command {\n *   public override async messageRun(message: Message) {\n *     const msg = await message.channel.send('Ping?');\n *\n *     return msg.edit(\n *       `Pong! Client Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${msg.createdTimestamp - message.createdTimestamp}ms.`\n *     );\n *   }\n * }\n * ```\n * @example\n * ```typescript\n * import { ApplyOptions } from '@sapphire/decorators';\n * import { Listener } from '@sapphire/framework';\n * import { GatewayDispatchEvents, GatewayMessageDeleteDispatch } from 'discord.js';\n *\n * @ApplyOptions<Listener.Options>(({ container }) => ({\n *   description: 'Handle Raw Message Delete events',\n *   emitter: container.client.ws,\n *   event: GatewayDispatchEvents.MessageDelete\n * }))\n * export class UserListener extends Listener {\n *   public override run(data: GatewayMessageDeleteDispatch['d']): void {\n *     if (!data.guild_id) return;\n *\n *     const guild = this.container.client.guilds.cache.get(data.guild_id);\n *     if (!guild || !guild.channels.cache.has(data.channel_id)) return;\n *\n *     // Do something with the data\n *   }\n * }\n * ```\n */\nexport function ApplyOptions<T extends Piece.Options>(optionsOrFn: T | ((parameters: ApplyOptionsCallbackParameters) => T)): ClassDecorator {\n\treturn createClassDecorator((target: Ctor<ConstructorParameters<typeof Piece>, Piece>) =>\n\t\tcreateProxy(target, {\n\t\t\tconstruct: (ctor, [context, baseOptions = {}]: [Piece.LoaderContext, Piece.Options]) =>\n\t\t\t\tnew ctor(context, {\n\t\t\t\t\t...baseOptions,\n\t\t\t\t\t...(typeof optionsOrFn === 'function' ? optionsOrFn({ container, context }) : optionsOrFn)\n\t\t\t\t})\n\t\t})\n\t);\n}\n\n/**\n * Decorator for registering chat input command.\n * @param optionsFn The function that returns options to pass to the registry.\n * @example\n * ```typescript\n * import { RegisterChatInputCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n *\n * (at)RegisterChatInputCommand((builder, command) => builder\n *   .setName(command.name)\n *   .setDescription(command.description)\n * )\n * export class UserCommand extends Command {\n * \t public override chatInputRun(interaction: Command.ChatInputCommandInteraction) {\n * \t   \treturn interaction.reply({ content: 'HI!' });\n * \t }\n * }\n * ```\n * @example\n * ```typescript\n * import { RegisterChatInputCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n *\n * (at)RegisterChatInputCommand((builder, command) => builder\n *\t\t.setName(command.name)\n *\t\t.setDescription(command.description),\n *\t{\n *\t\tidHints: ['737141877803057244'],\n *\t\tguildIds: ['737141877803057244']\n *\t}\n * )\n * export class UserCommand extends Command {\n * \t public override chatInputRun(interaction: Command.ChatInputCommandInteraction) {\n * \t   \treturn interaction.reply({ content: 'HI!' });\n * \t }\n * }\n * ```\n * @example\n * ```typescript\n * import { RegisterChatInputCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n *\n * (at)RegisterChatInputCommand((builder) => builder\n *   .setName('hi')\n *   .setDescription('Sends a hi message')\n * )\n * export class UserCommand extends Command {\n * \t public override chatInputRun(interaction: Command.ChatInputCommandInteraction) {\n * \t   \treturn interaction.reply({ content: 'HI!' });\n * \t }\n * }\n * ```\n * @example\n * ```typescript\n * import { ApplyOptions, RegisterChatInputCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import type { Message } from 'discord.js';\n *\n * (at)ApplyOptions<Command.Options>({\n *   description: 'ping pong',\n *   enabled: true\n * })\n * (at)RegisterChatInputCommand((builder, command) => builder\n *   .setName(command.name)\n *   .setDescription(command.description)\n * )\n * export class UserCommand extends Command { *\n * \t public override chatInputRun(interaction: Command.ChatInputCommandInteraction) {\n * \t   \treturn interaction.reply({ content: 'HI!' });\n * \t }\n * }\n * ```\n */\nexport function RegisterChatInputCommand<CMD extends Command = Command>(\n\toptionsFn: ChatInputCommandDecoratorsMap<CMD>['optionsFn'],\n\tregistryOptions?: ApplicationCommandRegistryRegisterOptions\n): ClassDecorator {\n\treturn createClassDecorator((target: CommandTarget<CMD>) =>\n\t\tcollectApplicationCommandDecorators(target, { type: 'RegisterChatInputCommand', optionsFn, registryOptions })\n\t);\n}\n\n/**\n * Decorator for registering message context menu command.\n * @param optionsFn The function that returns options to pass to the registry.\n * @example\n * ```typescript\n * import { RegisterMessageContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type MessageContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)RegisterMessageContextMenuCommand((builder, command) => builder\n * \t .setName(command.name)\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall)\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: MessageContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: 'HI!' })\n * \t}\n * }\n * ```\n * @example\n * ```typescript\n * import { RegisterMessageContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type MessageContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)RegisterMessageContextMenuCommand((builder, command) => builder\n * \t .setName(command.name)\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall),\n *\t{\n *\t\tidHints: ['737141877803057244'],\n *\t\tguildIds: ['737141877803057244']\n *\t}\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: MessageContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: 'HI!' })\n * \t}\n * }\n * ```\n * @example\n * ```typescript\n * import { RegisterMessageContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type MessageContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)RegisterMessageContextMenuCommand((builder, command) => builder\n * \t .setName(command.name)\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall)\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: MessageContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: 'HI!' })\n * \t}\n * }\n * ```\n * @example\n * ```typescript\n * import { RegisterMessageContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type MessageContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)RegisterMessageContextMenuCommand((builder) => builder\n * \t .setName('Send HI')\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall)\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: MessageContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: 'HI!' })\n * \t}\n * }\n * ```\n * @example\n * ```typescript\n * import { ApplyOptions, RegisterMessageContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type MessageContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)ApplyOptions<Command.Options>({\n *   enabled: true\n * })\n * (at)RegisterMessageContextMenuCommand((builder, command) => builder\n * \t .setName(command.name)\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall)\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: MessageContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: 'HI!' })\n * \t}\n * }\n * ```\n */\nexport function RegisterMessageContextMenuCommand<CMD extends Command = Command>(\n\toptionsFn: ContextMenuCommandDecoratorsMap<CMD>['optionsFn'],\n\tregistryOptions?: ApplicationCommandRegistryRegisterOptions\n): ClassDecorator {\n\treturn createClassDecorator((target: CommandTarget<CMD>) =>\n\t\tcollectApplicationCommandDecorators(target, { type: 'RegisterMessageContextMenuCommand', optionsFn, registryOptions })\n\t);\n}\n\n/**\n * Decorator for registering user context menu command.\n * @param optionsFn The function that returns options to pass to the registry.\n * @example\n * ```typescript\n * import { RegisterUserContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type UserContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)RegisterUserContextMenuCommand((builder, command) => builder\n * \t .setName(command.name)\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall)\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: UserContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: 'HI!' })\n * \t}\n * }\n * ```\n * ```\n * @example\n * ```typescript\n * import { RegisterUserContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type MessageContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)RegisterUserContextMenuCommand((builder, command) => builder\n * \t .setName(command.name)\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall),\n *\t{\n *\t\tidHints: ['737141877803057244'],\n *\t\tguildIds: ['737141877803057244']\n *\t}\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: MessageContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: 'HI!' })\n * \t}\n * }\n * ```\n * @example\n * ```typescript\n * import { RegisterUserContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type UserContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)RegisterUserContextMenuCommand((builder, command) => builder\n * \t .setName('Send HI')\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall)\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: UserContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: `HI ${interaction.targetUser}!` })\n * \t}\n * }\n * ```\n * @example\n * ```typescript\n * import { ApplyOptions, RegisterUserContextMenuCommand } from '@sapphire/decorators';\n * import { Command } from '@sapphire/framework';\n * import { ApplicationIntegrationType, InteractionContextType, type UserContextMenuCommandInteraction } from 'discord.js';\n *\n * (at)ApplyOptions<Command.Options>({\n *   enabled: true\n * })\n * (at)RegisterUserContextMenuCommand((builder, command) => builder\n * \t .setName(command.name)\n * \t .setContexts(InteractionContextType.Guild)\n * \t .setIntegrationTypes(ApplicationIntegrationType.GuildInstall)\n * )\n * export class UserCommand extends Command {\n * \tpublic override contextMenuRun(interaction: MessageContextMenuCommandInteraction) {\n * \t\treturn interaction.reply({ content: 'HI!' })\n * \t}\n * }\n * ```\n */\nexport function RegisterUserContextMenuCommand<CMD extends Command = Command>(\n\toptionsFn: ContextMenuCommandDecoratorsMap<CMD>['optionsFn'],\n\tregistryOptions?: ApplicationCommandRegistryRegisterOptions\n): ClassDecorator {\n\treturn createClassDecorator((target: CommandTarget<CMD>) =>\n\t\tcollectApplicationCommandDecorators(target, { type: 'RegisterUserContextMenuCommand', optionsFn, registryOptions })\n\t);\n}\n\nfunction collectApplicationCommandDecorators<CMD extends Command>(target: CommandTarget<CMD>, decorator: DecoratorMap<CMD>): CommandTarget<CMD> {\n\tconst original = proxyApplicationCommandToOriginal.get(target) ?? target;\n\n\tconst exisiting = applicationDecoratorsMap.get(original) ?? [];\n\texisiting.push(decorator);\n\tapplicationDecoratorsMap.set(original, exisiting);\n\n\tif (originalApplicationCommandToProxy.has(original)) return originalApplicationCommandToProxy.get(original)!;\n\n\tconst proxied = createProxy(target, {\n\t\tconstruct(originalTarget, argArray) {\n\t\t\tconst command: CMD = Reflect.construct(originalTarget, argArray);\n\t\t\tconst decorators = applicationDecoratorsMap.get(original) as DecoratorMap<CMD>[];\n\n\t\t\tconst originalRegister = command.registerApplicationCommands?.bind(command);\n\t\t\tcommand.registerApplicationCommands = function registerApplicationCommands(registry: Command.Registry) {\n\t\t\t\tfor (const deco of decorators) {\n\t\t\t\t\tswitch (deco.type) {\n\t\t\t\t\t\tcase 'RegisterChatInputCommand': {\n\t\t\t\t\t\t\tregistry.registerChatInputCommand((builder) => deco.optionsFn(builder, command), deco.registryOptions);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcase 'RegisterMessageContextMenuCommand': {\n\t\t\t\t\t\t\tregistry.registerContextMenuCommand(\n\t\t\t\t\t\t\t\t(builder) => deco.optionsFn(builder, command).setType(ApplicationCommandType.Message),\n\t\t\t\t\t\t\t\tdeco.registryOptions\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcase 'RegisterUserContextMenuCommand': {\n\t\t\t\t\t\t\tregistry.registerContextMenuCommand(\n\t\t\t\t\t\t\t\t(builder) => deco.optionsFn(builder, command).setType(ApplicationCommandType.User),\n\t\t\t\t\t\t\t\tdeco.registryOptions\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (originalRegister) return originalRegister.call(this, registry);\n\t\t\t};\n\n\t\t\treturn command;\n\t\t}\n\t});\n\n\tproxyApplicationCommandToOriginal.set(proxied, original);\n\toriginalApplicationCommandToProxy.set(original, proxied);\n\n\treturn proxied;\n}\n\nexport interface ApplyOptionsCallbackParameters {\n\tcontainer: Container;\n\tcontext: Piece.LoaderContext;\n}\n\ninterface ChatInputCommandDecoratorsMap<CMD extends Command> {\n\ttype: 'RegisterChatInputCommand';\n\toptionsFn: (\n\t\tbuilder: SlashCommandBuilder,\n\t\tcommand: ThisType<CMD> & CMD\n\t) => SlashCommandBuilder | SlashCommandSubcommandsOnlyBuilder | SlashCommandOptionsOnlyBuilder;\n\tregistryOptions?: ApplicationCommandRegistryRegisterOptions;\n}\n\ninterface ContextMenuCommandDecoratorsMap<CMD extends Command> {\n\ttype: 'RegisterMessageContextMenuCommand' | 'RegisterUserContextMenuCommand';\n\toptionsFn: (\n\t\tbuilder: ContextMenuCommandBuilder, //\n\t\tcommand: ThisType<CMD> & CMD\n\t) => ContextMenuCommandBuilder;\n\tregistryOptions?: ApplicationCommandRegistryRegisterOptions;\n}\n\ntype CommandTarget<CMD extends Command> = Ctor<ConstructorParameters<typeof Command>, CMD>;\ntype DecoratorMap<CMD extends Command> = ChatInputCommandDecoratorsMap<CMD> | ContextMenuCommandDecoratorsMap<CMD>;\n"]}