@wolfstar/http-framework 2.3.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/dist/esm/index.d.ts +88 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +174 -45
- package/dist/esm/index.js.map +1 -1
- package/package.json +67 -68
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["container","container","container","container","container","container","container","container","container","Piece","Store","container","Piece","Store","container","Piece","Store","container","container"],"sources":["../../src/lib/api/HttpCodes.ts","../../src/lib/components/StringIdParser.ts","../../src/lib/interactions/decorators/_shared.ts","../../src/lib/interactions/decorators/RegisterCommand.ts","../../src/lib/interactions/decorators/RegisterMessageCommand.ts","../../src/lib/interactions/decorators/RegisterSubcommand.ts","../../src/lib/interactions/decorators/RegisterSubcommandGroup.ts","../../src/lib/interactions/decorators/RegisterUserCommand.ts","../../src/lib/interactions/decorators/RestrictGuildIds.ts","../../src/lib/interactions/resolvers/InteractionOptions.ts","../../src/lib/interactions/shared/link.ts","../../src/lib/interactions/resolvers/ChatInputCommandResolver.ts","../../src/lib/interactions/resolvers/ContextMenuCommandResolver.ts","../../src/lib/interactions/shared/ApplicationCommandRegistryEntry.ts","../../src/lib/interactions/shared/ApplicationCommandRegistry.ts","../../src/lib/utils/constants.ts","../../src/lib/interactions/structures/common/symbols.ts","../../src/lib/interactions/structures/interactions/base/BaseInteraction.ts","../../src/lib/interactions/structures/interactions/AutocompleteInteraction.ts","../../src/lib/interactions/structures/interactions/base/CommandInteraction.ts","../../src/lib/interactions/structures/interactions/base/MessageComponentInteraction.ts","../../src/lib/interactions/structures/interactions/ChatInputCommandInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentButtonInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentChannelSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentMentionableSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentRoleSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentStringSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentUserSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageContextMenuCommandInteraction.ts","../../src/lib/interactions/structures/interactions/ModalSubmitInteraction.ts","../../src/lib/interactions/structures/interactions/UserContextMenuCommandInteraction.ts","../../src/lib/interactions/utils/util.ts","../../src/lib/interactions/structures/Message.ts","../../src/lib/errors/ChatInputRouterError.ts","../../src/lib/interactions/router/CommandRouterSubcommand.ts","../../src/lib/interactions/router/CommandRouterSubcommandGroup.ts","../../src/lib/interactions/router/CommandRouter.ts","../../src/lib/structures/Command.ts","../../src/lib/structures/CommandLoaderStrategy.ts","../../src/lib/structures/CommandStoreRouter.ts","../../src/lib/structures/CommandStore.ts","../../src/lib/structures/InteractionHandler.ts","../../src/lib/structures/InteractionHandlerStore.ts","../../src/lib/structures/Listener.ts","../../src/lib/structures/ListenerLoaderStrategy.ts","../../src/lib/structures/ListenerStore.ts","../../src/lib/utils/security.ts","../../src/lib/utils/streams.ts","../../src/lib/Client.ts"],"sourcesContent":["// Copyright © 2020 - The Sapphire Community and its contributors | MIT\n// Source: https://github.com/sapphiredev/plugins/blob/a6471129ddab96146987a1dafa90f0576de8e2f2/packages/api/src/lib/structures/http/HttpCodes.ts\n\nexport enum HttpCodes {\n\t/**\n\t * Standard response for successful HTTP requests. The actual response will\n\t * depend on the request method used. In a GET request, the response will\n\t * contain an entity corresponding to the requested resource. In a POST\n\t * request, the response will contain an entity describing or containing the\n\t * result of the action.\n\t */\n\tOK = 200,\n\n\t/**\n\t * The request has been fulfilled, resulting in the creation of a new\n\t * resource.\n\t */\n\tCreated = 201,\n\n\t/**\n\t * The request has been accepted for processing, but the processing has not\n\t * been completed. The request might or might not be eventually acted upon,\n\t * and may be disallowed when processing occurs.\n\t */\n\tAccepted = 202,\n\n\t/**\n\t * The server is a transforming proxy (e.g. a Web accelerator) that received\n\t * a 200 OK from its origin, but is returning a modified version of the\n\t * origin's response.\n\t */\n\tNonAuthoritativeInformation = 203,\n\n\t/**\n\t * The server successfully processed the request, and is not returning any\n\t * content.\n\t */\n\tNoContent = 204,\n\n\t/**\n\t * The server successfully processed the request, asks that the requester\n\t * reset its document view, and is not returning any content.\n\t */\n\tResetContent = 205,\n\n\t/**\n\t * (RFC 7233) The server is delivering only part of the resource (byte\n\t * serving) due to a range header sent by the client. The range header is\n\t * used by HTTP clients to enable resuming of interrupted downloads, or\n\t * split a download into multiple simultaneous streams.\n\t */\n\tPartialContent = 206,\n\n\t/**\n\t * (WebDAV; RFC 4918) The message body that follows is by default an XML\n\t * message and can contain a number of separate response codes, depending on\n\t * how many sub-requests were made.\n\t */\n\tMultiStatus = 207,\n\n\t/**\n\t * (WebDAV; RFC 5842) The members of a DAV binding have already been\n\t * enumerated in a preceding part of the (multistatus) response, and are not\n\t * being included again.\n\t */\n\tAlreadyReported = 208,\n\n\t/**\n\t * (RFC 3229) The server has fulfilled a request for the resource, and the\n\t * response is a representation of the result of one or more\n\t * instance-manipulations applied to the current instance.\n\t */\n\tIMUsed = 226,\n\n\t/**\n\t * Indicates multiple options for the resource from which the client may\n\t * choose (via agent-driven content negotiation). For example, this code\n\t * could be used to present multiple video format options, to list files\n\t * with different filename extensions, or to suggest word-sense\n\t * disambiguation.\n\t */\n\tMultipleChoices = 300,\n\n\t/**\n\t * This and all future requests should be directed to the given URI.\n\t */\n\tMovedPermanently = 301,\n\n\t/**\n\t * (Previously \"Moved temporarily\") Tells the client to look at (browse to)\n\t * another URL. 302 has been superseded by 303 and 307. This is an example\n\t * of industry practice contradicting the standard. The HTTP/1.0\n\t * specification (RFC 1945) required the client to perform a temporary\n\t * redirect (the original describing phrase was \"Moved Temporarily\"), but\n\t * popular browsers implemented 302 with the functionality of a 303 See\n\t * Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish\n\t * between the two behaviours. However, some Web applications and frameworks\n\t * use the 302 status code as if it were the 303.\n\t */\n\tFound = 302,\n\n\t/**\n\t * The response to the request can be found under another URI using the GET\n\t * method. When received in response to a POST (or PUT/DELETE), the client\n\t * should presume that the server has received the data and should issue a\n\t * new GET request to the given URI.\n\t */\n\tSeeOther = 303,\n\n\t/**\n\t * (RFC 7232) Indicates that the resource has not been modified since the\n\t * version specified by the request headers If-Modified-Since or\n\t * If-None-Match. In such case, there is no need to retransmit the resource\n\t * since the client still has a previously-downloaded copy.\n\t */\n\tNotModified = 304,\n\n\t/**\n\t * The requested resource is available only through a proxy, the address for\n\t * which is provided in the response. For security reasons, many HTTP\n\t * clients (such as Mozilla Firefox and Internet Explorer) do not obey this\n\t * status code.\n\t */\n\tUseProxy = 305,\n\t/**\n\t * No longer used. Originally meant \"Subsequent requests should use the\n\t * specified proxy.\".\n\t */\n\tSwitchProxy = 306,\n\n\t/**\n\t * In this case, the request should be repeated with another URI; however,\n\t * future requests should still use the original URI. In contrast to how 302\n\t * was historically implemented, the request method is not allowed to be\n\t * changed when reissuing the original request. For example, a POST request\n\t * should be repeated using another POST request.\n\t */\n\tTemporaryRedirect = 307,\n\n\t/**\n\t * (RFC 7538) The request and all future requests should be repeated using\n\t * another URI. 307 and 308 parallel the behaviors of 302 and 301, but do\n\t * not allow the HTTP method to change. So, for example, submitting a form\n\t * to a permanently redirected resource may continue smoothly.\n\t */\n\tPermanentRedirect = 308,\n\n\t/**\n\t * The server cannot or will not process the request due to an apparent\n\t * client error (e.g., malformed request syntax, size too large, invalid\n\t * request message framing, or deceptive request routing).\n\t */\n\tBadRequest = 400,\n\n\t/**\n\t * (RFC 7235) Similar to 403 Forbidden, but specifically for use when\n\t * authentication is required and has failed or has not yet been provided.\n\t * The response must include a WWW-Authenticate header field containing a\n\t * challenge applicable to the requested resource. See Basic access\n\t * authentication and Digest access authentication. 401 semantically means\n\t * \"unauthorised\", the user does not have valid authentication credentials\n\t * for the target resource.\n\t */\n\tUnauthorized = 401,\n\n\t/**\n\t * Reserved for future use. The original intention was that this code might\n\t * be used as part of some form of digital cash or micropayment scheme, as\n\t * proposed, for example, by GNU Taler, but that has not yet happened, and\n\t * this code is not widely used. Google Developers API uses this status if a\n\t * particular developer has exceeded the daily limit on requests. Sipgate\n\t * uses this code if an account does not have sufficient funds to start a\n\t * call. Shopify uses this code when the store has not paid their fees and\n\t * is temporarily disabled. Stripe uses this code for failed payments where\n\t * parameters were correct, for example blocked fraudulent payments.\n\t */\n\tPaymentRequired = 402,\n\n\t/**\n\t * The request contained valid data and was understood by the server, but\n\t * the server is refusing action. This may be due to the user not having the\n\t * necessary permissions for a resource or needing an account of some sort,\n\t * or attempting a prohibited action (e.g. creating a duplicate record\n\t * where only one is allowed). This code is also typically used if the\n\t * request provided authentication by answering the WWW-Authenticate header\n\t * field challenge, but the server did not accept that authentication. The\n\t * request should not be repeated.\n\t */\n\tForbidden = 403,\n\n\t/**\n\t * The requested resource could not be found but may be available in the\n\t * future. Subsequent requests by the client are permissible.\n\t */\n\tNotFound = 404,\n\n\t/**\n\t * A request method is not supported for the requested resource; for example,\n\t * a GET request on a form that requires data to be presented via POST, or a\n\t * PUT request on a read-only resource.\n\t */\n\tMethodNotAllowed = 405,\n\n\t/**\n\t * The requested resource is capable of generating only content not\n\t * acceptable according to the Accept headers sent in the request. See Content negotiation.\n\t */\n\tNotAcceptable = 406,\n\n\t/**\n\t * (RFC 7235) The client must first authenticate itself with the proxy.\n\t */\n\tProxyAuthenticationRequired = 407,\n\n\t/**\n\t * The server timed out waiting for the request. According to HTTP\n\t * specifications: \"The client did not produce a request within the time\n\t * that the server was prepared to wait. The client MAY repeat the request\n\t * without modifications at any later time.\"\n\t */\n\tRequestTimeout = 408,\n\n\t/**\n\t * Indicates that the request could not be processed because of conflict in\n\t * the current state of the resource, such as an edit conflict between\n\t * multiple simultaneous updates.\n\t */\n\tConflict = 409,\n\n\t/**\n\t * Indicates that the resource requested is no longer available and will not\n\t * be available again. This should be used when a resource has been\n\t * intentionally removed and the resource should be purged. Upon receiving a\n\t * 410 status code, the client should not request the resource in the future.\n\t * Clients such as search engines should remove the resource from their\n\t * indices. Most use cases do not require clients and search engines to\n\t * purge the resource, and a \"404 Not Found\" may be used instead.\n\t */\n\tGone = 410,\n\n\t/**\n\t * The request did not specify the length of its content, which is required\n\t * by the requested resource.\n\t */\n\tLengthRequired = 411,\n\n\t/**\n\t * (RFC 7232) The server does not meet one of the preconditions that the\n\t * requester put on the request header fields.\n\t */\n\tPreconditionFailed = 412,\n\n\t/**\n\t * (RFC 7231) The request is larger than the server is willing or able to\n\t * process. Previously called \"Request Entity Too Large\".\n\t */\n\tPayloadTooLarge = 413,\n\n\t/**\n\t * (RFC 7231) The URI provided was too long for the server to process. Often\n\t * the result of too much data being encoded as a query-string of a GET\n\t * request, in which case it should be converted to a POST request. Called\n\t * \"Request-URI Too Long\" previously.\n\t */\n\tURITooLong = 414,\n\n\t/**\n\t * (RFC 7231) The request entity has a media type which the server or\n\t * resource does not support. For example, the client uploads an image as\n\t * image/svg+xml, but the server requires that images use a different format.\n\t */\n\tUnsupportedMediaType = 415,\n\n\t/**\n\t * (RFC 7233) The client has asked for a portion of the file (byte serving),\n\t * but the server cannot supply that portion. For example, if the client\n\t * asked for a part of the file that lies beyond the end of the file. Called\n\t * \"Requested Range Not Satisfiable\" previously.\n\t */\n\tRangeNotSatisfiable = 416,\n\n\t/**\n\t * The server cannot meet the requirements of the Expect request-header\n\t * field.\n\t */\n\tExpectationFailed = 417,\n\n\t/**\n\t * (RFC 2324, RFC 7168) This code was defined in 1998 as one of the\n\t * traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot\n\t * Control Protocol, and is not expected to be implemented by actual HTTP\n\t * servers. The RFC specifies this code should be returned by teapots\n\t * requested to brew coffee. This HTTP status is used as an Easter egg in\n\t * some websites, such as Google.com's I'm a teapot easter egg.\n\t */\n\tIAmATeapot = 418,\n\n\t/**\n\t * Returned by the Twitter Search and Trends API when the client is being rate limited.\n\t * The text is a quote from 'Demolition Man' and the '420' code is likely a reference\n\t * to this number's association with marijuana. Other services may wish to implement\n\t * the 429 Too Many Requests response code instead.\n\t */\n\tEnhanceYourCalm = 420,\n\n\t/**\n\t * (RFC 7540) The request was directed at a server that is not able to\n\t * produce a response (for example because of connection reuse).\n\t */\n\tMisdirectedRequest = 421,\n\n\t/**\n\t * (WebDAV; RFC 4918) The request was well-formed but was unable to be\n\t * followed due to semantic errors.\n\t */\n\tUnprocessableEntity = 422,\n\n\t/**\n\t * (WebDAV; RFC 4918) The resource that is being accessed is locked.\n\t */\n\tLocked = 423,\n\n\t/**\n\t * (WebDAV; RFC 4918) The request failed because it depended on another\n\t * request and that request failed (e.g., a PROPPATCH).\n\t */\n\tFailedDependency = 424,\n\n\t/**\n\t * (RFC 8470) Indicates that the server is unwilling to risk processing a\n\t * request that might be replayed.\n\t */\n\tTooEarly = 425,\n\n\t/**\n\t * The client should switch to a different protocol such as TLS/1.0, given\n\t * in the Upgrade header field.\n\t */\n\tUpgradeRequired = 426,\n\n\t/**\n\t * (RFC 6585) The origin server requires the request to be conditional.\n\t * Intended to prevent the 'lost update' problem, where a client GETs a\n\t * resource's state, modifies it, and PUTs it back to the server, when\n\t * meanwhile a third party has modified the state on the server, leading to\n\t * a conflict.\n\t */\n\tPreconditionRequired = 428,\n\n\t/**\n\t * (RFC 6585) The user has sent too many requests in a given amount of time.\n\t * Intended for use with rate-limiting schemes.\n\t */\n\tTooManyRequests = 429,\n\n\t/**\n\t * (RFC 6585) The server is unwilling to process the request because either\n\t * an individual header field, or all the header fields collectively, are\n\t * too large.\n\t */\n\tRequestHeaderFieldsTooLarge = 431,\n\n\t/**\n\t * (RFC 7725) A server operator has received a legal demand to deny access\n\t * to a resource or to a set of resources that includes the requested\n\t * resource. The code 451 was chosen as a reference to the novel Fahrenheit\n\t * 451 (see the Acknowledgements in the RFC).\n\t */\n\tUnavailableForLegalReasons = 451,\n\n\t/**\n\t * A generic error message, given when an unexpected condition was\n\t * encountered and no more specific message is suitable.\n\t */\n\tInternalServerError = 500,\n\n\t/**\n\t * The server either does not recognize the request method, or it lacks the\n\t * ability to fulfil the request. Usually this implies future availability\n\t * (e.g., a new feature of a web-service API).\n\t */\n\tNotImplemented = 501,\n\n\t/**\n\t * The server was acting as a gateway or proxy and received an invalid\n\t * response from the upstream server.\n\t */\n\tBadGateway = 502,\n\n\t/**\n\t * The server cannot handle the request (because it is overloaded or down\n\t * for maintenance). Generally, this is a temporary state.\n\t */\n\tServiceUnavailable = 503,\n\n\t/**\n\t * The server was acting as a gateway or proxy and did not receive a timely\n\t * response from the upstream server.\n\t */\n\tGatewayTimeout = 504,\n\n\t/**\n\t * The server does not support the HTTP protocol version used in the request.\n\t */\n\tHTTPVersionNotSupported = 505,\n\n\t/**\n\t * (RFC 2295) Transparent content negotiation for the request results in a\n\t * circular reference.\n\t */\n\tVariantAlsoNegotiates = 506,\n\n\t/**\n\t * (WebDAV; RFC 4918) The server is unable to store the representation\n\t * needed to complete the request.\n\t */\n\tInsufficientStorage = 507,\n\n\t/**\n\t * (WebDAV; RFC 5842) The server detected an infinite loop while processing\n\t * the request (sent instead of 208 Already Reported).\n\t */\n\tLoopDetected = 508,\n\n\t/**\n\t * (RFC 2774) Further extensions to the request are required for the server\n\t * to fulfil it.\n\t */\n\tNotExtended = 510,\n\n\t/**\n\t * (RFC 6585) The client needs to authenticate to gain network access.\n\t * Intended for use by intercepting proxies used to control access to the\n\t * network (e.g., \"captive portals\" used to require agreement to Terms of\n\t * Service before granting full Internet access via a Wi-Fi hotspot).\n\t */\n\tNetworkAuthenticationRequired = 511\n}\n","import type { IdParserRead, IIdParser } from './IIdParser.js';\n\nexport class StringIdParser implements IIdParser {\n\tpublic run(customId: string): IdParserRead | null {\n\t\tif (customId.length === 0) return null;\n\n\t\tconst index = customId.indexOf('.');\n\n\t\tif (index === -1) {\n\t\t\treturn { name: customId, content: null };\n\t\t}\n\n\t\treturn {\n\t\t\tname: customId.slice(0, index),\n\t\t\tcontent: customId\n\t\t\t\t.slice(index + 1)\n\t\t\t\t.split('.')\n\t\t\t\t.map((contentEntry) => contentEntry || null)\n\t\t};\n\t}\n}\n","import { container } from '@sapphire/pieces';\nimport type { Command } from '../../structures/Command.js';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver';\nimport type { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver.js';\n\nexport function ensureChatInputCommandResolver<Options extends Command.Options>(target: typeof Command<Options>): ChatInputCommandResolver {\n\treturn container.applicationCommandRegistry.ensure(target).makeChatInput();\n}\n\nexport function ensureContextMenuCommandResolver<Options extends Command.Options>(target: typeof Command<Options>): ContextMenuCommandResolver {\n\treturn container.applicationCommandRegistry.ensure(target).makeContextMenu();\n}\n","import type { Command } from '../../structures/Command';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver';\nimport { ensureChatInputCommandResolver } from './_shared';\n\n/**\n * Registers a command for the chat input.\n *\n * @template Options - The options type for the command.\n * @param data - The command data.\n * @example\n * ```typescript\n * import { Command, RegisterCommand } from '@wolfstar/http-framework';\n *\n * (at)RegisterCommand({\n * \tname: 'ping',\n * \tdescription: 'A simple ping pong command'\n * })\n * export class UserCommand extends Command {\n * \tpublic async run(interaction: Command.ChatInputInteraction) {\n * \t\treturn interaction.reply('Pong!');\n * \t}\n * }\n * ```\n */\nexport function RegisterCommand<Options extends Command.Options = Command.Options>(data: ChatInputCommandResolver.CommandData) {\n\treturn function decorate(target: typeof Command<Options>) {\n\t\tensureChatInputCommandResolver(target).setCommand(data);\n\t};\n}\n","import { ApplicationCommandType } from 'discord-api-types/v10';\nimport type { Command } from '../../structures/Command';\nimport type { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver';\nimport { ensureContextMenuCommandResolver } from './_shared';\n\n/**\n * Registers a message command.\n *\n * @template Options - The options type for the command.\n * @param data - The command to register.\n * @returns A method decorator function, does not override the method.\n * @example\n * ```typescript\n * export class UserCommand extends Command {\n * \t(at)RegisterMessageCommand(createData())\n * \tpublic run(interaction: Command.MessageInteraction, data: TransformedArguments.Message) {\n * \t\t// ...\n * \t}\n * }\n * ```\n */\nexport function RegisterMessageCommand<Options extends Command.Options = Command.Options>(data: ContextMenuCommandResolver.CommandData) {\n\treturn function decorate(target: Command<Options>, method: string) {\n\t\tensureContextMenuCommandResolver(target.constructor as typeof Command).setCommand(data, ApplicationCommandType.Message, method);\n\t};\n}\n","import type { Command } from '../../structures/Command';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver';\nimport { ensureChatInputCommandResolver } from './_shared';\n\n/**\n * Registers a subcommand for a chat input command.\n *\n * @remarks This decorator must be used in conjunction with {@link RegisterSubcommand}.\n * @param data - The subcommand data.\n * @param subCommandGroupName - Optional name of the subcommand group.\n * @returns A decorator function that adds the subcommand to the target command.\n * @example\n * ```typescript\n * import { Command, RegisterCommand, RegisterSubcommand, RegisterSubcommandGroup } from '@wolfstar/http-framework';\n *\n * (at)RegisterCommand({\n * \tname: 'ping',\n * \tdescription: 'A simple ping pong command'\n * })\n * export class UserCommand extends Command {\n * \t(at)RegisterSubcommand({\n * \t\tname: 'subcommand',\n * \t\tdescription: 'A simple subcommand'\n * \t})\n * \tpublic async run(interaction: Command.ChatInputInteraction) {\n * \t\treturn interaction.reply('Pong!');\n * \t}\n * }\n * ```\n */\nexport function RegisterSubcommand<Options extends Command.Options = Command.Options>(\n\tdata: ChatInputCommandResolver.SubcommandData,\n\tsubCommandGroupName?: string | null\n) {\n\treturn function decorate(target: Command<Options>, method: string) {\n\t\tensureChatInputCommandResolver(target.constructor as typeof Command).addSubcommand(data, method, subCommandGroupName);\n\t};\n}\n","import type { Command } from '../../structures/Command';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver';\nimport { ensureChatInputCommandResolver } from './_shared';\n\n/**\n * Registers a subcommand group for a chat input command.\n *\n * @remarks This decorator must be used in conjunction with {@link RegisterSubcommand}.\n * @template Options - The options type for the command.\n * @param data - The subcommand group data.\n * @example\n * ```typescript\n * import { Command, RegisterCommand, RegisterSubcommand, RegisterSubcommandGroup } from '@wolfstar/http-framework';\n *\n * (at)RegisterCommand({\n * \tname: 'ping',\n * \tdescription: 'A simple ping pong command'\n * })\n * export class UserCommand extends Command {\n * \t(at)RegisterSubcommandGroup({\n * \t\tname: 'subcommand-group',\n * \t\tdescription: 'A simple subcommand group'\n * \t})\n * \t(at)RegisterSubcommand(\n * \t\t{ name: 'subcommand', description: 'A simple subcommand' },\n * \t\t'subcommand-group'\n * \t)\n * \tpublic async run(interaction: Command.ChatInputInteraction) {\n * \t\treturn interaction.reply('Pong!');\n * \t}\n * }\n * ```\n */\nexport function RegisterSubcommandGroup<Options extends Command.Options = Command.Options>(data: ChatInputCommandResolver.SubcommandGroupData) {\n\treturn function decorate(target: Command<Options>, method: string) {\n\t\tensureChatInputCommandResolver(target.constructor as typeof Command).addSubcommandGroup(data, method);\n\t};\n}\n","import { ApplicationCommandType } from 'discord-api-types/v10';\nimport type { Command } from '../../structures/Command';\nimport type { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver';\nimport { ensureContextMenuCommandResolver } from './_shared';\n\n/**\n * Registers a user command.\n *\n * @template Options - The options type for the command.\n * @param data - The command to register.\n * @returns A method decorator function, does not override the method.\n * @example\n * ```typescript\n * export class UserCommand extends Command {\n * \t(at)RegisterUserCommand(createData())\n * \tpublic run(interaction: Command.UserInteraction, data: TransformedArguments.User) {\n * \t\t// ...\n * \t}\n * }\n * ```\n */\nexport function RegisterUserCommand<Options extends Command.Options = Command.Options>(data: ContextMenuCommandResolver.CommandData) {\n\treturn function decorate(target: Command<Options>, method: string) {\n\t\tensureContextMenuCommandResolver(target.constructor as typeof Command).setCommand(data, ApplicationCommandType.User, method);\n\t};\n}\n","import { Collection } from '@discordjs/collection';\nimport type { Command } from '../../structures/Command.js';\n\nexport const restrictedGuildIdRegistry = new Collection<typeof Command<Command.Options>, readonly string[]>();\n\n/**\n * Decorator that restricts the guild IDs for a command.\n *\n * @param guildIds An array of guild IDs to restrict the command to.\n * @returns A decorator function.\n * @example\n * ```typescript\n * import { Command, RegisterCommand, RestrictGuildIds } from '@wolfstar/http-framework';\n *\n * (at)RegisterCommand({\n * \tname: 'ping',\n * \tdescription: 'A simple ping pong command'\n * })\n * (at)RestrictGuildIds(['123456789012345678', '123456789012345679'])\n * export class UserCommand extends Command {\n * \tpublic async run(interaction: Command.ChatInputInteraction) {\n * \t\treturn interaction.reply('Pong!');\n * \t}\n * }\n * ```\n */\nexport function RestrictGuildIds<Options extends Command.Options = Command.Options>(guildIds: readonly string[]) {\n\treturn function decorate(target: typeof Command<Options>) {\n\t\trestrictedGuildIdRegistry.set(target, guildIds);\n\t};\n}\n","import type { NonNullObject } from '@sapphire/utilities';\nimport {\n\tApplicationCommandOptionType,\n\ttype APIApplicationCommandInteractionDataBasicOption,\n\ttype APIApplicationCommandInteractionDataMentionableOption,\n\ttype APIApplicationCommandInteractionDataOption,\n\ttype APIApplicationCommandInteractionDataSubcommandGroupOption,\n\ttype APIApplicationCommandInteractionDataSubcommandOption,\n\ttype APIAttachment,\n\ttype APIInteractionDataResolved,\n\ttype APIInteractionDataResolvedChannel,\n\ttype APIInteractionDataResolvedGuildMember,\n\ttype APIMessage,\n\ttype APIMessageApplicationCommandInteractionData,\n\ttype APIRole,\n\ttype APIUser,\n\ttype APIUserApplicationCommandInteractionData\n} from 'discord-api-types/v10';\n\nexport function transformInteraction<T extends NonNullObject>(\n\tresolved: APIInteractionDataResolved,\n\toptions: readonly APIApplicationCommandInteractionDataOption[]\n): InteractionArguments<T> {\n\tconst extracted = extractTopLevelOptions(options);\n\treturn {\n\t\tsubCommand: extracted.subCommand?.name ?? null,\n\t\tsubCommandGroup: extracted.subCommandGroup?.name ?? null,\n\t\t...(transformArguments(resolved, extracted.options) as T)\n\t};\n}\n\nexport type InteractionArguments<T extends NonNullObject> = T & {\n\t/**\n\t * The name of the subcommand that was used by the user, if any.\n\t */\n\tsubCommand: string | null;\n\n\t/**\n\t * The name of the subcommand group that was used by the user, if any.\n\t */\n\tsubCommandGroup: string | null;\n};\n\nexport function transformAutocompleteInteraction<T extends NonNullObject>(\n\tresolved: APIInteractionDataResolved,\n\toptions: readonly APIApplicationCommandInteractionDataOption[]\n): AutocompleteInteractionArguments<T> {\n\tconst extracted = extractTopLevelOptions(options);\n\tconst focused = extracted.options.find((option) => (option as any).focused);\n\treturn {\n\t\tsubCommand: extracted.subCommand?.name ?? null,\n\t\tsubCommandGroup: extracted.subCommandGroup?.name ?? null,\n\t\tfocused: typeof focused === 'undefined' ? null : (focused.name as keyof T),\n\t\t...(transformArguments(resolved, extracted.options) as T)\n\t};\n}\n\nexport type AutocompleteInteractionArguments<T extends NonNullObject> = InteractionArguments<T> & {\n\t/**\n\t * The name of the argument that is focused, if any.\n\t */\n\tfocused: keyof T | null;\n};\n\nexport function extractTopLevelOptions(options: readonly APIApplicationCommandInteractionDataOption[]): ExtractedOptions {\n\tif (options.length) {\n\t\tconst [firstOption] = options;\n\t\tif (firstOption.type === ApplicationCommandOptionType.SubcommandGroup) {\n\t\t\tconst subCommand = firstOption.options[0];\n\t\t\treturn {\n\t\t\t\tsubCommandGroup: firstOption,\n\t\t\t\tsubCommand,\n\t\t\t\toptions: subCommand.options ?? []\n\t\t\t};\n\t\t}\n\n\t\tif (firstOption.type === ApplicationCommandOptionType.Subcommand) {\n\t\t\treturn {\n\t\t\t\tsubCommandGroup: null,\n\t\t\t\tsubCommand: firstOption,\n\t\t\t\toptions: firstOption.options ?? []\n\t\t\t};\n\t\t}\n\t}\n\n\treturn {\n\t\tsubCommandGroup: null,\n\t\tsubCommand: null,\n\t\toptions: options as readonly APIApplicationCommandInteractionDataBasicOption[]\n\t};\n}\n\nexport interface ExtractedOptions {\n\tsubCommandGroup: APIApplicationCommandInteractionDataSubcommandGroupOption | null;\n\tsubCommand: APIApplicationCommandInteractionDataSubcommandOption | null;\n\toptions: readonly APIApplicationCommandInteractionDataBasicOption[];\n}\n\nfunction transformArguments(\n\tresolved: APIInteractionDataResolved,\n\toptions: readonly APIApplicationCommandInteractionDataBasicOption[]\n): NonNullObject {\n\treturn Object.fromEntries(options.map((option) => [option.name, transformArgument(resolved, option)]));\n}\n\nfunction transformArgument(resolved: APIInteractionDataResolved, option: APIApplicationCommandInteractionDataBasicOption): TransformedArguments.Any {\n\tswitch (option.type) {\n\t\tcase ApplicationCommandOptionType.Attachment:\n\t\t\treturn resolved.attachments?.[option.value] ?? { id: option.value };\n\t\tcase ApplicationCommandOptionType.Channel:\n\t\t\treturn resolved.channels?.[option.value] ?? { id: option.value };\n\t\tcase ApplicationCommandOptionType.Mentionable:\n\t\t\treturn transformMentionable(resolved, option);\n\t\tcase ApplicationCommandOptionType.Role:\n\t\t\treturn resolved.roles?.[option.value] ?? { id: option.value };\n\t\tcase ApplicationCommandOptionType.User:\n\t\t\treturn { id: option.value, user: resolved.users?.[option.value] ?? null, member: resolved.members?.[option.value] ?? null };\n\t\tdefault:\n\t\t\treturn option.value;\n\t}\n}\n\nfunction transformMentionable(\n\tresolved: APIInteractionDataResolved,\n\toption: APIApplicationCommandInteractionDataMentionableOption\n): TransformedArguments.Mentionable {\n\tconst id = option.value;\n\n\tconst user = resolved.users?.[id];\n\tif (user) return { id, user, member: resolved.members?.[id] ?? null };\n\n\tconst channel = resolved.channels?.[id];\n\tif (channel) return { id, channel };\n\n\tconst role = resolved.roles?.[id];\n\tif (role) return { id, role };\n\n\treturn { id };\n}\n\nexport function transformUserInteraction(data: APIUserApplicationCommandInteractionData): TransformedArguments.User {\n\treturn { id: data.target_id, user: data.resolved.users[data.target_id], member: data.resolved.members?.[data.target_id] ?? null };\n}\n\nexport function transformMessageInteraction(data: APIMessageApplicationCommandInteractionData): TransformedArguments.Message {\n\treturn { id: data.target_id, message: data.resolved.messages[data.target_id] };\n}\n\nexport namespace TransformedArguments {\n\texport interface BasePartial {\n\t\tid: string;\n\t}\n\n\texport interface Message extends BasePartial {\n\t\tmessage: APIMessage;\n\t}\n\n\texport interface User extends BasePartial {\n\t\tuser: APIUser;\n\t\tmember: APIInteractionDataResolvedGuildMember | null;\n\t}\n\n\texport type Channel = APIInteractionDataResolvedChannel;\n\texport type Role = APIRole;\n\texport type Attachment = APIAttachment;\n\n\texport type Mentionable =\n\t\t| (BasePartial & User) //\n\t\t| (BasePartial & { channel: Channel })\n\t\t| (BasePartial & { role: Role })\n\t\t| BasePartial;\n\n\texport type Any = User | Channel | Role | Mentionable | number | string | boolean | Attachment | PartialAny;\n\n\texport interface PartialUser extends Omit<User, 'user'> {\n\t\tuser: User['user'] | null;\n\t}\n\n\texport type PartialAttachment = BasePartial;\n\texport type PartialChannel = BasePartial;\n\texport type PartialRole = BasePartial;\n\n\texport type PartialAny = PartialUser | PartialChannel | PartialRole | PartialAttachment;\n}\n\n/**\n * A map of the argument types to their respective resolved values.\n */\nexport interface ArgumentTypes {\n\t[ApplicationCommandOptionType.Attachment]: TransformedArguments.Attachment;\n\t[ApplicationCommandOptionType.Boolean]: boolean;\n\t[ApplicationCommandOptionType.Channel]: TransformedArguments.Channel;\n\t[ApplicationCommandOptionType.Integer]: number;\n\t[ApplicationCommandOptionType.Mentionable]: TransformedArguments.Mentionable;\n\t[ApplicationCommandOptionType.Number]: number;\n\t[ApplicationCommandOptionType.Role]: TransformedArguments.Role;\n\t[ApplicationCommandOptionType.String]: string;\n\t[ApplicationCommandOptionType.User]: TransformedArguments.User;\n\tattachment: this[ApplicationCommandOptionType.Attachment];\n\tboolean: this[ApplicationCommandOptionType.Boolean];\n\tchannel: this[ApplicationCommandOptionType.Channel];\n\tinteger: this[ApplicationCommandOptionType.Integer];\n\tmentionable: this[ApplicationCommandOptionType.Mentionable];\n\tnumber: this[ApplicationCommandOptionType.Number];\n\trole: this[ApplicationCommandOptionType.Role];\n\tstring: this[ApplicationCommandOptionType.String];\n\tuser: this[ApplicationCommandOptionType.User];\n}\n\n/**\n * Convenience type for creating arguments out of strings.\n *\n * @example\n * ```typescript\n * // Using named string:\n * type Options = MakeArguments<{\n * \tname: 'string';\n * \tfile: 'attachment';\n * }>;\n *\n * // ➥ type Options = {\n * // \tname: string;\n * // \tattachment: APIAttachment;\n * // };\n * ```\n *\n * @example\n * ```typescript\n * // Using named string:\n * type Options = MakeArguments<{\n * \tname: ApplicationCommandOptionType.String;\n * \tfile: ApplicationCommandOptionType.Attachment;\n * }>;\n *\n * // ➥ type Options = {\n * // \tname: string;\n * // \tattachment: APIAttachment;\n * // };\n * ```\n */\nexport type MakeArguments<T extends Record<string, keyof ArgumentTypes>> = { [K in keyof T]: ArgumentTypes[T[K]] };\n","const linkSymbol = Symbol('decorated-command.method.link');\n\n/**\n * Links the specified object with a name.\n *\n * @template T - The type of the object.\n * @param object - The object to link.\n * @param name - The name to link the object with.\n * @returns The linked object.\n * @internal\n */\nexport function linkMethod<T extends object>(object: T, name: string): T {\n\tObject.defineProperty(object, linkSymbol, { value: name });\n\treturn object;\n}\n\n/**\n * Retrieves the linked method from the given object.\n *\n * @param object - The object from which to retrieve the method.\n * @returns The name of the linked method as a string, or `null` if not found.\n * @internal\n */\nexport function getLinkedMethod(object: object): string | null {\n\treturn Reflect.get(object, linkSymbol) ?? null;\n}\n","import { SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from '@discordjs/builders';\nimport { isJSONEncodable, type JSONEncodable } from '@discordjs/util';\nimport { isFunction, isNullish } from '@sapphire/utilities';\nimport {\n\tApplicationCommandOptionType,\n\tApplicationCommandType,\n\ttype APIApplicationCommandOption,\n\ttype APIApplicationCommandSubcommandGroupOption,\n\ttype APIApplicationCommandSubcommandOption,\n\ttype RESTPostAPIChatInputApplicationCommandsJSONBody\n} from 'discord-api-types/v10';\nimport type { Void } from '../../utils/internals.js';\nimport { getLinkedMethod, linkMethod } from '../shared/link.js';\n\n/**\n * The command resolver for chat input commands.\n * @internal\n */\nexport class ChatInputCommandResolver implements JSONEncodable<ChatInputCommandResolver.ResolvedCommand> {\n\t#data: ChatInputCommandResolver.ResolvedCommand | null = null;\n\t#commandData: ChatInputCommandResolver.CommandData | null = null;\n\t#subcommandGroupData: [method: string | null, ChatInputCommandResolver.SubcommandGroupData][] = [];\n\t#subcommandData: (readonly [method: string | null, groupName: string | null, data: ChatInputCommandResolver.SubcommandData])[] = [];\n\n\t/**\n\t * Sets the command data for the ChatInputCommandResolver.\n\t *\n\t * @param data - The command data to set.\n\t * @returns The instance of ChatInputCommandResolver.\n\t */\n\tpublic setCommand(data: ChatInputCommandResolver.CommandData) {\n\t\tthis.#commandData = data;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a subcommand group to the ChatInputCommandResolver.\n\t *\n\t * @param data - The data of the subcommand group.\n\t * @param method - The method associated with the subcommand group (optional).\n\t * @returns The updated ChatInputCommandResolver instance.\n\t */\n\tpublic addSubcommandGroup(data: ChatInputCommandResolver.SubcommandGroupData, method?: string | null) {\n\t\tthis.#subcommandGroupData.push([method ?? null, data]);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a subcommand to the ChatInputCommandResolver.\n\t *\n\t * @param data - The data of the subcommand.\n\t * @param method - The method of the subcommand (optional).\n\t * @param groupName - The group name of the subcommand (optional).\n\t * @returns The updated ChatInputCommandResolver instance.\n\t */\n\tpublic addSubcommand(data: ChatInputCommandResolver.SubcommandData, method?: string | null, groupName?: string | null): this {\n\t\tthis.#subcommandData.push([method ?? null, groupName ?? null, data]);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Converts the ChatInputCommandResolver instance to a JSON representation.\n\t *\n\t * @returns The JSON representation of the ChatInputCommandResolver instance.\n\t */\n\tpublic toJSON(): ChatInputCommandResolver.ResolvedCommand {\n\t\treturn (this.#data ??= this.#resolve());\n\t}\n\n\t/**\n\t * Resolves the chat input command.\n\t *\n\t * @returns The resolved command.\n\t */\n\t#resolve(): ChatInputCommandResolver.ResolvedCommand {\n\t\tconst command = this.#normalizeCommand(this.#commandData);\n\t\tthis.#resolveSubcommandGroups(command);\n\t\tthis.#resolveSubcommands(command);\n\n\t\treturn command;\n\t}\n\n\t/**\n\t * Resolves the subcommand groups for the given command.\n\t *\n\t * @param command The resolved command.\n\t */\n\t#resolveSubcommandGroups(command: ChatInputCommandResolver.ResolvedCommand) {\n\t\tif (this.#subcommandGroupData.length === 0) return;\n\n\t\tcommand.options ??= [];\n\t\tfor (const [method, entry] of this.#subcommandGroupData) {\n\t\t\tlet data = this.#normalizeSubcommandGroup(entry);\n\t\t\tconst index = command.options.findIndex((option) => option.name === data.name);\n\t\t\tif (index === -1) {\n\t\t\t\tcommand.options.push(data);\n\t\t\t} else {\n\t\t\t\tdata = this.#mergeOption(command.options[index], data);\n\t\t\t\tcommand.options[index] = data;\n\t\t\t}\n\n\t\t\tif (method) linkMethod(data, method);\n\t\t}\n\t}\n\n\t/**\n\t * Resolves the subcommands for a given command.\n\t *\n\t * @param command - The resolved command object.\n\t */\n\t#resolveSubcommands(command: ChatInputCommandResolver.ResolvedCommand) {\n\t\tif (this.#subcommandData.length === 0) return;\n\n\t\tcommand.options ??= [];\n\t\tfor (const [method, groupName, entry] of this.#subcommandData) {\n\t\t\tlet data = this.#normalizeSubcommand(entry);\n\n\t\t\tlet parent: ChatInputCommandResolver.ResolvedCommand | ChatInputCommandResolver.ResolvedSubcommandGroup;\n\t\t\tif (groupName === null) {\n\t\t\t\tparent = command;\n\t\t\t} else {\n\t\t\t\tconst group = command.options.find((option) => option.name === groupName) as APIApplicationCommandOption | undefined;\n\t\t\t\tif (group === undefined) {\n\t\t\t\t\tthrow new Error(`The command '${command.name}' has no subcommand group named '${groupName}'`);\n\t\t\t\t}\n\n\t\t\t\tif (group.type !== ApplicationCommandOptionType.SubcommandGroup) {\n\t\t\t\t\tthrow new Error(`The command '${command.name}' has an option named '${groupName}' that is not a group`);\n\t\t\t\t}\n\n\t\t\t\tparent = group;\n\t\t\t}\n\n\t\t\tparent.options ??= [];\n\t\t\tconst index = parent.options.findIndex((option) => option.name === data.name);\n\t\t\tif (index === -1) {\n\t\t\t\tparent.options.push(data);\n\t\t\t} else {\n\t\t\t\tdata = this.#mergeOption(parent.options[index], data);\n\t\t\t\tparent.options[index] = data;\n\t\t\t}\n\n\t\t\tif (!method) continue;\n\n\t\t\tconst dataMethod = getLinkedMethod(data);\n\t\t\tif (dataMethod) {\n\t\t\t\tif (dataMethod !== method) {\n\t\t\t\t\tthrow new Error(`The command '${command.name}' has a subcommand named '${data.name}' that was already linked to '${dataMethod}'`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlinkMethod(data, method);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Normalizes the command data and returns the resolved command.\n\t *\n\t * @param data The command data to be normalized.\n\t * @returns The resolved command.\n\t * @throws An `Error` if the command data is null or undefined.\n\t */\n\t#normalizeCommand(data: ChatInputCommandResolver.CommandData | null): ChatInputCommandResolver.ResolvedCommand {\n\t\tif (isNullish(data)) {\n\t\t\tthrow new Error('Could not normalize command data');\n\t\t}\n\n\t\tif (isFunction(data)) {\n\t\t\tconst builder = new SlashCommandBuilder();\n\t\t\tdata = data(builder) ?? builder;\n\t\t}\n\n\t\treturn { type: ApplicationCommandType.ChatInput, ...(isJSONEncodable(data) ? data.toJSON() : data) };\n\t}\n\n\t/**\n\t * Normalizes the subcommand group data and returns the resolved subcommand group.\n\t *\n\t * @param data - The subcommand group data to be normalized.\n\t * @returns The normalized subcommand group.\n\t */\n\t#normalizeSubcommandGroup(data: ChatInputCommandResolver.SubcommandGroupData): ChatInputCommandResolver.ResolvedSubcommandGroup {\n\t\tif (isFunction(data)) {\n\t\t\tconst builder = new SlashCommandSubcommandGroupBuilder();\n\t\t\tdata = data(builder) ?? builder;\n\t\t}\n\n\t\treturn { type: ApplicationCommandOptionType.SubcommandGroup, ...(isJSONEncodable(data) ? data.toJSON() : data) };\n\t}\n\n\t/**\n\t * Normalizes the subcommand data and returns the resolved subcommand.\n\t *\n\t * @param data - The subcommand data to be normalized.\n\t * @returns The resolved subcommand.\n\t */\n\t#normalizeSubcommand(data: ChatInputCommandResolver.SubcommandData): ChatInputCommandResolver.ResolvedSubcommand {\n\t\tif (isFunction(data)) {\n\t\t\tconst builder = new SlashCommandSubcommandBuilder();\n\t\t\tdata = data(builder) ?? builder;\n\t\t}\n\n\t\treturn { type: ApplicationCommandOptionType.Subcommand, ...(isJSONEncodable(data) ? data.toJSON() : data) };\n\t}\n\n\t/**\n\t * Merges two arrays of {@linkcode APIApplicationCommandOption} objects.\n\t *\n\t * - If the 'existing' array is empty or undefined, the 'data' array is returned.\n\t * - If the 'data' array is empty or undefined, the 'existing' array is returned.\n\t * - If both arrays have elements, the options with the same name are merged.\n\t *\n\t * @param existing The existing array of {@linkcode APIApplicationCommandOption} objects.\n\t * @param data The data array of {@linkcode APIApplicationCommandOption} objects.\n\t * @returns The merged array of {@linkcode APIApplicationCommandOption} objects.\n\t */\n\t#mergeOptions(\n\t\texisting: APIApplicationCommandOption[] | undefined,\n\t\tdata: APIApplicationCommandOption[] | undefined\n\t): APIApplicationCommandOption[] {\n\t\tif (!existing?.length) return data ?? [];\n\t\tif (!data?.length) return existing;\n\n\t\tconst entries = new Map(existing.map((option) => [option.name, option]));\n\t\tfor (const option of data) {\n\t\t\tentries.set(option.name, this.#mergeOption(entries.get(option.name), option));\n\t\t}\n\n\t\treturn [...entries.values()];\n\t}\n\n\t/**\n\t * Merges two {@linkcode APIApplicationCommandOption} objects.\n\t *\n\t * - If the `existing` option is not provided, the `data` option is returned.\n\t * - If the types of the existing and data options do not match, a {@link TypeError} is thrown.\n\t * - If both existing and data options have 'options' property, the options are recursively merged.\n\t * - Otherwise, the options are shallow merged.\n\t * - If a method is present in either the data or existing option, it is linked to the merged option.\n\t *\n\t * @param existing - The existing {@linkcode APIApplicationCommandOption} object.\n\t * @param data - The data {@linkcode APIApplicationCommandOption} object.\n\t * @returns The merged {@linkcode APIApplicationCommandOption} object.\n\t */\n\t#mergeOption<Option extends APIApplicationCommandOption>(existing: APIApplicationCommandOption | undefined, data: Option): Option {\n\t\tif (!existing) return data;\n\t\tif (existing.type !== data.type) {\n\t\t\tconst existingType = ApplicationCommandOptionType[existing.type];\n\t\t\tconst dataType = ApplicationCommandOptionType[data.type];\n\t\t\tthrow new TypeError(`Mismatching types, expected '${existingType}', but received '${dataType}'`);\n\t\t}\n\n\t\tconst merged =\n\t\t\t'options' in existing && 'options' in data\n\t\t\t\t? { ...existing, ...data, options: this.#mergeOptions(existing.options, data.options) }\n\t\t\t\t: { ...existing, ...data };\n\n\t\tconst method = getLinkedMethod(data) ?? getLinkedMethod(existing);\n\t\treturn method ? linkMethod(merged, method) : merged;\n\t}\n}\n\nexport namespace ChatInputCommandResolver {\n\texport type CommandDataResolvable = Omit<ResolvedCommand, 'type'> | JSONEncodable<ResolvedCommand>;\n\texport type CommandData =\n\t\t| CommandDataResolvable //\n\t\t| ((builder: SlashCommandBuilder) => CommandDataResolvable | Void);\n\n\texport type SubcommandGroupDataResolvable = Omit<ResolvedSubcommandGroup, 'type'> | JSONEncodable<ResolvedSubcommandGroup>;\n\texport type SubcommandGroupData =\n\t\t| SubcommandGroupDataResolvable //\n\t\t| ((builder: SlashCommandSubcommandGroupBuilder) => SubcommandGroupDataResolvable | Void);\n\n\texport type SubcommandDataResolvable = Omit<ResolvedSubcommand, 'type'> | JSONEncodable<ResolvedSubcommand>;\n\texport type SubcommandData =\n\t\t| SubcommandDataResolvable //\n\t\t| ((builder: SlashCommandSubcommandBuilder) => SubcommandDataResolvable | Void);\n\n\texport type ResolvedCommand = RESTPostAPIChatInputApplicationCommandsJSONBody;\n\texport type ResolvedSubcommandGroup = APIApplicationCommandSubcommandGroupOption;\n\texport type ResolvedSubcommand = APIApplicationCommandSubcommandOption;\n}\n","import { ContextMenuCommandBuilder, type ContextMenuCommandType } from '@discordjs/builders';\nimport { isJSONEncodable, type JSONEncodable } from '@discordjs/util';\nimport { isFunction, isNullish } from '@sapphire/utilities';\nimport type { RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10';\nimport type { Void } from '../../utils/internals.js';\nimport { linkMethod } from '../shared/link.js';\n\n/**\n * The command resolver for context menu commands.\n * @internal\n */\nexport class ContextMenuCommandResolver implements JSONEncodable<ContextMenuCommandResolver.ResolvedCommand> {\n\t#data: ContextMenuCommandResolver.ResolvedCommand | null = null;\n\t#commandData: ContextMenuCommandResolver.CommandData | null = null;\n\t#commandType: ContextMenuCommandType | null = null;\n\t#commandMethod: string | null = null;\n\n\t/**\n\t * Sets the command data, type, and method for the context menu command resolver.\n\t *\n\t * @param data - The command data.\n\t * @param type - The command type.\n\t * @param method - The command method (optional).\n\t * @returns The updated context menu command resolver.\n\t */\n\tpublic setCommand(data: ContextMenuCommandResolver.CommandData, type: ContextMenuCommandType, method?: string | null) {\n\t\tthis.#commandData = data;\n\t\tthis.#commandType = type;\n\t\tthis.#commandMethod = method ?? null;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Converts the {@linkcode ContextMenuCommandResolver} instance to a JSON representation.\n\t *\n\t * @returns The JSON representation of the {@linkcode ContextMenuCommandResolver} instance.\n\t */\n\tpublic toJSON(): ContextMenuCommandResolver.ResolvedCommand {\n\t\treturn (this.#data ??= this.#resolve());\n\t}\n\n\t/**\n\t * Resolves the context menu command.\n\t *\n\t * @returns The resolved command.\n\t */\n\t#resolve(): ContextMenuCommandResolver.ResolvedCommand {\n\t\tconst data = this.#commandData;\n\t\tconst type = this.#commandType;\n\t\tif (isNullish(data) || isNullish(type)) {\n\t\t\tthrow new Error('Could not normalize command data');\n\t\t}\n\n\t\tconst resolved = this.#normalizeContextMenuCommand(data, type);\n\t\treturn this.#commandMethod ? linkMethod(resolved, this.#commandMethod) : resolved;\n\t}\n\n\t/**\n\t * Normalizes the context menu command.\n\t *\n\t * @param data - The command data.\n\t * @param type - The command type.\n\t * @returns The normalized context menu command.\n\t */\n\t#normalizeContextMenuCommand(\n\t\tdata: ContextMenuCommandResolver.CommandData,\n\t\ttype: ContextMenuCommandType\n\t): RESTPostAPIContextMenuApplicationCommandsJSONBody {\n\t\tif (isFunction(data)) {\n\t\t\tconst builder = new ContextMenuCommandBuilder().setType(type);\n\t\t\tdata = data(builder) ?? builder;\n\t\t}\n\n\t\treturn { type, ...(isJSONEncodable(data) ? data.toJSON() : data) };\n\t}\n}\n\nexport namespace ContextMenuCommandResolver {\n\texport type CommandDataResolvable =\n\t\t| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'type'>\n\t\t| JSONEncodable<RESTPostAPIContextMenuApplicationCommandsJSONBody>;\n\texport type CommandData =\n\t\t| CommandDataResolvable //\n\t\t| ((builder: ContextMenuCommandBuilder) => CommandDataResolvable | Void);\n\n\texport type ResolvedCommand = RESTPostAPIContextMenuApplicationCommandsJSONBody;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { JSONEncodable } from '@discordjs/util';\nimport type {\n\tRESTPostAPIApplicationCommandsJSONBody,\n\tRESTPostAPIPrimaryEntryPointApplicationCommandJSONBody,\n\tSnowflake\n} from 'discord-api-types/v10';\nimport { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver.js';\nimport { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver.js';\n\n/**\n * Represents an entry in the application command registry.\n *\n * This class provides methods to manage and manipulate application command data.\n *\n * @since 2.0.0\n */\nexport class ApplicationCommandRegistryEntry implements JSONEncodable<ApplicationCommandRegistryEntry.Command[]> {\n\t#chatInput: ChatInputCommandResolver | null = null;\n\t#contextMenu: ContextMenuCommandResolver[] = [];\n\t#ids = new Collection<null | Snowflake, Snowflake>();\n\n\t/**\n\t * Retrieves the loaded global ID of the {@linkcode ApplicationCommandRegistryEntry}.\n\t *\n\t * @since 2.0.0\n\t * @returns The loaded global ID of the {@linkcode ApplicationCommandRegistryEntry}, or `null` if it's not set.\n\t */\n\tpublic getGlobalId(): Snowflake | null {\n\t\treturn this.#ids.get(null) ?? null;\n\t}\n\n\t/**\n\t * Sets the loaded global ID for the {@linkcode ApplicationCommandRegistryEntry}.\n\t *\n\t * @since 2.0.0\n\t * @param value - The Snowflake value to set as the global ID.\n\t * @returns The updated {@linkcode ApplicationCommandRegistryEntry} instance.\n\t */\n\tpublic setGlobalId(value: Snowflake) {\n\t\tthis.#ids.set(null, value);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Retrieves the loaded guild ID associated with the given guild ID.\n\t *\n\t * @since 2.0.0\n\t * @param guildId The guild ID to retrieve.\n\t * @returns The associated guild ID, or null if not found.\n\t */\n\tpublic getGuildId(guildId: Snowflake): Snowflake | null {\n\t\treturn this.#ids.get(guildId) ?? null;\n\t}\n\n\t/**\n\t * Sets the loaded guild ID for the registry entry.\n\t *\n\t * @since 2.0.0\n\t * @param guildId - The guild ID to set.\n\t * @param value - The value to associate with the guild ID.\n\t * @returns The updated registry entry.\n\t */\n\tpublic setGuildId(guildId: Snowflake, value: Snowflake): this {\n\t\tthis.#ids.set(guildId, value);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Gets the chat input command resolver.\n\t *\n\t * @since 2.0.0\n\t * @returns The chat input command resolver or `null` if not set.\n\t */\n\tpublic get chatInput(): ChatInputCommandResolver | null {\n\t\treturn this.#chatInput;\n\t}\n\n\t/**\n\t * Gets the context menu commands associated with this registry entry.\n\t *\n\t * @since 2.0.0\n\t * @returns An array of {@linkcode ContextMenuCommandResolver} objects representing the context menu commands.\n\t */\n\tpublic get contextMenu(): ContextMenuCommandResolver[] {\n\t\treturn this.#contextMenu;\n\t}\n\n\t/**\n\t * Converts the {@linkcode ApplicationCommandRegistryEntry} to a JSON representation.\n\t *\n\t * @since 2.0.0\n\t * @returns An array of Command objects in JSON format.\n\t */\n\tpublic toJSON(): ApplicationCommandRegistryEntry.Command[] {\n\t\treturn this.#chatInput === null\n\t\t\t? this.#contextMenu.map((command) => command.toJSON())\n\t\t\t: [this.#chatInput.toJSON(), ...this.#contextMenu.map((command) => command.toJSON())];\n\t}\n\n\t/**\n\t * Creates a chat input command resolver.\n\t * If the resolver has already been created, it returns the existing instance.\n\t *\n\t * @since 2.0.0\n\t * @returns The chat input command resolver.\n\t * @internal\n\t */\n\tpublic makeChatInput(): ChatInputCommandResolver {\n\t\treturn (this.#chatInput ??= new ChatInputCommandResolver());\n\t}\n\n\t/**\n\t * Creates a context menu command resolver and adds it to the context menu.\n\t *\n\t * @since 2.0.0\n\t * @returns The created context menu command resolver.\n\t * @internal\n\t */\n\tpublic makeContextMenu(): ContextMenuCommandResolver {\n\t\tconst resolver = new ContextMenuCommandResolver();\n\t\tthis.#contextMenu.push(resolver);\n\t\treturn resolver;\n\t}\n}\n\nexport namespace ApplicationCommandRegistryEntry {\n\texport type Command = Exclude<RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIPrimaryEntryPointApplicationCommandJSONBody>;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { REST, RequestData, RouteLike } from '@discordjs/rest';\nimport type { JSONEncodable } from '@discordjs/util';\nimport { container } from '@sapphire/pieces';\nimport {\n\tApplicationCommandType,\n\tRoutes,\n\ttype RESTPutAPIApplicationCommandsJSONBody,\n\ttype RESTPutAPIApplicationCommandsResult,\n\ttype RESTPutAPIApplicationGuildCommandsJSONBody,\n\ttype RESTPutAPIApplicationGuildCommandsResult,\n\ttype Snowflake\n} from 'discord-api-types/v10';\nimport type { Command } from '../../structures/Command.js';\nimport { restrictedGuildIdRegistry } from '../decorators/RestrictGuildIds.js';\nimport { ApplicationCommandRegistryEntry } from './ApplicationCommandRegistryEntry.js';\n\nexport type RequestAuthPrefix = RequestData['authPrefix'];\n\n/**\n * Represents a registry for application commands.\n *\n * @remarks This registry is globally available through {@linkcode container.applicationCommandRegistry}.\n * @since 2.0.0\n */\nexport class ApplicationCommandRegistry implements JSONEncodable<ApplicationCommandRegistryEntry.Command[]> {\n\t#entries = new Collection<typeof Command<Command.Options>, ApplicationCommandRegistryEntry>();\n\t#rest: REST | null = null;\n\t#clientId: Snowflake | null = null;\n\t#authPrefix: RequestAuthPrefix = 'Bot';\n\n\tpublic get store() {\n\t\treturn container.stores.get('commands');\n\t}\n\n\t/**\n\t * Sets up the application command registry with the provided options.\n\t *\n\t * @since 2.0.0\n\t * @param options - The setup options for the application command registry.\n\t * @returns The updated instance of the application command registry.\n\t */\n\tpublic setup(options: Readonly<ApplicationCommandRegistry.SetupOptions>) {\n\t\tthis.#rest = options.rest;\n\t\tthis.#clientId = options.clientId;\n\t\tthis.#authPrefix = options.authPrefix ?? 'Bot';\n\t\treturn this;\n\t}\n\n\t/**\n\t * Retrieves the {@linkcode ApplicationCommandRegistryEntry} associated with the specified command class.\n\t *\n\t * @since 2.0.0\n\t * @template Options - The options type of the command class.\n\t * @param target - The command class to retrieve the entry for.\n\t * @returns The {@linkcode ApplicationCommandRegistryEntry} associated with the command class, or null if not found.\n\t */\n\tpublic get<Options extends Command.Options>(target: typeof Command<Options>): ApplicationCommandRegistryEntry | null {\n\t\treturn this.#entries.get(target) ?? null;\n\t}\n\n\t/**\n\t * Deletes a command from the registry.\n\t *\n\t * @since 2.0.0\n\t * @template Options - The options type for the command.\n\t * @param target - The command to delete.\n\t * @returns True if the command was successfully deleted, false otherwise.\n\t */\n\tpublic delete<Options extends Command.Options>(target: typeof Command<Options>): boolean {\n\t\treturn this.#entries.delete(target);\n\t}\n\n\t/**\n\t * Retrieves or creates an {@linkcode ApplicationCommandRegistryEntry} for the specified command class.\n\t *\n\t * @since 2.0.0\n\t * @template Options - The options type for the command.\n\t * @param target - The command class to ensure registration for.\n\t * @returns The application command registry entry for the command.\n\t */\n\tpublic ensure<Options extends Command.Options>(target: typeof Command<Options>): ApplicationCommandRegistryEntry {\n\t\treturn this.#entries.ensure(target, () => new ApplicationCommandRegistryEntry());\n\t}\n\n\t/**\n\t * Converts the {@linkcode ApplicationCommandRegistryEntry} objects to an array of command objects in JSON format.\n\t *\n\t * @since 2.0.0\n\t * @returns An array of Command objects in JSON format.\n\t */\n\tpublic toJSON(): ApplicationCommandRegistryEntry.Command[] {\n\t\treturn this.#entries.map((entry) => entry.toJSON()).flat(1);\n\t}\n\n\t/**\n\t * Loads the commands from the specified base user directory.\n\t *\n\t * @since 2.0.0\n\t * @param baseUserDirectory - The base user directory to load the commands from, define it as `null` to not register\n\t * a path for the file system loader.\n\t * @returns A promise that resolves when all the commands are loaded.\n\t */\n\tpublic loadCommands(baseUserDirectory?: string | URL | null) {\n\t\tif (baseUserDirectory !== null) {\n\t\t\tcontainer.stores.registerPath(baseUserDirectory);\n\t\t}\n\n\t\treturn this.store.loadAll();\n\t}\n\n\t/**\n\t * Retrieves the loaded chat input commands from the application command registry.\n\t *\n\t * @since 2.0.0\n\t * @returns A collection of chat input commands.\n\t */\n\tpublic getLoadedChatInputCommands() {\n\t\tconst collection = new Collection<string, ApplicationCommandRegistryEntry>();\n\t\tfor (const registryEntry of this.#entries.values()) {\n\t\t\tif (registryEntry.chatInput) collection.set(registryEntry.chatInput.toJSON().name, registryEntry);\n\t\t}\n\n\t\treturn collection;\n\t}\n\n\t/**\n\t * Retrieves the loaded context menu commands.\n\t *\n\t * @since 2.0.0\n\t * @returns A collection of context menu commands.\n\t */\n\tpublic getLoadedContextMenuCommands() {\n\t\tconst collection = new Collection<string, ApplicationCommandRegistryEntry>();\n\t\tfor (const registryEntry of this.#entries.values()) {\n\t\t\tfor (const entry of registryEntry.contextMenu) {\n\t\t\t\tcollection.set(entry.toJSON().name, registryEntry);\n\t\t\t}\n\t\t}\n\n\t\treturn collection;\n\t}\n\n\t/**\n\t * Retrieves the loaded global commands from the application command registry.\n\t *\n\t * @since 2.0.0\n\t * @returns An array of loaded global commands.\n\t */\n\tpublic getLoadedGlobalCommands(): ApplicationCommandRegistryEntry.Command[] {\n\t\treturn this.#entries\n\t\t\t.filter((_, command) => !restrictedGuildIdRegistry.get(command)?.length)\n\t\t\t.map((entry) => entry.toJSON())\n\t\t\t.flat(1);\n\t}\n\n\t/**\n\t * Retrieves the loaded guild commands from the application command registry.\n\t *\n\t * @since 2.0.0\n\t * @returns A collection of guild commands, where the key is the guild ID and the value is an array of commands.\n\t */\n\tpublic getLoadedGuildCommands(): Collection<Snowflake, ApplicationCommandRegistryEntry.Command[]> {\n\t\tconst collection = new Collection<Snowflake, ApplicationCommandRegistryEntry.Command[]>();\n\n\t\tfor (const [command, guildIds] of restrictedGuildIdRegistry) {\n\t\t\tif (guildIds.length === 0) continue;\n\n\t\t\tconst entry = this.#entries.get(command);\n\t\t\tif (!entry) continue;\n\n\t\t\tconst commands = entry.toJSON();\n\t\t\tfor (const guildId of guildIds) {\n\t\t\t\tcollection.ensure(guildId, () => []).push(...commands);\n\t\t\t}\n\t\t}\n\n\t\treturn collection;\n\t}\n\n\t/**\n\t * Registers all the non guild-restricted commands globally.\n\t *\n\t * @since 2.0.0\n\t * @returns The raw result from registering the commands globally.\n\t */\n\tpublic pushGlobalCommands() {\n\t\treturn this.#push(Routes.applicationCommands(this.clientId), this.getLoadedGlobalCommands(), null);\n\t}\n\n\t/**\n\t * Registers all the non guild-restricted commands in a single guild.\n\t *\n\t * @since 2.0.0\n\t * @param guildId The guild to register the commands at.\n\t * @returns The raw result from registering the commands in the specified guild.\n\t */\n\tpublic pushGlobalCommandsInGuild(guildId: Snowflake) {\n\t\treturn this.#push(Routes.applicationGuildCommands(this.clientId, guildId), this.getLoadedGlobalCommands(), guildId);\n\t}\n\n\t/**\n\t * Registers all the commands including guild-restricted ones in a single guild.\n\t *\n\t * @param guildId The guild to register the commands at.\n\t * @returns The raw result from registering the commands in the specified guild.\n\t */\n\tpublic pushAllCommandsInGuild(guildId: Snowflake) {\n\t\treturn this.#push(Routes.applicationGuildCommands(this.clientId, guildId), this.toJSON(), guildId);\n\t}\n\n\t/**\n\t * Registers all the guild-restricted commands in their respective guilds.\n\t *\n\t * @returns The settled promises from all the guild command registrations.\n\t */\n\tpublic pushGuildRestrictedCommands(): Promise<PromiseSettledResult<RESTPutAPIApplicationGuildCommandsResult>[]> {\n\t\tconst promises = this.getLoadedGuildCommands().map((commands, guildId) =>\n\t\t\tthis.#push(Routes.applicationGuildCommands(this.clientId, guildId), commands, guildId)\n\t\t);\n\n\t\treturn Promise.allSettled(promises);\n\t}\n\n\tasync #push<GuildId extends Snowflake | null>(route: RouteLike, body: BodyOf<GuildId>, guildId: GuildId): Promise<ResultOf<GuildId>> {\n\t\tif (this.#rest === null) {\n\t\t\tthrow new Error('The ApplicationCommandRegistry has not been setup yet.');\n\t\t}\n\n\t\tconst entries = (await this.#rest.put(route, { body, authPrefix: this.#authPrefix })) as ResultOf<GuildId>;\n\t\tif (entries.length === 0) return entries;\n\n\t\tconst { router } = this.store;\n\t\tfor (const entry of entries) {\n\t\t\tconst command = entry.type === ApplicationCommandType.ChatInput ? router.getChatInput(entry.name) : router.getContextMenu(entry.name);\n\t\t\tconst registry = command?.registry;\n\t\t\tif (!registry) continue;\n\n\t\t\tif (guildId === null) {\n\t\t\t\tregistry.setGlobalId(entry.id);\n\t\t\t} else {\n\t\t\t\tregistry.setGuildId(guildId, entry.id);\n\t\t\t}\n\t\t}\n\n\t\treturn entries;\n\t}\n\n\tprivate get clientId() {\n\t\tif (this.#clientId === null) throw new Error('The ApplicationCommandRegistry has not been setup yet.');\n\t\treturn this.#clientId;\n\t}\n}\n\nexport namespace ApplicationCommandRegistry {\n\texport interface SetupOptions {\n\t\trest: REST;\n\t\tclientId: Snowflake;\n\t\tauthPrefix?: RequestAuthPrefix;\n\t}\n}\n\nexport const applicationCommandRegistry = new ApplicationCommandRegistry();\ncontainer.applicationCommandRegistry = applicationCommandRegistry;\n\ntype BodyOf<GuildId extends Snowflake | null> = Snowflake | null extends GuildId\n\t? RESTPutAPIApplicationCommandsJSONBody | RESTPutAPIApplicationGuildCommandsJSONBody\n\t: Snowflake extends GuildId\n\t\t? RESTPutAPIApplicationGuildCommandsJSONBody\n\t\t: RESTPutAPIApplicationCommandsJSONBody;\ntype ResultOf<GuildId extends Snowflake | null> = Snowflake | null extends GuildId\n\t? RESTPutAPIApplicationCommandsResult | RESTPutAPIApplicationGuildCommandsResult\n\t: Snowflake extends GuildId\n\t\t? RESTPutAPIApplicationGuildCommandsResult\n\t\t: RESTPutAPIApplicationCommandsResult;\n","import { InteractionResponseType } from 'discord-api-types/v10';\n\nexport const ErrorMessages = {\n\tInternalError: JSON.stringify({ message: 'Received an internal error' }),\n\tInvalidBodySize: JSON.stringify({ message: 'Request body exceeds maximum body size' }),\n\tInvalidContentLengthInteger: JSON.stringify({ message: 'Content-Length is not an integer number' }),\n\tInvalidContentLengthNegative: JSON.stringify({ message: 'Content-Length must not be zero or negative' }),\n\tInvalidContentLengthTooBig: JSON.stringify({ message: \"Content-Length is superior to the server's body size limit\" }),\n\tInvalidCustomId: JSON.stringify({ message: 'Could not parse the `custom_id` field' }),\n\tInvalidSignature: JSON.stringify({ message: 'Received invalid signature' }),\n\tMissingBodyData: JSON.stringify({ message: 'Missing body data' }),\n\tMissingCommandName: JSON.stringify({ message: 'Missing command name' }),\n\tMissingSignatureInformation: JSON.stringify({ message: 'Missing signature information' }),\n\tNotFound: JSON.stringify({ message: 'Not found' }),\n\tUnknownCommandHandler: JSON.stringify({ message: 'Unknown command handler' }),\n\tUnknownCommandName: JSON.stringify({ message: 'Unknown command name' }),\n\tUnknownHandlerName: JSON.stringify({ message: 'Unknown handler name' }),\n\tUnknownInteractionType: JSON.stringify({ message: 'Received unknown interaction type' }),\n\tUnsupportedHttpMethod: JSON.stringify({ message: 'Unsupported HTTP method' })\n} as const;\n\nexport const Payloads = {\n\tPong: JSON.stringify({ type: InteractionResponseType.Pong })\n} as const;\n","export const Data = Symbol('data');\nexport const Response = Symbol('response');\n","import { container } from '@sapphire/pieces';\nimport { Result, err } from '@sapphire/result';\nimport { isNullish, isNullishOrEmpty, type NonNullObject } from '@sapphire/utilities';\nimport {\n\tRoutes,\n\ttype APIChannel,\n\ttype APIGuild,\n\ttype APIInteraction,\n\ttype APIPingInteraction,\n\ttype RESTGetAPIChannelResult,\n\ttype RESTGetAPIGuildResult\n} from 'discord-api-types/v10';\nimport type { ServerResponse } from 'node:http';\nimport { HttpCodes } from '../../../../api/HttpCodes.js';\nimport type { DiscordResult } from '../../../utils/util-types.js';\nimport { resultFromDiscord } from '../../../utils/util.js';\nimport { Data, Response } from '../../common/symbols.js';\n\nexport type BaseInteractionType = Exclude<APIInteraction, APIPingInteraction>;\n\nexport abstract class BaseInteraction<T extends BaseInteractionType = BaseInteractionType> {\n\tprotected readonly [Data]: T;\n\tprotected readonly [Response]: ServerResponse;\n\n\tpublic constructor(response: ServerResponse, data: T) {\n\t\tthis[Data] = data;\n\t\tthis[Response] = response;\n\t}\n\n\tpublic get replied() {\n\t\treturn this[Response].writableEnded;\n\t}\n\n\t/**\n\t * The ID of the interaction.\n\t */\n\tpublic get id(): T['id'] {\n\t\treturn this[Data].id;\n\t}\n\n\t/**\n\t * The type of the interaction.\n\t */\n\tpublic get type(): T['type'] {\n\t\treturn this[Data].type;\n\t}\n\n\t/**\n\t * Bitwise set of permissions the app or bot has within the channel the interaction was sent from.\n\t */\n\tpublic get app_permissions(): T['app_permissions'] {\n\t\treturn this[Data].app_permissions;\n\t}\n\n\t/**\n\t * Bitwise set of permissions the app or bot has within the channel the interaction was sent from.\n\t *\n\t * @seealso {@link app_permissions} for the raw data.\n\t */\n\tpublic get applicationPermissions() {\n\t\treturn typeof this.app_permissions === 'string' ? BigInt(this.app_permissions) : undefined;\n\t}\n\n\t/**\n\t * The ID of the application the interaction is for.\n\t */\n\tpublic get application_id(): T['application_id'] {\n\t\treturn this[Data].application_id;\n\t}\n\n\t/**\n\t * The ID of the application the interaction is for.\n\t *\n\t * @seealso {@link application_id} for the raw data.\n\t */\n\tpublic get applicationId(): T['application_id'] {\n\t\treturn this.application_id;\n\t}\n\n\t/**\n\t * Mapping of installation contexts that the interaction was authorized for\n\t * to related user or guild IDs.\n\t */\n\tpublic get authorizing_integration_owners(): T['authorizing_integration_owners'] {\n\t\treturn this[Data].authorizing_integration_owners;\n\t}\n\n\t/**\n\t * Mapping of installation contexts that the interaction was authorized for\n\t * to related user or guild IDs.\n\t *\n\t * @seealso {@link authorizing_integration_owners} for the raw data.\n\t */\n\tpublic get authorizingIntegrationOwners(): T['authorizing_integration_owners'] {\n\t\treturn this.authorizing_integration_owners;\n\t}\n\n\t/**\n\t * The channel of the interaction.\n\t */\n\tpublic get channel(): T['channel'] {\n\t\treturn this[Data].channel;\n\t}\n\n\t/**\n\t * The channel the interaction was sent from.\n\t * @deprecated Use {@link channel}.id instead.\n\t */\n\tpublic get channel_id(): T['channel_id'] {\n\t\treturn this.channel?.id;\n\t}\n\n\t/**\n\t * The channel the interaction was sent from.\n\t * @deprecated Use {@link channel}.id instead.\n\t *\n\t * @seealso {@link channel_id} for the raw data.\n\t */\n\tpublic get channelId(): T['channel_id'] {\n\t\treturn this.channel?.id;\n\t}\n\n\t/**\n\t * Context where the interaction was triggered from.\n\t */\n\tpublic get context(): T['context'] {\n\t\treturn this[Data].context;\n\t}\n\n\t/**\n\t * The command data payload.\n\t */\n\tpublic get data(): T['data'] {\n\t\treturn this[Data].data;\n\t}\n\n\t/**\n\t * For monetized apps, any entitlements for the invoking user, representing\n\t * access to premium SKUs.\n\t */\n\tpublic get entitlements(): T['entitlements'] {\n\t\treturn this[Data].entitlements;\n\t}\n\n\t/**\n\t * The guild the interaction was sent from.\n\t */\n\tpublic get guild_id(): T['guild_id'] {\n\t\treturn this[Data].guild_id;\n\t}\n\n\t/**\n\t * The guild the interaction was sent from.\n\t *\n\t * @seealso {@link guild_id} for the raw data.\n\t */\n\tpublic get guildId(): T['guild_id'] {\n\t\treturn this.guild_id;\n\t}\n\n\t/**\n\t * The guild's preferred locale, if invoked in a guild.\n\t */\n\tpublic get guild_locale(): T['guild_locale'] {\n\t\treturn this[Data].guild_locale;\n\t}\n\n\t/**\n\t * The guild's preferred locale, if invoked in a guild.\n\t *\n\t * @seealso {@link guild_locale} for the raw data.\n\t */\n\tpublic get guildLocale(): T['guild_locale'] {\n\t\treturn this.guild_locale;\n\t}\n\n\t/**\n\t * The selected language of the invoking user.\n\t */\n\tpublic get locale(): T['locale'] {\n\t\treturn this[Data].locale;\n\t}\n\n\t/**\n\t * Guild member data for the invoking user, including permissions.\n\t *\n\t * **This is only sent when an interaction is invoked in a guild**.\n\t */\n\tpublic get member(): T['member'] {\n\t\treturn this[Data].member;\n\t}\n\n\t/**\n\t * A continuation token for responding to the interaction.\n\t */\n\tpublic get token(): T['token'] {\n\t\treturn this[Data].token;\n\t}\n\n\t/**\n\t * User object for the invoking user.\n\t */\n\tpublic get user() {\n\t\treturn (this[Data].member?.user ?? this[Data].user)!;\n\t}\n\n\t/**\n\t * Read-only property, always `1`.\n\t */\n\tpublic get version(): T['version'] {\n\t\treturn this[Data].version;\n\t}\n\n\t/**\n\t * Determines whether or not the interaction was sent from a guild.\n\t * @returns The casted interaction type.\n\t */\n\tpublic inGuild(): this is InGuild<this> {\n\t\treturn !isNullish(this.guild_id);\n\t}\n\n\t/**\n\t * Fetches the channel the interaction was sent from.\n\t * @returns The fetched channel.\n\t * @remarks **This requires REST to have a token.**\n\t * @seealso {@link channel}.\n\t */\n\tpublic async fetchChannel(): Promise<Result.Err<Error> | DiscordResult<APIChannel>> {\n\t\tif (isNullishOrEmpty(this.channel)) return err(new Error('The interaction was not sent from a channel'));\n\t\treturn resultFromDiscord(container.rest.get(Routes.channel(this.channel.id)) as Promise<RESTGetAPIChannelResult>);\n\t}\n\n\t/**\n\t * Fetches the channel the interaction was sent from.\n\t * @returns The fetched channel.\n\t * @remarks **This requires REST to have a token.**\n\t */\n\tpublic async fetchGuild(): Promise<Result.Err<Error> | DiscordResult<APIGuild>> {\n\t\tif (isNullishOrEmpty(this.guildId)) return err(new Error('The interaction was not sent from a guild'));\n\t\treturn resultFromDiscord(container.rest.get(Routes.guild(this.guildId)) as Promise<RESTGetAPIGuildResult>);\n\t}\n\n\tprotected _sendReply(data: NonNullObject) {\n\t\tconst response = this[Response];\n\t\tif (response.writableEnded) throw new Error('Cannot send response, the request has already been replied.');\n\n\t\tresponse.statusCode = HttpCodes.OK;\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tresponse.on('close', () => {\n\t\t\t\tresolve();\n\t\t\t});\n\t\t\tresponse.end(JSON.stringify(data));\n\t\t});\n\t}\n}\n\nexport type InGuild<T extends BaseInteraction> = T & {\n\tget guild_id(): NonNullable<T['guild_id']>;\n\tget guildId(): NonNullable<T['guildId']>;\n\tget guild_locale(): NonNullable<T['guild_locale']>;\n\tget guildLocale(): NonNullable<T['guildLocale']>;\n\tget member(): NonNullable<T['member']>;\n};\n","import { InteractionResponseType, type APIApplicationCommandAutocompleteInteraction } from 'discord-api-types/v10';\nimport { BaseInteraction } from './base/BaseInteraction.js';\nimport type { AutocompleteResponseData, AutocompleteResponseOptions } from './base/common.js';\n\nexport class AutocompleteInteraction extends BaseInteraction<AutocompleteInteraction.Type> {\n\t/**\n\t * Responds to the interaction with an autocomplete result.\n\t * @param data The data to be sent.\n\t */\n\tpublic reply(data: AutocompleteResponseOptions): Promise<void> {\n\t\tconst body: AutocompleteResponseData = { type: InteractionResponseType.ApplicationCommandAutocompleteResult, data };\n\t\treturn this._sendReply(body);\n\t}\n\n\t/**\n\t * Responds to the interaction with an empty autocomplete result.\n\t */\n\tpublic replyEmpty(): Promise<void> {\n\t\treturn this.reply({ choices: [] });\n\t}\n}\n\nexport namespace AutocompleteInteraction {\n\texport type Type = APIApplicationCommandAutocompleteInteraction;\n}\n","import { container } from '@sapphire/pieces';\nimport {\n\tInteractionResponseType,\n\tRoutes,\n\ttype APIChatInputApplicationCommandInteraction,\n\ttype APIMessageApplicationCommandInteraction,\n\ttype APIUserApplicationCommandInteraction,\n\ttype RESTPostAPIInteractionFollowupResult\n} from 'discord-api-types/v10';\nimport type { AsyncDiscordResult } from '../../../utils/util-types.js';\nimport { resultFromDiscord } from '../../../utils/util.js';\nimport { Message, PartialMessage } from '../../Message.js';\nimport { BaseInteraction } from './BaseInteraction.js';\nimport type {\n\tDeferResponseData,\n\tDeferResponseOptions,\n\tFollowupOptions,\n\tMessageResponseData,\n\tMessageResponseOptions,\n\tModalResponseData,\n\tModalResponseOptions\n} from './common.js';\n\nexport type BaseCommandInteractionType =\n\t| APIChatInputApplicationCommandInteraction\n\t| APIUserApplicationCommandInteraction\n\t| APIMessageApplicationCommandInteraction;\n\nexport class CommandInteraction<T extends BaseCommandInteractionType> extends BaseInteraction<T> {\n\t/**\n\t * Responds to the interaction with a message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async reply(data: MessageResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: MessageResponseData = { type: InteractionResponseType.ChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async defer(data?: DeferResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: DeferResponseData = { type: InteractionResponseType.DeferredChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Responds to the interaction with a popup modal.\n\t * @param data The data to be sent.\n\t */\n\tpublic showModal(data: ModalResponseOptions): Promise<void> {\n\t\tconst body: ModalResponseData = { type: InteractionResponseType.Modal, data };\n\t\treturn this._sendReply(body);\n\t}\n\n\t/**\n\t * Sends a follow-up message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async followup({ files, ...body }: FollowupOptions): AsyncDiscordResult<Message<this>> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.post(Routes.webhook(this.applicationId, this.token), {\n\t\t\t\tbody,\n\t\t\t\tfiles,\n\t\t\t\tauth: false\n\t\t\t}) as Promise<RESTPostAPIInteractionFollowupResult>\n\t\t);\n\n\t\treturn result.map((message) => new Message(this, message));\n\t}\n}\n","import { container } from '@sapphire/pieces';\nimport {\n\tInteractionResponseType,\n\tRoutes,\n\ttype APIMessageComponentButtonInteraction,\n\ttype APIMessageComponentSelectMenuInteraction,\n\ttype RESTPostAPIInteractionFollowupResult\n} from 'discord-api-types/v10';\nimport type { AsyncDiscordResult } from '../../../utils/util-types.js';\nimport { resultFromDiscord } from '../../../utils/util.js';\nimport { Message, PartialMessage } from '../../Message.js';\nimport { Data } from '../../common/symbols.js';\nimport { BaseInteraction } from './BaseInteraction.js';\nimport type {\n\tDeferResponseData,\n\tDeferResponseOptions,\n\tDeferUpdateResult,\n\tFollowupOptions,\n\tMessageResponseData,\n\tMessageResponseOptions,\n\tModalResponseData,\n\tModalResponseOptions,\n\tUpdateData,\n\tUpdateOptions\n} from './common.js';\n\nexport type MessageComponentInteractionType = APIMessageComponentButtonInteraction | APIMessageComponentSelectMenuInteraction;\n\nexport abstract class MessageComponentInteraction<T extends MessageComponentInteractionType> extends BaseInteraction<T> {\n\t/**\n\t * The message the interaction was attached to.\n\t */\n\tpublic get message() {\n\t\treturn this[Data].message;\n\t}\n\n\t/**\n\t * ACK a button interaction and update it to a loading state.\n\t */\n\tpublic async deferUpdate(): Promise<PartialMessage<this>> {\n\t\tconst body: DeferUpdateResult = { type: InteractionResponseType.DeferredMessageUpdate };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async update(data?: UpdateOptions): Promise<PartialMessage<this>> {\n\t\tconst body: UpdateData = { type: InteractionResponseType.UpdateMessage, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Responds to the interaction with a message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async reply(data: MessageResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: MessageResponseData = { type: InteractionResponseType.ChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async defer(data?: DeferResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: DeferResponseData = { type: InteractionResponseType.DeferredChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Responds to the interaction with a popup modal.\n\t * @param data The data to be sent.\n\t */\n\tpublic showModal(data: ModalResponseOptions): Promise<void> {\n\t\tconst body: ModalResponseData = { type: InteractionResponseType.Modal, data };\n\t\treturn this._sendReply(body);\n\t}\n\n\t/**\n\t * Sends a follow-up message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async followup({ files, ...body }: FollowupOptions): AsyncDiscordResult<Message<this>> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.post(Routes.webhook(this.applicationId, this.token), {\n\t\t\t\tbody,\n\t\t\t\tfiles,\n\t\t\t\tauth: false\n\t\t\t}) as Promise<RESTPostAPIInteractionFollowupResult>\n\t\t);\n\n\t\treturn result.map((message) => new Message(this, message));\n\t}\n}\n","import type { APIChatInputApplicationCommandInteraction } from 'discord-api-types/v10';\nimport { CommandInteraction } from './base/CommandInteraction.js';\n\nexport class ChatInputCommandInteraction extends CommandInteraction<ChatInputCommandInteraction.Type> {}\n\nexport namespace ChatInputCommandInteraction {\n\texport type Type = APIChatInputApplicationCommandInteraction;\n}\n","import type { APIMessageComponentButtonInteraction } from 'discord-api-types/v10';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentButtonInteraction extends MessageComponentInteraction<MessageComponentButtonInteraction.Type> {}\n\nexport namespace MessageComponentButtonInteraction {\n\texport type Type = APIMessageComponentButtonInteraction;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { APIBaseInteraction, APIMessageChannelSelectInteractionData, InteractionType, Snowflake } from 'discord-api-types/v10';\nimport type { TransformedArguments } from '../../resolvers/InteractionOptions.js';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentChannelSelectInteraction extends MessageComponentInteraction<MessageComponentChannelSelectInteraction.Type> {\n\t/**\n\t * Gets the IDs of the selected channels.\n\t */\n\tpublic get ids(): Snowflake[] {\n\t\treturn this.data.values;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected channels.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.values}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.entries}.\n\t */\n\tpublic get channels(): Collection<Snowflake, MessageComponentChannelSelectInteraction.Value> {\n\t\treturn new Collection(this.entries());\n\t}\n\n\t/**\n\t * Returns an iterator of the selected channel IDs.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.ids}.\n\t */\n\tpublic *keys(): IterableIterator<Snowflake> {\n\t\tyield* this.ids;\n\t}\n\n\t/**\n\t * Returns an iterator of the selected channels.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.channels}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.entries}.\n\t */\n\tpublic *values(): IterableIterator<MessageComponentChannelSelectInteraction.Value> {\n\t\tconst { resolved } = this.data;\n\t\tfor (const id of this.ids) {\n\t\t\tyield resolved.channels[id];\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator of [ID, Channel] pairs.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.channels}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.values}.\n\t */\n\tpublic *entries(): IterableIterator<[Snowflake, MessageComponentChannelSelectInteraction.Value]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [value.id, value];\n\t\t}\n\t}\n}\n\nexport namespace MessageComponentChannelSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageChannelSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n\texport type Value = TransformedArguments.Channel;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { APIBaseInteraction, APIMessageMentionableSelectInteractionData, APIRole, InteractionType, Snowflake } from 'discord-api-types/v10';\nimport type { TransformedArguments } from '../../resolvers/InteractionOptions.js';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentMentionableSelectInteraction extends MessageComponentInteraction<MessageComponentMentionableSelectInteraction.Type> {\n\t/**\n\t * Gets the IDs of the selected users and roles.\n\t */\n\tpublic get ids(): Snowflake[] {\n\t\treturn this.data.values;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected users.\n\t *\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.values}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.entries}.\n\t */\n\tpublic get users(): Collection<Snowflake, MessageComponentMentionableSelectInteraction.ValueUser> {\n\t\tconst output = new Collection<Snowflake, MessageComponentMentionableSelectInteraction.ValueUser>();\n\t\tconst { users, members } = this.data.resolved;\n\t\tif (users) {\n\t\t\tfor (const user of Object.values(users)) {\n\t\t\t\toutput.set(user.id, { id: user.id, user, member: members?.[user.id] ?? null });\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected roles.\n\t *\n\t * @note The collection will always be empty if the interaction came from direct messages.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.values}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.entries}.\n\t */\n\tpublic get roles(): Collection<Snowflake, APIRole> {\n\t\tconst output = new Collection<Snowflake, APIRole>();\n\t\tconst { roles } = this.data.resolved;\n\t\tif (roles) {\n\t\t\tfor (const role of Object.values(roles)) {\n\t\t\t\toutput.set(role.id, role);\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected users, members, and roles.\n\t *\n\t * @note The collection will always be empty if the interaction came from direct messages.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.values}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.entries}.\n\t */\n\tpublic get mentionables(): Collection<Snowflake, MessageComponentMentionableSelectInteraction.Value> {\n\t\treturn new Collection(this.entries());\n\t}\n\n\t/**\n\t * Returns an iterator of the selected users and roles IDs.\n\t *\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.ids}.\n\t */\n\tpublic *keys(): IterableIterator<Snowflake> {\n\t\tyield* this.ids;\n\t}\n\n\t/**\n\t * Returns an iterator of the selected users, members, and roles.\n\t *\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.users}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.roles}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.entries}.\n\t */\n\tpublic *values(): IterableIterator<MessageComponentMentionableSelectInteraction.Value> {\n\t\tconst { resolved } = this.data;\n\t\tfor (const id of this.ids) {\n\t\t\tconst user = resolved.users?.[id];\n\t\t\tif (user) {\n\t\t\t\tyield { id, user, member: resolved.members?.[id] ?? null };\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst role = resolved.roles?.[id];\n\t\t\tif (role) {\n\t\t\t\tyield { id, role };\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tyield { id };\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator of [ID, Mentionable] pairs.\n\t *\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.users}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.roles}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.values}.\n\t */\n\tpublic *entries(): IterableIterator<[Snowflake, MessageComponentMentionableSelectInteraction.Value]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [value.id, value];\n\t\t}\n\t}\n}\n\nexport namespace MessageComponentMentionableSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageMentionableSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n\texport type Value = ValueUser | { id: string; role: TransformedArguments.Role } | { id: string };\n\n\texport type ValueUser = { id: string } & TransformedArguments.User;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { APIBaseInteraction, APIMessageRoleSelectInteractionData, InteractionType, Snowflake } from 'discord-api-types/v10';\nimport type { TransformedArguments } from '../../resolvers/InteractionOptions.js';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentRoleSelectInteraction extends MessageComponentInteraction<MessageComponentRoleSelectInteraction.Type> {\n\t/**\n\t * Gets the IDs of the selected roles.\n\t */\n\tpublic get ids(): Snowflake[] {\n\t\treturn this.data.values;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected roles.\n\t *\n\t * @seealso {@link MessageComponentRoleSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.values}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.entries}.\n\t */\n\tpublic get roles(): Collection<Snowflake, MessageComponentRoleSelectInteraction.Value> {\n\t\treturn new Collection(this.entries());\n\t}\n\n\t/**\n\t * Returns an iterator of the selected role IDs.\n\t *\n\t * @seealso {@link MessageComponentRoleSelectInteraction.ids}.\n\t */\n\tpublic *keys(): IterableIterator<Snowflake> {\n\t\tyield* this.ids;\n\t}\n\n\t/**\n\t * Returns an iterator of the selected channels.\n\t *\n\t * @seealso {@link MessageComponentRoleSelectInteraction.roles}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.entries}.\n\t */\n\tpublic *values(): IterableIterator<MessageComponentRoleSelectInteraction.Value> {\n\t\tconst { resolved } = this.data;\n\t\tfor (const id of this.ids) {\n\t\t\tyield resolved.roles[id];\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator of [ID, Role] pairs.\n\t *\n\t * @seealso {@link MessageComponentRoleSelectInteraction.roles}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.values}.\n\t */\n\tpublic *entries(): IterableIterator<[Snowflake, MessageComponentRoleSelectInteraction.Value]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [value.id, value];\n\t\t}\n\t}\n}\n\nexport namespace MessageComponentRoleSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageRoleSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n\texport type Value = TransformedArguments.Role;\n}\n","import type { APIBaseInteraction, APIMessageStringSelectInteractionData, InteractionType } from 'discord-api-types/v10';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentStringSelectInteraction extends MessageComponentInteraction<MessageComponentStringSelectInteraction.Type> {\n\tpublic get values(): string[] {\n\t\treturn this.data.values ?? [];\n\t}\n}\n\nexport namespace MessageComponentStringSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageStringSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n}\n\nexport {\n\t/** @deprecated Use {@link MessageComponentStringSelectInteraction} instead. */\n\tMessageComponentStringSelectInteraction as MessageComponentSelectMenuInteraction\n};\n","import { Collection } from '@discordjs/collection';\nimport type { APIBaseInteraction, APIMessageUserSelectInteractionData, InteractionType, Snowflake } from 'discord-api-types/v10';\nimport type { TransformedArguments } from '../../resolvers/InteractionOptions.js';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentUserSelectInteraction extends MessageComponentInteraction<MessageComponentUserSelectInteraction.Type> {\n\t/**\n\t * Gets the IDs of the selected users.\n\t */\n\tpublic get ids(): Snowflake[] {\n\t\treturn this.data.values;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected users.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.values}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.entries}.\n\t */\n\tpublic get users(): Collection<Snowflake, MessageComponentUserSelectInteraction.Value> {\n\t\treturn new Collection(this.entries());\n\t}\n\n\t/**\n\t * Returns an iterator of the selected user IDs.\n\t *\n\t * @seealso {@link MessageComponentUserSelectInteraction.ids}.\n\t */\n\tpublic *keys(): IterableIterator<Snowflake> {\n\t\tyield* this.ids;\n\t}\n\n\t/**\n\t * Returns an iterator of the selected users.\n\t *\n\t * @seealso {@link MessageComponentUserSelectInteraction.users}.\n\t * @seealso {@link MessageComponentUserSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentUserSelectInteraction.entries}.\n\t */\n\tpublic *values(): IterableIterator<MessageComponentUserSelectInteraction.Value> {\n\t\tconst { resolved } = this.data;\n\t\tfor (const id of this.ids) {\n\t\t\tyield { id, user: resolved.users[id], member: resolved.members?.[id] ?? null };\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator of [ID, User] pairs.\n\t *\n\t * @seealso {@link MessageComponentUserSelectInteraction.channels}.\n\t * @seealso {@link MessageComponentUserSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentUserSelectInteraction.values}.\n\t */\n\tpublic *entries(): IterableIterator<[Snowflake, MessageComponentUserSelectInteraction.Value]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [value.user.id, value];\n\t\t}\n\t}\n}\n\nexport namespace MessageComponentUserSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageUserSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n\texport type Value = TransformedArguments.User;\n}\n","import type { APIMessageApplicationCommandInteraction } from 'discord-api-types/v10';\nimport { CommandInteraction } from './base/CommandInteraction.js';\n\nexport class MessageContextMenuCommandInteraction extends CommandInteraction<MessageContextMenuCommandInteraction.Type> {}\n\nexport namespace MessageContextMenuCommandInteraction {\n\texport type Type = APIMessageApplicationCommandInteraction;\n}\n","import { container } from '@sapphire/pieces';\nimport { InteractionResponseType, Routes, type APIModalSubmitInteraction, type RESTPostAPIInteractionFollowupResult } from 'discord-api-types/v10';\nimport type { AsyncDiscordResult } from '../../utils/util-types.js';\nimport { resultFromDiscord } from '../../utils/util.js';\nimport { Message, PartialMessage } from '../Message.js';\nimport { Data } from '../common/symbols.js';\nimport { BaseInteraction } from './base/BaseInteraction.js';\nimport type {\n\tDeferResponseData,\n\tDeferResponseOptions,\n\tDeferUpdateResult,\n\tFollowupOptions,\n\tMessageResponseData,\n\tMessageResponseOptions,\n\tUpdateData,\n\tUpdateOptions\n} from './base/common.js';\n\nexport class ModalSubmitInteraction extends BaseInteraction<ModalSubmitInteraction.Type> {\n\t/**\n\t * The message the interaction was attached to, if any.\n\t */\n\tpublic get message() {\n\t\treturn this[Data].message;\n\t}\n\n\t/**\n\t * ACK a button interaction and update it to a loading state.\n\t */\n\tpublic async deferUpdate(): Promise<PartialMessage<this>> {\n\t\tconst body: DeferUpdateResult = { type: InteractionResponseType.DeferredMessageUpdate };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async update(data?: UpdateOptions): Promise<PartialMessage<this>> {\n\t\tconst body: UpdateData = { type: InteractionResponseType.UpdateMessage, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Responds to the interaction with a message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async reply(data: MessageResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: MessageResponseData = { type: InteractionResponseType.ChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async defer(data?: DeferResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: DeferResponseData = { type: InteractionResponseType.DeferredChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Sends a follow-up message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async followup({ files, ...body }: FollowupOptions): AsyncDiscordResult<Message<this>> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.post(Routes.webhook(this.applicationId, this.token), {\n\t\t\t\tbody,\n\t\t\t\tfiles,\n\t\t\t\tauth: false\n\t\t\t}) as Promise<RESTPostAPIInteractionFollowupResult>\n\t\t);\n\n\t\treturn result.map((message) => new Message(this, message));\n\t}\n}\n\nexport namespace ModalSubmitInteraction {\n\texport type Type = APIModalSubmitInteraction;\n}\n","import type { APIUserApplicationCommandInteraction } from 'discord-api-types/v10';\nimport { CommandInteraction } from './base/CommandInteraction.js';\n\nexport class UserContextMenuCommandInteraction extends CommandInteraction<UserContextMenuCommandInteraction.Type> {}\n\nexport namespace UserContextMenuCommandInteraction {\n\texport type Type = APIUserApplicationCommandInteraction;\n}\n","import { container } from '@sapphire/pieces';\nimport { Result } from '@sapphire/result';\nimport {\n\tApplicationCommandType,\n\tComponentType,\n\tInteractionType,\n\ttype APIChatInputApplicationCommandInteraction,\n\ttype APIMessageApplicationCommandInteraction,\n\ttype APIMessageComponentButtonInteraction,\n\ttype APIUserApplicationCommandInteraction\n} from 'discord-api-types/v10';\nimport type { ServerResponse } from 'node:http';\nimport { HttpCodes } from '../../api/HttpCodes.js';\nimport { ErrorMessages } from '../../utils/constants.js';\nimport {\n\tAutocompleteInteraction,\n\tChatInputCommandInteraction,\n\tMessageComponentButtonInteraction,\n\tMessageComponentChannelSelectInteraction,\n\tMessageComponentMentionableSelectInteraction,\n\tMessageComponentRoleSelectInteraction,\n\tMessageComponentStringSelectInteraction,\n\tMessageComponentUserSelectInteraction,\n\tMessageContextMenuCommandInteraction,\n\tModalSubmitInteraction,\n\tUserContextMenuCommandInteraction,\n\ttype BaseInteractionType\n} from '../structures/interactions/index.js';\nimport type { AsyncDiscordResult } from './util-types.js';\n\nexport function makeInteraction<T extends BaseInteractionType>(response: ServerResponse, interaction: T): TransformRaw<T>;\nexport function makeInteraction(response: ServerResponse, interaction: BaseInteractionType) {\n\tswitch (interaction.type) {\n\t\tcase InteractionType.ApplicationCommand: {\n\t\t\tswitch (interaction.data.type) {\n\t\t\t\tcase ApplicationCommandType.ChatInput:\n\t\t\t\t\treturn new ChatInputCommandInteraction(response, interaction as APIChatInputApplicationCommandInteraction);\n\t\t\t\tcase ApplicationCommandType.User:\n\t\t\t\t\treturn new UserContextMenuCommandInteraction(response, interaction as APIUserApplicationCommandInteraction);\n\t\t\t\tcase ApplicationCommandType.Message:\n\t\t\t\t\treturn new MessageContextMenuCommandInteraction(response, interaction as APIMessageApplicationCommandInteraction);\n\t\t\t\tcase ApplicationCommandType.PrimaryEntryPoint:\n\t\t\t\t\tthrow new Error('PrimaryEntryPoint is not supported');\n\t\t\t}\n\t\t}\n\t\tcase InteractionType.MessageComponent:\n\t\t\tswitch (interaction.data.component_type) {\n\t\t\t\tcase ComponentType.Button:\n\t\t\t\t\treturn new MessageComponentButtonInteraction(response, interaction as APIMessageComponentButtonInteraction);\n\t\t\t\tcase ComponentType.ChannelSelect:\n\t\t\t\t\treturn new MessageComponentChannelSelectInteraction(response, interaction as MessageComponentChannelSelectInteraction.Type);\n\t\t\t\tcase ComponentType.MentionableSelect:\n\t\t\t\t\treturn new MessageComponentMentionableSelectInteraction(\n\t\t\t\t\t\tresponse,\n\t\t\t\t\t\tinteraction as MessageComponentMentionableSelectInteraction.Type\n\t\t\t\t\t);\n\t\t\t\tcase ComponentType.RoleSelect:\n\t\t\t\t\treturn new MessageComponentRoleSelectInteraction(response, interaction as MessageComponentRoleSelectInteraction.Type);\n\t\t\t\tcase ComponentType.StringSelect:\n\t\t\t\t\treturn new MessageComponentStringSelectInteraction(response, interaction as MessageComponentStringSelectInteraction.Type);\n\t\t\t\tcase ComponentType.UserSelect:\n\t\t\t\t\treturn new MessageComponentUserSelectInteraction(response, interaction as MessageComponentUserSelectInteraction.Type);\n\t\t\t}\n\t\tcase InteractionType.ApplicationCommandAutocomplete:\n\t\t\treturn new AutocompleteInteraction(response, interaction);\n\t\tcase InteractionType.ModalSubmit:\n\t\t\treturn new ModalSubmitInteraction(response, interaction);\n\t}\n}\n\nexport type TransformRaw<T extends BaseInteractionType> = T extends AutocompleteInteraction.Type\n\t? AutocompleteInteraction\n\t: T extends ChatInputCommandInteraction.Type\n\t\t? ChatInputCommandInteraction\n\t\t: T extends UserContextMenuCommandInteraction.Type\n\t\t\t? UserContextMenuCommandInteraction\n\t\t\t: T extends MessageContextMenuCommandInteraction.Type\n\t\t\t\t? MessageContextMenuCommandInteraction\n\t\t\t\t: T extends MessageComponentButtonInteraction.Type\n\t\t\t\t\t? MessageComponentButtonInteraction\n\t\t\t\t\t: T extends MessageComponentChannelSelectInteraction.Type\n\t\t\t\t\t\t? MessageComponentChannelSelectInteraction\n\t\t\t\t\t\t: T extends MessageComponentMentionableSelectInteraction.Type\n\t\t\t\t\t\t\t? MessageComponentMentionableSelectInteraction\n\t\t\t\t\t\t\t: T extends MessageComponentRoleSelectInteraction.Type\n\t\t\t\t\t\t\t\t? MessageComponentRoleSelectInteraction\n\t\t\t\t\t\t\t\t: T extends MessageComponentStringSelectInteraction.Type\n\t\t\t\t\t\t\t\t\t? MessageComponentStringSelectInteraction\n\t\t\t\t\t\t\t\t\t: T extends MessageComponentUserSelectInteraction.Type\n\t\t\t\t\t\t\t\t\t\t? MessageComponentUserSelectInteraction\n\t\t\t\t\t\t\t\t\t\t: T extends ModalSubmitInteraction.Type\n\t\t\t\t\t\t\t\t\t\t\t? ModalSubmitInteraction\n\t\t\t\t\t\t\t\t\t\t\t: never;\n\n/**\n * Handles a received error. This function must only be called if the HTTP\n * interaction was not replied to.\n *\n * This function has a special case for string errors, which are translated to a\n * regular message with content as the error.\n *\n * When an error is thrown, the error is emitted in client, and a generic error\n * message is sent back to Discord.\n * @param response The HTTP request we can response to.\n * @param error The error to handle.\n * @returns The response object.\n */\nexport function handleError(response: ServerResponse, error: unknown): ServerResponse {\n\tcontainer.client.emit('error', error);\n\n\tif (!container.client.httpReplyOnError || response.closed) return response;\n\n\tresponse.statusCode = HttpCodes.InternalServerError;\n\treturn response.end(ErrorMessages.InternalError);\n}\n\nexport function resultFromDiscord<T>(promise: Promise<T>): AsyncDiscordResult<T> {\n\treturn Result.fromAsync(promise);\n}\n","import { makeURLSearchParams } from '@discordjs/rest';\nimport { container } from '@sapphire/pieces';\nimport { isNullishOrEmpty } from '@sapphire/utilities';\nimport type { APIMessage, RESTDeleteAPIInteractionOriginalResponseResult } from 'discord-api-types/v10';\nimport {\n\tRoutes,\n\ttype APIChannel,\n\ttype RESTGetAPIInteractionOriginalResponseResult,\n\ttype RESTPatchAPIInteractionOriginalResponseJSONBody,\n\ttype RESTPatchAPIInteractionOriginalResponseResult\n} from 'discord-api-types/v10';\nimport type { AddFiles, AsyncDiscordResult } from '../utils/util-types.js';\nimport { resultFromDiscord } from '../utils/util.js';\nimport { Data } from './common/symbols.js';\nimport type { BaseInteraction } from './interactions/index.js';\n\nexport class PartialMessage<I extends BaseInteraction = BaseInteraction> {\n\tpublic readonly interaction: I;\n\n\tpublic constructor(interaction: I) {\n\t\tthis.interaction = interaction;\n\t}\n\n\t/**\n\t * The ID of the message.\n\t */\n\tpublic get id() {\n\t\treturn '@original';\n\t}\n\n\t/**\n\t * The thread, if the message started one.\n\t */\n\tpublic get thread(): APIChannel | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Retrieves the message from Discord, returns a clone of the instance.\n\t */\n\tpublic async get(): AsyncDiscordResult<Message> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.get(Routes.webhookMessage(this.interaction.applicationId, this.interaction.token, this.id), {\n\t\t\t\tauth: false,\n\t\t\t\tquery: makeURLSearchParams({ thread_id: this.thread?.id })\n\t\t\t}) as Promise<RESTGetAPIInteractionOriginalResponseResult>\n\t\t);\n\t\treturn result.map((data) => new Message(this.interaction, data));\n\t}\n\n\t/**\n\t * Updates the message, returns a clone of the instance.\n\t * @param data The data to be sent.\n\t */\n\tpublic async update({ files, ...body }: UpdateResponseOptions): AsyncDiscordResult<Message> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.patch(Routes.webhookMessage(this.interaction.applicationId, this.interaction.token, this.id), {\n\t\t\t\tbody,\n\t\t\t\tfiles,\n\t\t\t\tauth: false,\n\t\t\t\tquery: makeURLSearchParams({ thread_id: this.thread?.id })\n\t\t\t}) as Promise<RESTPatchAPIInteractionOriginalResponseResult>\n\t\t);\n\t\treturn result.map((data) => new Message(this.interaction, data));\n\t}\n\n\t/**\n\t * Deletes the message.\n\t */\n\tpublic async delete(): AsyncDiscordResult<this> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.delete(Routes.webhookMessage(this.interaction.applicationId, this.interaction.token, this.id), {\n\t\t\t\tauth: false,\n\t\t\t\tquery: makeURLSearchParams({ thread_id: this.thread?.id })\n\t\t\t}) as Promise<RESTDeleteAPIInteractionOriginalResponseResult>\n\t\t);\n\t\treturn result.map(() => this);\n\t}\n}\n\nexport type UpdateResponseResult = RESTPatchAPIInteractionOriginalResponseResult;\nexport type UpdateResponseOptions = AddFiles<RESTPatchAPIInteractionOriginalResponseJSONBody>;\n\nexport class Message<I extends BaseInteraction = BaseInteraction> extends PartialMessage<I> {\n\tprivate readonly [Data]: APIMessage;\n\n\tpublic constructor(interaction: I, data: APIMessage) {\n\t\tsuper(interaction);\n\t\tthis[Data] = data;\n\t}\n\n\t/**\n\t * The ID of the message.\n\t *\n\t * @raw\n\t */\n\tpublic override get id() {\n\t\treturn this[Data].id;\n\t}\n\n\t/**\n\t * The ID of the channel the message is from.\n\t *\n\t * @raw\n\t * @seealso {@link channelId} for the camelCase property.\n\t */\n\tpublic get channel_id(): APIMessage['channel_id'] {\n\t\treturn this[Data].channel_id;\n\t}\n\n\t/**\n\t * The ID of the channel the message is from.\n\t */\n\tpublic get channelId(): APIMessage['channel_id'] {\n\t\treturn this.channel_id;\n\t}\n\n\t/**\n\t * The author of this message (only a valid user in the case where the message is generated by a user or bot user)\n\t *\n\t * If the message is generated by a webhook, the author object corresponds to the webhook's id,\n\t * username, and avatar. You can tell if a message is generated by a webhook by checking for the {@link webhookId} property\n\t *\n\t * @raw\n\t * @seealso {@link https://discord.com/developers/docs/resources/user#user-object}\n\t */\n\tpublic get author(): APIMessage['author'] {\n\t\treturn this[Data].author;\n\t}\n\n\t/**\n\t * The contents of the message.\n\t *\n\t * @raw\n\t */\n\tpublic get content(): APIMessage['content'] {\n\t\treturn this[Data].content;\n\t}\n\n\t/**\n\t * The timestamp the message was sent at.\n\t *\n\t * @raw\n\t * @seealso {@link createdTimestamp} for the parsed timestamp.\n\t * @seealso {@link createdAt} for the Date instance created from the parsed timestamp.\n\t */\n\tpublic get timestamp(): APIMessage['timestamp'] {\n\t\treturn this[Data].timestamp;\n\t}\n\n\t/**\n\t * The timestamp the message was sent at.\n\t *\n\t * @seealso {@link timestamp} for the raw data.\n\t */\n\tpublic get createdTimestamp(): number {\n\t\treturn Date.parse(this.timestamp);\n\t}\n\n\t/**\n\t * The {@link Date} version of {@link createdTimestamp}.\n\t */\n\tpublic get createdAt(): Date {\n\t\treturn new Date(this.createdTimestamp);\n\t}\n\n\t/**\n\t * The timestamp the message was edited at, `null` if it was never edited.\n\t *\n\t * @raw\n\t * @seealso {@link editedTimestamp} for the parsed timestamp.\n\t * @seealso {@link editedAt} for the Date instance created from the parsed timestamp.\n\t */\n\tpublic get edited_timestamp(): APIMessage['edited_timestamp'] {\n\t\treturn this[Data].edited_timestamp;\n\t}\n\n\t/**\n\t * The timestamp the message was edited at, `null` if it was never edited.\n\t */\n\tpublic get editedTimestamp(): number | null {\n\t\tconst value = this.edited_timestamp;\n\t\treturn isNullishOrEmpty(value) ? null : Date.parse(value);\n\t}\n\n\t/**\n\t * The {@link Date} version of {@link editedTimestamp}.\n\t */\n\tpublic get editedAt(): Date | null {\n\t\tconst value = this.editedTimestamp;\n\t\treturn isNullishOrEmpty(value) ? null : new Date(value);\n\t}\n\n\t/**\n\t * Whether or not the message is a TTS message.\n\t *\n\t * @raw\n\t */\n\tpublic get tts(): APIMessage['tts'] {\n\t\treturn this[Data].tts;\n\t}\n\n\t/**\n\t * Whether or not the message mentioned everyone.\n\t *\n\t * @raw\n\t * @seealso {@link mention_everyone} for the camelCase property.\n\t */\n\tpublic get mention_everyone(): APIMessage['mention_everyone'] {\n\t\treturn this[Data].mention_everyone;\n\t}\n\n\t/**\n\t * Whether or not the message mentioned everyone.\n\t *\n\t * @seealso {@link mention_everyone} for the raw data.\n\t */\n\tpublic get mentionEveryone(): APIMessage['mention_everyone'] {\n\t\treturn this.mention_everyone;\n\t}\n\n\t/**\n\t * The users specifically mentioned in the message.\n\t *\n\t * @raw\n\t * @seealso {@link https://discord.com/developers/docs/resources/user#user-object}\n\t */\n\tpublic get mentions(): APIMessage['mentions'] {\n\t\treturn this[Data].mentions;\n\t}\n\n\t/**\n\t * The roles specifically mentioned in the message.\n\t *\n\t * @raw\n\t * @seealso {@link https://discord.com/developers/docs/topics/permissions#role-object}\n\t */\n\tpublic get mention_roles(): APIMessage['mention_roles'] {\n\t\treturn this[Data].mention_roles;\n\t}\n\n\t/**\n\t * The roles specifically mentioned in the message.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/topics/permissions#role-object}\n\t * @seealso {@link mention_roles} for the raw data.\n\t */\n\tpublic get mentionRoles(): APIMessage['mention_roles'] {\n\t\treturn this.mention_roles;\n\t}\n\n\t/**\n\t * The channels specifically mentioned in this message.\n\t *\n\t * Not all channel mentions in a message will appear in {@link mentionChannels}:\n\t * - Only textual channels that are visible to everyone in a lurkable guild will ever be included.\n\t * - Only crossposted messages (via Channel Following) currently include {@link mentionChannels} at all.\n\t *\n\t * @raw\n\t * @seealso {@link mentionChannels} for the camelCase property with an empty array default.\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#channel-mention-object}\n\t */\n\tpublic get mention_channels(): APIMessage['mention_channels'] {\n\t\treturn this[Data].mention_channels;\n\t}\n\n\t/**\n\t * The channels specifically mentioned in this message.\n\t *\n\t * Not all channel mentions in a message will appear in {@link mentionChannels}:\n\t * - Only textual channels that are visible to everyone in a lurkable guild will ever be included.\n\t * - Only crossposted messages (via Channel Following) currently include {@link mentionChannels} at all.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#channel-mention-object}\n\t */\n\tpublic get mentionChannels(): APIMessage['mention_channels'] {\n\t\treturn this[Data].mention_channels ?? [];\n\t}\n\n\t/**\n\t * A nonce that can be used for optimistic message sending (up to 25 characters).\n\t *\n\t * @raw\n\t */\n\tpublic get nonce(): APIMessage['nonce'] {\n\t\treturn this[Data].nonce;\n\t}\n\n\t/**\n\t * Whether or not the message is pinned.\n\t *\n\t * @raw\n\t */\n\tpublic get pinned(): APIMessage['pinned'] {\n\t\treturn this[Data].pinned;\n\t}\n\n\t/**\n\t * The attached files.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#attachment-object}\n\t */\n\tpublic get attachments(): APIMessage['attachments'] {\n\t\treturn this[Data].attachments;\n\t}\n\n\t/**\n\t * The embedded content.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#embed-object}\n\t */\n\tpublic get embeds(): APIMessage['embeds'] {\n\t\treturn this[Data].embeds;\n\t}\n\n\t/**\n\t * The reactions the message has.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#reaction-object}\n\t */\n\tpublic get reactions(): APIMessage['reactions'] {\n\t\treturn this[Data].reactions ?? [];\n\t}\n\n\t/**\n\t * The webhook ID.\n\t */\n\tpublic get webhook_id(): APIMessage['webhook_id'] {\n\t\treturn this[Data].webhook_id;\n\t}\n\n\t/**\n\t * The webhook ID.\n\t *\n\t * @seealso {@link webhook_id} for the raw data.\n\t */\n\tpublic get webhookId() {\n\t\treturn this.webhook_id ?? null;\n\t}\n\n\t/**\n\t * The message's type.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}\n\t */\n\tpublic get type() {\n\t\treturn this[Data].type;\n\t}\n\n\t/**\n\t * The thread, if the message started one.\n\t */\n\tpublic override get thread() {\n\t\treturn this[Data].thread;\n\t}\n\n\t/**\n\t * The message flags combined as a bitfield.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags}\n\t * @seealso {@link https://en.wikipedia.org/wiki/Bit_field}\n\t */\n\tpublic get flags() {\n\t\treturn this[Data].flags;\n\t}\n\n\t/**\n\t * The message's components, such as buttons, action rows, or other interactive components.\n\t */\n\tpublic get components() {\n\t\treturn this[Data].components ?? [];\n\t}\n\n\t/**\n\t * The stickers the message contains, if any.\n\t */\n\tpublic get sticker_items() {\n\t\treturn this[Data].sticker_items;\n\t}\n\n\t/**\n\t * The stickers the message contains, if any.\n\t *\n\t * @seealso {@link sticker_items} for the raw data.\n\t */\n\tpublic get stickerItems() {\n\t\treturn this.sticker_items ?? [];\n\t}\n}\n","import type { APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption } from 'discord-api-types/v10';\nimport type { Command } from '../structures/Command.js';\n\n/**\n * Represents an error that is thrown when a {@link ChatInputRouter} encounters an error.\n * @since 2.0.0\n */\nexport class ChatInputRouterError<Options extends Command.Options = Command.Options> extends Error {\n\t/**\n\t * The key identifying the error.\n\t * @since 2.0.0\n\t */\n\tpublic readonly key: keyof typeof ChatInputRouterErrors;\n\n\t/**\n\t * The command that was being processed when the error was thrown.\n\t * @since 2.0.0\n\t */\n\tpublic readonly command: Command<Options>;\n\n\t/**\n\t * The subcommand group that was being processed when the error was thrown, if any.\n\t * @since 2.0.0\n\t */\n\tpublic readonly group: APIApplicationCommandSubcommandGroupOption | null;\n\n\t/**\n\t * The subcommand that was being processed when the error was thrown, if any.\n\t * @since 2.0.0\n\t */\n\tpublic readonly subcommand: APIApplicationCommandSubcommandOption | null;\n\n\tpublic constructor(\n\t\tkey: keyof typeof ChatInputRouterErrors,\n\t\tcommand: Command<Options>,\n\t\tgroup?: APIApplicationCommandSubcommandGroupOption | null,\n\t\tsubcommand?: APIApplicationCommandSubcommandOption | null\n\t) {\n\t\tsuper(ChatInputRouterErrors[key](command.name, group?.name ?? '', subcommand?.name ?? ''));\n\t\tthis.key = key;\n\t\tthis.command = command;\n\t\tthis.group = group ?? null;\n\t\tthis.subcommand = subcommand ?? null;\n\t}\n\n\t/**\n\t * The path of the command that was being processed when the error was thrown.\n\t * @since 2.0.0\n\t */\n\tpublic get path() {\n\t\treturn `${this.command.name}${this.group ? `/${this.group.name}` : ''}${this.subcommand ? `/${this.subcommand.name}` : ''}`;\n\t}\n}\n\nexport const ChatInputRouterErrors = {\n\tDuplicatedSubcommandGroup: (command: string, subcommandGroup: string) =>\n\t\t`Duplicated subcommand group named '${subcommandGroup}' in command '${command}'`,\n\tDuplicatedSubcommand: (command: string, subcommandGroup: string, subcommand: string) =>\n\t\t`Duplicated subcommand named '${subcommand}' in subcommand group '${subcommandGroup}' in command '${command}'`,\n\tSubcommandGroupLinkInvalid: (command: string, subcommandGroup: string) =>\n\t\t`Subcommand group named '${subcommandGroup}' in command '${command}' is not linked to a method`,\n\tSubcommandLinkInvalid: (command: string, subcommandGroup: string, subcommand: string) =>\n\t\t`Subcommand named '${subcommand}' ${\n\t\t\tsubcommandGroup ? `in subcommand group '${subcommandGroup}' ` : ''\n\t\t}in command '${command}' is not linked to a method`\n} as const;\n","import { isFunction } from '@sapphire/utilities';\nimport type { APIApplicationCommandSubcommandOption } from 'discord-api-types/v10';\nimport { ChatInputRouterError } from '../../errors/ChatInputRouterError';\nimport type { Command } from '../../structures/Command.js';\nimport type { CommandRouterSubcommandGroup } from './CommandRouterSubcommandGroup';\n\n/**\n * Represents a subcommand in a command router.\n *\n * @template Options - The options type for the command.\n * @internal\n */\nexport class CommandRouterSubcommand<Options extends Command.Options = Command.Options> {\n\t#subcommandMapping: string | null = null;\n\n\t/**\n\t * Checks if the subcommand is a subcommand group.\n\t *\n\t * @returns True if the subcommand is a subcommand group, false otherwise.\n\t */\n\tpublic isSubcommandGroup(): this is CommandRouterSubcommandGroup {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if the subcommand is a subcommand.\n\t *\n\t * @returns True if the subcommand is a subcommand, false otherwise.\n\t */\n\tpublic isSubcommand(): this is CommandRouterSubcommand {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Throws an error indicating that the subcommand is a subcommand group.\n\t *\n\t * @throws Error - Cannot assert subcommand on a subcommand group.\n\t */\n\tpublic assertSubcommandGroup(): never {\n\t\tthrow new Error('Cannot assert subcommand on a subcommand group');\n\t}\n\n\t/**\n\t * Asserts that the subcommand is a subcommand.\n\t *\n\t * @returns The current subcommand instance.\n\t */\n\tpublic assertSubcommand(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Gets the subcommand mapping.\n\t *\n\t * @returns The subcommand mapping.\n\t */\n\tpublic getSubcommandMapping(): string | null {\n\t\treturn this.#subcommandMapping;\n\t}\n\n\t/**\n\t * Sets the subcommand mapping.\n\t *\n\t * @param command - The command instance.\n\t * @param subcommand - The subcommand option.\n\t * @param method - The method name.\n\t * @returns The current subcommand instance.\n\t * @throws ChatInputRouterError - Throws an error if the method is not a function.\n\t */\n\tpublic setSubcommandMapping(command: Command<Options>, subcommand: APIApplicationCommandSubcommandOption, method: string) {\n\t\tif (!isFunction(Reflect.get(command, method))) {\n\t\t\tthrow new ChatInputRouterError('SubcommandLinkInvalid', command, null, subcommand);\n\t\t}\n\n\t\tthis.#subcommandMapping = method;\n\t\treturn this;\n\t}\n}\n","import { Collection } from '@discordjs/collection';\nimport { isFunction } from '@sapphire/utilities';\nimport type { APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption } from 'discord-api-types/v10';\nimport { ChatInputRouterError } from '../../errors/ChatInputRouterError';\nimport type { Command } from '../../structures/Command.js';\nimport type { CommandRouterSubcommand } from './CommandRouterSubcommand';\n\n/**\n * Represents a subcommand group in a command router.\n *\n * @template Options - The options type for the command.\n * @internal\n */\nexport class CommandRouterSubcommandGroup<Options extends Command.Options = Command.Options> {\n\t#subcommandGroupMapping: string | null = null;\n\t#subcommandMapping = new Collection<string, string>();\n\n\t/**\n\t * Checks if this instance is a subcommand group.\n\t *\n\t * @returns True if this instance is a subcommand group, false otherwise.\n\t */\n\tpublic isSubcommandGroup(): this is CommandRouterSubcommandGroup {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if this instance is a subcommand.\n\t *\n\t * @returns True if this instance is a subcommand, false otherwise.\n\t */\n\tpublic isSubcommand(): this is CommandRouterSubcommand {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Asserts that this instance is a subcommand group.\n\t *\n\t * @returns The current instance.\n\t */\n\tpublic assertSubcommandGroup(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Throws an error indicating that this instance cannot be asserted as a subcommand.\n\t * @throws Error - An error indicating that subcommand cannot be asserted on a subcommand group.\n\t */\n\tpublic assertSubcommand(): never {\n\t\tthrow new Error('Cannot assert subcommand on a subcommand group');\n\t}\n\n\t/**\n\t * Gets the subcommand group mapping.\n\t *\n\t * @returns The subcommand group mapping.\n\t */\n\tpublic getSubcommandGroupMapping(): string | null {\n\t\treturn this.#subcommandGroupMapping;\n\t}\n\n\t/**\n\t * Gets the subcommand mapping for the specified subcommand.\n\t *\n\t * @param subcommand - The name of the subcommand.\n\t * @returns The subcommand mapping.\n\t */\n\tpublic getSubcommandMapping(subcommand: string): string | null {\n\t\treturn this.#subcommandMapping.get(subcommand) ?? null;\n\t}\n\n\t/**\n\t * Sets the subcommand group mapping.\n\t *\n\t * @param command - The command instance.\n\t * @param group - The subcommand group option.\n\t * @param method - The method name.\n\t * @returns The current instance.\n\t * @throws ChatInputRouterError - If the method is not a function on the command instance.\n\t */\n\tpublic setSubcommandGroupMapping(command: Command<Options>, group: APIApplicationCommandSubcommandGroupOption, method: string) {\n\t\tif (!isFunction(Reflect.get(command, method))) {\n\t\t\tthrow new ChatInputRouterError('SubcommandGroupLinkInvalid', command, group, null);\n\t\t}\n\n\t\tthis.#subcommandGroupMapping = method;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the subcommand mapping.\n\t *\n\t * @param command - The command instance.\n\t * @param group - The subcommand group option.\n\t * @param subcommand - The subcommand option.\n\t * @param method - The method name.\n\t * @returns The current instance.\n\t * @throws ChatInputRouterError - If the method is not a function on the command instance.\n\t */\n\tpublic setSubcommandMapping(\n\t\tcommand: Command<Options>,\n\t\tgroup: APIApplicationCommandSubcommandGroupOption,\n\t\tsubcommand: APIApplicationCommandSubcommandOption,\n\t\tmethod: string\n\t) {\n\t\tif (!isFunction(Reflect.get(command, method))) {\n\t\t\tthrow new ChatInputRouterError('SubcommandLinkInvalid', command, group, subcommand);\n\t\t}\n\n\t\tthis.#subcommandMapping.set(subcommand.name, method);\n\t\treturn this;\n\t}\n}\n","import { Collection } from '@discordjs/collection';\nimport { container } from '@sapphire/pieces';\nimport { isFunction } from '@sapphire/utilities';\nimport {\n\tApplicationCommandOptionType,\n\tApplicationCommandType,\n\ttype APIChatInputApplicationCommandInteractionData,\n\ttype APIContextMenuInteractionData\n} from 'discord-api-types/v10';\nimport type { Command } from '../../structures/Command.js';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver.js';\nimport type { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver.js';\nimport { getLinkedMethod } from '../shared/link.js';\nimport { CommandRouterSubcommand } from './CommandRouterSubcommand.js';\nimport { CommandRouterSubcommandGroup } from './CommandRouterSubcommandGroup.js';\n\n/**\n * Represents a command router that handles routing of interactions for a specific command.\n *\n * @since 2.0.0\n * @template Options - The options type for the command.\n */\nexport class CommandRouter<Options extends Command.Options = Command.Options> {\n\t#command: Command<Options>;\n\t#chatInputName: string | null = null;\n\t#chatInputRouter = new Collection<string, CommandRouterSubcommandGroup | CommandRouterSubcommand>();\n\t#messageContextMenuRouter = new Collection<string, string>();\n\t#userContextMenuRouter = new Collection<string, string>();\n\n\tpublic constructor(command: Command<Options>) {\n\t\tthis.#command = command;\n\n\t\tconst entry = container.applicationCommandRegistry.get(command.constructor as typeof Command<Options>);\n\t\tif (entry === null) {\n\t\t\tconsole.warn(`CommandRouter: No entry found for command '${command.name}'`);\n\t\t} else {\n\t\t\tthis.#populateChatInputRouter(entry.chatInput);\n\t\t\tthis.#populateContextMenuRouter(entry.contextMenu);\n\t\t}\n\t}\n\n\t/**\n\t * The name of the registered chat input command for this command, if any.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic get chatInputName(): string | null {\n\t\treturn this.#chatInputName;\n\t}\n\n\t/**\n\t * The names of the registered context menu commands for this command, if any.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic get contextMenuNames(): string[] {\n\t\treturn [...this.#messageContextMenuRouter.keys(), ...this.#userContextMenuRouter.keys()];\n\t}\n\n\t/**\n\t * Routes a chat input interaction based on the provided data.\n\t *\n\t * @since 2.0.0\n\t * @param data - The data of the chat input interaction.\n\t * @returns The mapped command name or `null` if no mapping is found.\n\t */\n\tpublic routeChatInputInteraction(data: APIChatInputApplicationCommandInteractionData): string | null {\n\t\tif (!data.options?.length) return 'chatInputRun';\n\n\t\tconst [firstOption] = data.options;\n\t\tif (firstOption.type === ApplicationCommandOptionType.Subcommand) {\n\t\t\tconst entry = this.#chatInputRouter.get(firstOption.name);\n\t\t\treturn entry?.isSubcommand() ? entry.getSubcommandMapping() : null;\n\t\t}\n\n\t\tif (firstOption.type === ApplicationCommandOptionType.SubcommandGroup) {\n\t\t\tconst entry = this.#chatInputRouter.get(firstOption.name);\n\t\t\treturn entry?.isSubcommandGroup() ? (entry.getSubcommandMapping(firstOption.options[0].name) ?? entry.getSubcommandGroupMapping()) : null;\n\t\t}\n\n\t\treturn 'chatInputRun';\n\t}\n\n\t/**\n\t * Routes a context menu interaction based on the provided data.\n\t *\n\t * @since 2.0.0\n\t * @param data - The data for the context menu interaction.\n\t * @returns The result of the context menu interaction, or null if no result is found.\n\t */\n\tpublic routeContextMenuInteraction(data: APIContextMenuInteractionData): string | null {\n\t\treturn this.#getContextMenuCollection(data.type)?.get(data.name) ?? null;\n\t}\n\n\t#populateChatInputRouter(entry: ChatInputCommandResolver | null) {\n\t\tif (entry === null) return;\n\n\t\tconst data = entry.toJSON();\n\t\tthis.#chatInputName = data.name;\n\t\tif (!data.options?.length) return;\n\n\t\tconst command = this.#command;\n\t\tconst chatInputRouter = this.#chatInputRouter;\n\t\tfor (const option of data.options) {\n\t\t\tif (option.type === ApplicationCommandOptionType.SubcommandGroup) {\n\t\t\t\tconst entry = chatInputRouter.ensure(option.name, () => new CommandRouterSubcommandGroup()).assertSubcommandGroup();\n\t\t\t\tconst subcommandGroupMethod = getLinkedMethod(option);\n\t\t\t\tif (subcommandGroupMethod) entry.setSubcommandGroupMapping(command, option, subcommandGroupMethod);\n\n\t\t\t\tfor (const subOption of option.options ?? []) {\n\t\t\t\t\tconst subcommandMethod = getLinkedMethod(subOption);\n\t\t\t\t\tif (subcommandMethod) entry.setSubcommandMapping(command, option, subOption, subcommandMethod);\n\t\t\t\t}\n\t\t\t} else if (option.type === ApplicationCommandOptionType.Subcommand) {\n\t\t\t\tconst entry = chatInputRouter.ensure(option.name, () => new CommandRouterSubcommand()).assertSubcommand();\n\t\t\t\tconst subcommandMethod = getLinkedMethod(option);\n\t\t\t\tif (subcommandMethod) entry.setSubcommandMapping(command, option, subcommandMethod);\n\t\t\t}\n\t\t}\n\t}\n\n\t#populateContextMenuRouter(entries: ContextMenuCommandResolver[]) {\n\t\tconst command = this.#command;\n\t\tfor (const entry of entries) {\n\t\t\tconst data = entry.toJSON();\n\t\t\tconst method = getLinkedMethod(data);\n\t\t\tif (!method) continue;\n\n\t\t\tif (isFunction(Reflect.get(command, method))) {\n\t\t\t\tthis.#getContextMenuCollection(data.type)?.set(data.name, method);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Context menu command named \"${data.name}\" is not linked to a method`);\n\t\t\t}\n\t\t}\n\t}\n\n\t#getContextMenuCollection(type: ApplicationCommandType) {\n\t\tswitch (type) {\n\t\t\tcase ApplicationCommandType.Message:\n\t\t\t\treturn this.#messageContextMenuRouter;\n\t\t\tcase ApplicationCommandType.User:\n\t\t\t\treturn this.#userContextMenuRouter;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}\n}\n","import { Piece } from '@sapphire/pieces';\nimport type { Awaitable, NonNullObject } from '@sapphire/utilities';\nimport type { AutocompleteInteractionArguments, Interactions } from '../interactions/index.js';\nimport { CommandRouter } from '../interactions/router/CommandRouter.js';\n\nexport abstract class Command<Options extends Command.Options = Command.Options> extends Piece<Options, 'commands'> {\n\t/**\n\t * The router for the command.\n\t * @since 2.0.0\n\t */\n\tpublic readonly router: CommandRouter<Options>;\n\n\tpublic constructor(context: Command.LoaderContext, options: Options = {} as Options) {\n\t\tsuper(context, options);\n\t\tthis.router = new CommandRouter(this);\n\t}\n\n\t/**\n\t * Gets the registry for this command.\n\t *\n\t * @returns The registry for this command, or `null` if it is not registered.\n\t */\n\tpublic get registry() {\n\t\treturn this.container.applicationCommandRegistry.get(this.constructor as typeof Command) ?? null;\n\t}\n\n\t/**\n\t * Responds to the chat input command for this command\n\t *\n\t * @param interaction - The interaction to be handled.\n\t * @param args - The parsed arguments for this autocomplete interaction.\n\t */\n\tpublic chatInputRun(interaction: Command.ApplicationCommandInteraction, args: NonNullObject): Awaitable<unknown>;\n\tpublic chatInputRun() {\n\t\tthrow new Error(`The method 'chatInputRun' has not been implemented in ${this.name}.`);\n\t}\n\n\t/**\n\t * Responds to an auto completable option for this command\n\t *\n\t * @param interaction - The interaction to be handled.\n\t * @param args - The parsed arguments for this autocomplete interaction.\n\t * @returns The response to the autocomplete interaction.\n\t */\n\tpublic autocompleteRun(interaction: Command.AutocompleteInteraction, args: Command.AutocompleteArguments<any>): Awaitable<unknown>;\n\tpublic autocompleteRun() {\n\t\tthrow new Error(`The method 'autocompleteRun' has not been implemented in ${this.name}.`);\n\t}\n}\n\nexport namespace Command {\n\texport type AutocompleteInteraction = Interactions.Autocomplete;\n\texport type AutocompleteArguments<T extends object> = AutocompleteInteractionArguments<T>;\n\n\texport type ChatInputInteraction = Interactions.ChatInputCommand;\n\texport type UserInteraction = Interactions.UserContextMenuCommand;\n\texport type MessageInteraction = Interactions.MessageContextMenuCommand;\n\n\texport type ContextMenuInteraction = Interactions.ContextMenuCommand;\n\texport type ApplicationCommandInteraction = Interactions.ApplicationCommand;\n\n\texport type Interaction = ChatInputInteraction | AutocompleteInteraction | UserInteraction | MessageInteraction;\n\texport type InteractionData = Interaction['data'];\n\n\t// Piece re-exports\n\t/** @deprecated Use {@linkcode LoaderContext} instead. */\n\texport type Context = LoaderContext;\n\texport type LoaderContext = Piece.LoaderContext<'commands'>;\n\texport type JSON = Piece.JSON;\n\texport type LocationJSON = Piece.LocationJSON;\n\texport type Options = Piece.Options;\n}\n","import { LoaderStrategy } from '@sapphire/pieces';\nimport type { Command } from './Command.js';\nimport type { CommandStore } from './CommandStore.js';\n\n/**\n * Represents a strategy for loading and unloading commands.\n *\n * @since 2.0.0\n */\nexport class CommandLoaderStrategy extends LoaderStrategy<Command> {\n\t/**\n\t * Called when a command is loaded.\n\t *\n\t * @since 2.0.0\n\t * @param store - The command store.\n\t * @param piece - The command being loaded.\n\t * @returns The loaded command.\n\t */\n\tpublic override onLoad(store: CommandStore, piece: Command) {\n\t\tif (piece.router.chatInputName) {\n\t\t\tstore.router.addChatInputMapping(piece.router.chatInputName, piece);\n\t\t}\n\n\t\tfor (const name of piece.router.contextMenuNames) {\n\t\t\tstore.router.addContextMenuMapping(name, piece);\n\t\t}\n\n\t\treturn piece;\n\t}\n\n\t/**\n\t * Called when a command is unloaded.\n\t *\n\t * @since 2.0.0\n\t * @param store - The command store.\n\t * @param piece - The command being unloaded.\n\t * @returns The unloaded command.\n\t */\n\tpublic override onUnload(store: CommandStore, piece: Command) {\n\t\tif (piece.router.chatInputName) {\n\t\t\tstore.router.removeChatInputMapping(piece.router.chatInputName);\n\t\t}\n\n\t\tfor (const name of piece.router.contextMenuNames) {\n\t\t\tstore.router.removeContextMenuMapping(name);\n\t\t}\n\n\t\treturn piece;\n\t}\n}\n","import { Collection } from '@discordjs/collection';\nimport { ApplicationCommandType, type APIApplicationCommandInteraction } from 'discord-api-types/v10';\nimport type { Command } from './Command.js';\n\n/**\n * Represents a router for mapping commands to chat inputs and context menus.\n *\n * @since 2.0.0\n */\nexport class CommandStoreRouter {\n\t#chatInputMappings = new Collection<string, Command>();\n\t#contextMenuMappings = new Collection<string, Command>();\n\n\t/**\n\t * Gets the command associated with the given interaction.\n\t *\n\t * @since 2.0.0\n\t * @param interaction - The interaction object.\n\t * @returns The command associated with the interaction, or null if not found.\n\t */\n\tpublic get(interaction: APIApplicationCommandInteraction) {\n\t\treturn interaction.data.type === ApplicationCommandType.ChatInput\n\t\t\t? this.getChatInput(interaction.data.name)\n\t\t\t: this.getContextMenu(interaction.data.name);\n\t}\n\n\t/**\n\t * Gets the chat input command with the specified name.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the chat input command.\n\t * @returns The chat input command with the specified name, or null if not found.\n\t */\n\tpublic getChatInput(name: string): Command | null {\n\t\treturn this.#chatInputMappings.get(name) ?? null;\n\t}\n\n\t/**\n\t * Gets the context menu command with the specified name.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the context menu command.\n\t * @returns The context menu command with the specified name, or null if not found.\n\t */\n\tpublic getContextMenu(name: string): Command | null {\n\t\treturn this.#contextMenuMappings.get(name) ?? null;\n\t}\n\n\t/**\n\t * Adds a chat input mapping.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the mapping.\n\t * @param command - The command to be mapped.\n\t * @internal\n\t */\n\tpublic addChatInputMapping(name: string, command: Command): void {\n\t\tthis.#chatInputMappings.set(name, command);\n\t}\n\n\t/**\n\t * Adds a context menu mapping.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the mapping.\n\t * @param command - The command to be mapped.\n\t * @internal\n\t */\n\tpublic addContextMenuMapping(name: string, command: Command): void {\n\t\tthis.#contextMenuMappings.set(name, command);\n\t}\n\n\t/**\n\t * Removes a chat input mapping.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the mapping to be removed.\n\t * @returns True if the mapping was successfully removed, false otherwise.\n\t * @internal\n\t */\n\tpublic removeChatInputMapping(name: string): boolean {\n\t\treturn this.#chatInputMappings.delete(name);\n\t}\n\n\t/**\n\t * Removes a context menu mapping.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the mapping to be removed.\n\t * @returns True if the mapping was successfully removed, false otherwise.\n\t * @internal\n\t */\n\tpublic removeContextMenuMapping(name: string): boolean {\n\t\treturn this.#contextMenuMappings.delete(name);\n\t}\n}\n","import { container, Store } from '@sapphire/pieces';\nimport { Result } from '@sapphire/result';\nimport type { Awaitable } from '@sapphire/utilities';\nimport {\n\tApplicationCommandType,\n\ttype APIApplicationCommandAutocompleteInteraction,\n\ttype APIApplicationCommandInteraction,\n\ttype APIApplicationCommandInteractionData,\n\ttype APIPrimaryEntryPointCommandInteraction\n} from 'discord-api-types/v10';\nimport type { ServerResponse } from 'node:http';\nimport { HttpCodes } from '../api/HttpCodes.js';\nimport {\n\ttransformAutocompleteInteraction,\n\ttransformInteraction,\n\ttransformMessageInteraction,\n\ttransformUserInteraction\n} from '../interactions/index.js';\nimport { handleError, makeInteraction } from '../interactions/utils/util.js';\nimport { ErrorMessages } from '../utils/constants.js';\nimport { Command } from './Command.js';\nimport { CommandLoaderStrategy } from './CommandLoaderStrategy.js';\nimport { CommandStoreRouter } from './CommandStoreRouter.js';\n\nexport class CommandStore extends Store<Command, 'commands'> {\n\t/**\n\t * The router instance for handling commands in the CommandStore.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic router = new CommandStoreRouter();\n\n\tpublic constructor() {\n\t\tsuper(Command, { name: 'commands', strategy: new CommandLoaderStrategy() });\n\t}\n\n\t/**\n\t * Runs an application command.\n\t *\n\t * @since 1.0.0\n\t * @param response - The server response object.\n\t * @param interaction - The API application command interaction object.\n\t * @returns A promise that resolves to the server response.\n\t */\n\tpublic async runApplicationCommand(\n\t\tresponse: ServerResponse,\n\t\tinteraction: Exclude<APIApplicationCommandInteraction, APIPrimaryEntryPointCommandInteraction>\n\t): Promise<ServerResponse> {\n\t\tconst command = this.router.get(interaction);\n\t\tif (!command) {\n\t\t\tcontainer.client.emit('commandNameUnknown', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\treturn response.end(ErrorMessages.UnknownCommandName);\n\t\t}\n\n\t\tconst context = { command, interaction, response };\n\t\tconst method = this.#routeCommandMethodName(command, interaction.data);\n\t\tif (!method) {\n\t\t\tcontainer.client.emit('commandMethodUnknown', context);\n\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\treturn response.end(ErrorMessages.UnknownCommandHandler);\n\t\t}\n\n\t\tcontainer.client.emit('commandRun', context);\n\t\tconst result = await Result.fromAsync(() => this.#runCommandMethod(command, method, makeInteraction(response, interaction)));\n\t\tresult\n\t\t\t.inspect((value) => container.client.emit('commandSuccess', context, value))\n\t\t\t.inspectErr((error) => (container.client.emit('commandError', error, context), handleError(response, error)));\n\n\t\tcontainer.client.emit('commandFinish', context);\n\t\treturn response;\n\t}\n\n\t/**\n\t * Runs the application command autocomplete.\n\t *\n\t * @since 1.0.0\n\t * @param response - The server response object.\n\t * @param interaction - The API application command autocomplete interaction object.\n\t * @returns A promise that resolves to the server response.\n\t */\n\tpublic async runApplicationCommandAutocomplete(\n\t\tresponse: ServerResponse,\n\t\tinteraction: APIApplicationCommandAutocompleteInteraction\n\t): Promise<ServerResponse> {\n\t\tif (!interaction.data?.name) {\n\t\t\tcontainer.client.emit('commandNameMissing', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.BadRequest;\n\t\t\treturn response.end(ErrorMessages.MissingCommandName);\n\t\t}\n\n\t\tconst command = this.router.getChatInput(interaction.data.name);\n\t\tif (!command) {\n\t\t\tcontainer.client.emit('commandNameUnknown', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\treturn response.end(ErrorMessages.UnknownCommandName);\n\t\t}\n\n\t\tconst context = { command, interaction, response };\n\t\tconst options = transformAutocompleteInteraction(interaction.data.resolved ?? {}, interaction.data.options);\n\n\t\tcontainer.client.emit('autocompleteRun', context);\n\t\tconst result = await Result.fromAsync(() => command.autocompleteRun(makeInteraction(response, interaction), options));\n\t\tresult\n\t\t\t.inspect((value) => container.client.emit('autocompleteSuccess', context, value))\n\t\t\t.inspectErr((error) => (container.client.emit('autocompleteError', error, context), handleError(response, error)));\n\n\t\tcontainer.client.emit('autocompleteFinish', context);\n\t\treturn response;\n\t}\n\n\t/**\n\t * Executes a command method on a command object.\n\t *\n\t * @since 1.0.0\n\t * @param command - The command object.\n\t * @param method - The name of the method to execute.\n\t * @param interaction - The application command interaction.\n\t * @returns A promise that resolves to the result of the method execution.\n\t */\n\t#runCommandMethod(command: Command, method: string, interaction: Command.ApplicationCommandInteraction): Awaitable<unknown> {\n\t\treturn Reflect.apply(Reflect.get(command, method), command, [interaction, this.#createArguments(interaction.data)]);\n\t}\n\n\t/**\n\t * Determines the method name to route a command based on the type of interaction data.\n\t *\n\t * @since 1.0.0\n\t * @param command - The command object.\n\t * @param data - The interaction data.\n\t * @returns The method name to route the command, or null if no method is found.\n\t * @throws Error - If the interaction data type is not recognized.\n\t */\n\t#routeCommandMethodName(command: Command, data: Command.ApplicationCommandInteraction['data']): string | null {\n\t\tswitch (data.type) {\n\t\t\tcase ApplicationCommandType.ChatInput:\n\t\t\t\treturn command.router.routeChatInputInteraction(data);\n\t\t\tcase ApplicationCommandType.User:\n\t\t\tcase ApplicationCommandType.Message:\n\t\t\t\treturn command.router.routeContextMenuInteraction(data);\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Unreachable');\n\t\t}\n\t}\n\n\t/**\n\t * Creates arguments based on the provided {@linkcode APIApplicationCommandInteractionData}.\n\t *\n\t * @since 1.0.0\n\t * @param data The {@linkcode APIApplicationCommandInteractionData} object.\n\t * @returns The transformed arguments based on the interaction data.\n\t * @throws Error - If the {@linkcode ApplicationCommandType} is unsupported.\n\t */\n\t#createArguments(data: APIApplicationCommandInteractionData) {\n\t\tswitch (data.type) {\n\t\t\tcase ApplicationCommandType.ChatInput:\n\t\t\t\treturn transformInteraction(data.resolved ?? {}, data.options ?? []);\n\t\t\tcase ApplicationCommandType.User:\n\t\t\t\treturn transformUserInteraction(data);\n\t\t\tcase ApplicationCommandType.Message:\n\t\t\t\treturn transformMessageInteraction(data);\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Unknown ApplicationCommandType');\n\t\t}\n\t}\n}\n","import { Piece } from '@sapphire/pieces';\nimport type { Interactions } from '../interactions/index.js';\n\nexport abstract class InteractionHandler<Options extends InteractionHandler.Options = InteractionHandler.Options> extends Piece<\n\tOptions,\n\t'interaction-handlers'\n> {\n\tpublic constructor(context: InteractionHandler.LoaderContext, options: Options = {} as Options) {\n\t\tsuper(context, options);\n\t}\n\n\tpublic abstract run(interaction: InteractionHandler.Interaction, customIdValue: unknown): Awaited<unknown>;\n}\n\nexport namespace InteractionHandler {\n\texport type ButtonInteraction = Interactions.MessageComponentButton;\n\texport type SelectMenuInteraction = Interactions.MessageComponentSelectMenu;\n\texport type ModalInteraction = Interactions.ModalSubmit;\n\texport type MessageComponentInteraction = Interactions.MessageComponent;\n\n\texport type ContextMenuInteraction = Interactions.ContextMenuCommand;\n\texport type ApplicationCommandInteraction = Interactions.ApplicationCommand;\n\n\texport type Interaction = Interactions.MessageComponent;\n\texport type InteractionData = Interaction['data'];\n\n\t// Piece re-exports\n\t/** @deprecated Use {@linkcode LoaderContext} instead. */\n\texport type Context = LoaderContext;\n\texport type LoaderContext = Piece.LoaderContext<'interaction-handlers'>;\n\texport type JSON = Piece.JSON;\n\texport type LocationJSON = Piece.LocationJSON;\n\texport type Options = Piece.Options;\n}\n","import { container, Store } from '@sapphire/pieces';\nimport { Result } from '@sapphire/result';\nimport type { APIMessageComponentInteraction, APIModalSubmitInteraction } from 'discord-api-types/v10';\nimport type { ServerResponse } from 'node:http';\nimport { HttpCodes } from '../api/HttpCodes.js';\nimport { handleError, makeInteraction } from '../interactions/utils/util.js';\nimport { ErrorMessages } from '../utils/constants.js';\nimport { InteractionHandler } from './InteractionHandler.js';\n\nexport class InteractionHandlerStore extends Store<InteractionHandler, 'interaction-handlers'> {\n\tpublic constructor() {\n\t\tsuper(InteractionHandler, { name: 'interaction-handlers' });\n\t}\n\n\tpublic async runHandler(\n\t\tresponse: ServerResponse,\n\t\tinteraction: APIMessageComponentInteraction | APIModalSubmitInteraction\n\t): Promise<ServerResponse> {\n\t\tconst parsed = container.idParser.run(interaction.data.custom_id);\n\t\tif (parsed === null) {\n\t\t\tcontainer.client.emit('interactionHandlerNameInvalid', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.BadRequest;\n\t\t\treturn response.end(ErrorMessages.InvalidCustomId);\n\t\t}\n\n\t\tconst handler = this.get(parsed.name);\n\t\tif (!handler) {\n\t\t\tcontainer.client.emit('interactionHandlerNameUnknown', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\treturn response.end(ErrorMessages.UnknownHandlerName);\n\t\t}\n\n\t\tconst context = { handler, interaction, response };\n\t\tcontainer.client.emit('interactionHandlerRun', context);\n\t\tconst result = await Result.fromAsync(() => handler.run(makeInteraction(response, interaction), parsed.content));\n\t\tresult\n\t\t\t.inspect((value) => container.client.emit('interactionHandlerSuccess', context, value))\n\t\t\t.inspectErr((error) => (container.client.emit('interactionHandlerError', error, context), handleError(response, error)));\n\n\t\tcontainer.client.emit('interactionHandlerFinish', context);\n\t\treturn response;\n\t}\n}\n","// Copyright © 2020 - The Sapphire Community and its contributors | MIT\n// Source: https://github.com/sapphiredev/framework/blob/effcede3c54e0f0335369137a9b76060729df32c/src/lib/structures/Listener.ts\n\nimport { Piece, type Container } from '@sapphire/pieces';\nimport type { Awaitable } from '@sapphire/utilities';\n\nexport abstract class Listener<Options extends Listener.Options = Listener.Options> extends Piece<Options, 'listeners'> {\n\tpublic emitter: Listener.Emitter;\n\tpublic event: string;\n\tprotected _listener: (...args: readonly any[]) => unknown;\n\n\tpublic constructor(context: Listener.LoaderContext, options: Options) {\n\t\tsuper(context, options);\n\n\t\tthis.emitter = typeof options.emitter === 'string' ? this.container[options.emitter] : (options.emitter ?? this.container.client);\n\t\tthis.event = options.event ?? this.name;\n\t\tthis._listener = this.run.bind(this);\n\t}\n\n\tpublic abstract run(...args: readonly any[]): Awaitable<unknown>;\n}\n\nexport namespace Listener {\n\t/** @deprecated Use {@linkcode LoaderContext} instead. */\n\texport type Context = LoaderContext;\n\texport type LoaderContext = Piece.LoaderContext<'listeners'>;\n\texport type JSON = Piece.JSON;\n\texport type LocationJSON = Piece.LocationJSON;\n\texport interface Options extends Piece.Options {\n\t\temitter: Emitter | { [K in keyof Container]: Container[K] extends Emitter ? K : never }[keyof Container];\n\t\tevent?: string;\n\t}\n\n\texport interface Emitter {\n\t\ton(eventName: string, listener: (...args: any[]) => void): this;\n\t\tonce(eventName: string, listener: (...args: any[]) => void): this;\n\t\toff(eventName: string, listener: (...args: any[]) => void): this;\n\t\tsetMaxListeners(n: number): this;\n\t\tgetMaxListeners(): number;\n\t\temit(eventName: string, ...args: any[]): boolean;\n\t}\n}\n","// Copyright © 2020 - The Sapphire Community and its contributors | MIT\n// Source: https://github.com/sapphiredev/framework/blob/e9a7966f0bad532deb1a7da617b57db902ae06a6/src/lib/structures/ListenerLoaderStrategy.ts\n\nimport { LoaderStrategy } from '@sapphire/pieces';\nimport type { Listener } from './Listener.js';\nimport type { ListenerStore } from './ListenerStore.js';\n\n/**\n * Represents a strategy for loading and unloading listeners.\n *\n * @since 2.1.0\n */\nexport class ListenerLoaderStrategy extends LoaderStrategy<Listener> {\n\t/**\n\t * Called when a listener is loaded.\n\t *\n\t * @since 2.1.0\n\t * @param store - The listener store.\n\t * @param piece - The listener being loaded.\n\t * @returns The loaded listener.\n\t */\n\tpublic override onLoad(_store: ListenerStore, piece: Listener) {\n\t\tconst emitter = piece.emitter!;\n\n\t\t// Increment the maximum amount of listeners by one:\n\t\tconst maxListeners = emitter.getMaxListeners();\n\t\tif (maxListeners !== 0) emitter.setMaxListeners(maxListeners + 1);\n\n\t\temitter.on(piece.event, piece['_listener']);\n\t}\n\n\t/**\n\t * Called when a listener is unloaded.\n\t *\n\t * @since 2.1.0\n\t * @param store - The listener store.\n\t * @param piece - The listener being unloaded.\n\t * @returns The unloaded listener.\n\t */\n\tpublic override onUnload(_store: ListenerStore, piece: Listener) {\n\t\tconst emitter = piece.emitter!;\n\n\t\t// Increment the maximum amount of listeners by one:\n\t\tconst maxListeners = emitter.getMaxListeners();\n\t\tif (maxListeners !== 0) emitter.setMaxListeners(maxListeners - 1);\n\n\t\temitter.off(piece.event, piece['_listener']);\n\t}\n}\n","// Copyright © 2020 - The Sapphire Community and its contributors | MIT\n// Source: https://github.com/sapphiredev/framework/blob/effcede3c54e0f0335369137a9b76060729df32c/src/lib/structures/ListenerStore.ts\n\nimport { Store } from '@sapphire/pieces';\nimport { Listener } from './Listener.js';\nimport { ListenerLoaderStrategy } from './ListenerLoaderStrategy.js';\n\nexport class ListenerStore extends Store<Listener, 'listeners'> {\n\tpublic constructor() {\n\t\tsuper(Listener, { name: 'listeners', strategy: new ListenerLoaderStrategy() });\n\t}\n}\n","import { webcrypto } from 'node:crypto';\n\nexport type HeaderValue = string | string[];\nexport type Key = webcrypto.CryptoKey;\n\nconst AlgorithmName = 'Ed25519';\n\nfunction headerToString(header: HeaderValue): string {\n\treturn typeof header === 'string' ? header : header[0];\n}\n\nexport function makeKey(key: string): Promise<Key> {\n\treturn webcrypto.subtle.importKey('raw', Buffer.from(key, 'hex'), { name: AlgorithmName }, true, ['verify']);\n}\n\n/**\n * Validates a payload from Discord against its signature and key.\n * @param body The request body.\n * @param signature The value of the `x-signature-ed25519` header.\n * @param signature The value of the `x-signature-timestamp` header.\n * @param key The public key from the Discord developer dashboard, generated by {@link makeKey}\n */\nexport async function verifyBody(body: string, signature: string | string[], timestamp: string | string[], key: Key) {\n\tconst signatureData = Buffer.from(headerToString(signature), 'hex');\n\tconst data = Buffer.isBuffer(body)\n\t\t? Buffer.concat([Buffer.from(headerToString(timestamp)), body])\n\t\t: Buffer.from(`${headerToString(timestamp)}${body}`);\n\n\treturn webcrypto.subtle.verify(AlgorithmName, key, signatureData, Buffer.from(data));\n}\n","import { container } from '@sapphire/pieces';\nimport { err, ok, type Result } from '@sapphire/result';\nimport { isNullishOrEmpty } from '@sapphire/utilities';\nimport type { IncomingMessage } from 'node:http';\nimport { TextDecoder } from 'node:util';\nimport { ErrorMessages } from './constants.js';\n\n/**\n * Safely reads the {@link IncomingMessage incoming message}'s body as a string.\n * @param request The incoming message to get the data from.\n * @returns The string, if it's within the body size limit.\n */\nexport async function getSafeTextBody(request: IncomingMessage): Promise<Result.Err<string> | Result.Ok<string>> {\n\tlet limit = container.client.bodySizeLimit;\n\n\t// Validate the Content-Length header:\n\tif (!isNullishOrEmpty(request.headers['content-length'])) {\n\t\tconst parsed = Number(request.headers['content-length']);\n\t\tif (!Number.isSafeInteger(parsed)) return err(ErrorMessages.InvalidContentLengthInteger);\n\t\tif (parsed <= 0) return err(ErrorMessages.InvalidContentLengthNegative);\n\t\tif (parsed > limit) return err(ErrorMessages.InvalidContentLengthTooBig);\n\n\t\t// If it's a valid length, set the limit to it.\n\t\tlimit = parsed;\n\t}\n\n\tconst decoder = new TextDecoder();\n\n\tlet output = '';\n\tfor await (const chunk of request) {\n\t\tconst part = typeof chunk === 'string' ? chunk : decoder.decode(chunk, { stream: true });\n\t\tif (part.length + output.length > limit) return err(ErrorMessages.InvalidBodySize);\n\n\t\toutput += part;\n\t}\n\n\t// Flush the streaming TextDecoder so that any pending\n\t// incomplete multibyte characters are handled.\n\tconst part = decoder.decode(undefined, { stream: false });\n\tif (part.length + output.length > limit) return err(ErrorMessages.InvalidBodySize);\n\n\toutput += part;\n\treturn ok(output);\n}\n","import { REST, type RESTOptions } from '@discordjs/rest';\nimport { container } from '@sapphire/pieces';\nimport { isNullishOrEmpty } from '@sapphire/utilities';\nimport { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';\nimport { InteractionType, type APIInteraction, type APIPrimaryEntryPointCommandInteraction } from 'discord-api-types/v10';\nimport { createServer, type IncomingMessage, type Server, type ServerOptions, type ServerResponse } from 'node:http';\nimport type { ListenOptions as NetListenOptions } from 'node:net';\nimport type { MappedClientEvents } from './ClientEvents.js';\nimport { HttpCodes } from './api/HttpCodes.js';\nimport type { IIdParser } from './components/IIdParser.js';\nimport { StringIdParser } from './components/StringIdParser.js';\nimport type { ApplicationCommandRegistry, RequestAuthPrefix } from './interactions/shared/ApplicationCommandRegistry.js';\nimport { CommandStore } from './structures/CommandStore.js';\nimport { InteractionHandlerStore } from './structures/InteractionHandlerStore.js';\nimport { ListenerStore } from './structures/ListenerStore.js';\nimport { ErrorMessages, Payloads } from './utils/constants.js';\nimport { makeKey, verifyBody, type Key } from './utils/security.js';\nimport { getSafeTextBody } from './utils/streams.js';\n\ncontainer.stores.register(new CommandStore());\ncontainer.stores.register(new InteractionHandlerStore());\ncontainer.stores.register(new ListenerStore());\n\nexport class Client extends AsyncEventEmitter<MappedClientEvents> {\n\tpublic server!: Server;\n\tpublic readonly id: string;\n\tpublic readonly bodySizeLimit: number;\n\tpublic readonly httpReplyOnError: boolean;\n\t#discordPublicKey: string;\n\n\tpublic constructor(options: ClientOptions = {}) {\n\t\tsuper();\n\t\tthis.bodySizeLimit = options.bodySizeLimit ?? 1024 * 1024;\n\t\tthis.httpReplyOnError = options.httpReplyOnError ?? true;\n\n\t\tconst discordPublicKey = options.discordPublicKey ?? process.env.DISCORD_PUBLIC_KEY;\n\t\tif (!discordPublicKey) throw new Error('The discordPublicKey cannot be empty');\n\t\tthis.#discordPublicKey = discordPublicKey;\n\n\t\tcontainer.rest = new REST(options.restOptions);\n\t\tconst token = options.discordToken ?? process.env.DISCORD_TOKEN;\n\t\tif (!token) throw new Error('The discordToken cannot be empty');\n\n\t\tthis.id = options.clientId ?? process.env.DISCORD_CLIENT_ID ?? Buffer.from(token.split('.')[0], 'base64').toString();\n\n\t\tcontainer.client = this;\n\t\tcontainer.rest.setToken(token);\n\t\tcontainer.idParser ??= new StringIdParser();\n\t\tcontainer.applicationCommandRegistry.setup({\n\t\t\tclientId: this.id,\n\t\t\trest: container.rest,\n\t\t\tauthPrefix: options.authPrefix\n\t\t});\n\t}\n\n\t/**\n\t * Gets the application command registry.\n\t *\n\t * @since 2.0.0\n\t * @returns The application command registry.\n\t */\n\tpublic get registry() {\n\t\treturn container.applicationCommandRegistry;\n\t}\n\n\t/**\n\t * Loads all the commands.\n\t * @param options The load options.\n\t */\n\tpublic async load(options: LoadOptions = {}) {\n\t\t// Register the user directory if not null:\n\t\tif (options.baseUserDirectory !== null) {\n\t\t\tcontainer.stores.registerPath(options.baseUserDirectory);\n\t\t}\n\n\t\tawait container.stores.load();\n\t}\n\n\t/**\n\t * Starts the HTTP server, listening for HTTP interactions.\n\t * @param options The listen options.\n\t */\n\tpublic async listen({ serverOptions, postPath, port, address, ...listenOptions }: ListenOptions) {\n\t\tconst key = await makeKey(this.#discordPublicKey);\n\t\tconst path = postPath ?? process.env.HTTP_POST_PATH ?? '/';\n\n\t\tthis.server = createServer(serverOptions ?? {});\n\t\tthis.server.on('request', (request, response) => void this.handleRawHttpMessage(request, response, path, key));\n\n\t\treturn new Promise<void>((resolve) => this.server.listen({ ...listenOptions, port, host: address }, resolve));\n\t}\n\n\tprotected async handleRawHttpMessage(request: IncomingMessage, response: ServerResponse, path: string, key: Key) {\n\t\tresponse.setHeader('Content-Type', 'application/json');\n\n\t\tif (request.url !== path) {\n\t\t\tresponse.statusCode = HttpCodes.NotFound;\n\t\t\treturn response.end(ErrorMessages.NotFound);\n\t\t}\n\n\t\tif (request.method !== 'POST') {\n\t\t\tresponse.statusCode = HttpCodes.MethodNotAllowed;\n\t\t\treturn response.end(ErrorMessages.UnsupportedHttpMethod);\n\t\t}\n\n\t\tconst signature = request.headers['x-signature-ed25519'];\n\t\tconst timestamp = request.headers['x-signature-timestamp'];\n\n\t\tif (isNullishOrEmpty(signature) || isNullishOrEmpty(timestamp)) {\n\t\t\tresponse.statusCode = HttpCodes.Unauthorized;\n\t\t\treturn response.end(ErrorMessages.MissingSignatureInformation);\n\t\t}\n\n\t\tconst result = await getSafeTextBody(request);\n\t\tif (result.isErr()) {\n\t\t\tresponse.statusCode = HttpCodes.BadRequest;\n\t\t\treturn response.end(result.unwrapErr());\n\t\t}\n\n\t\tconst body = result.unwrap();\n\t\tconst valid = await verifyBody(body, signature, timestamp, key);\n\t\tif (!valid) {\n\t\t\tresponse.statusCode = HttpCodes.Unauthorized;\n\t\t\treturn response.end(ErrorMessages.InvalidSignature);\n\t\t}\n\n\t\treturn this.handleHttpMessage(JSON.parse(body) as Exclude<APIInteraction, APIPrimaryEntryPointCommandInteraction>, response);\n\t}\n\n\tprotected async handleHttpMessage(\n\t\tinteraction: Exclude<APIInteraction, APIPrimaryEntryPointCommandInteraction>,\n\t\tresponse: ServerResponse\n\t): Promise<ServerResponse> {\n\t\tif (interaction.type === InteractionType.Ping) {\n\t\t\tresponse.statusCode = HttpCodes.OK;\n\t\t\treturn response.end(Payloads.Pong);\n\t\t}\n\n\t\tswitch (interaction.type) {\n\t\t\tcase InteractionType.ApplicationCommand:\n\t\t\t\treturn container.stores.get('commands').runApplicationCommand(response, interaction);\n\t\t\tcase InteractionType.ApplicationCommandAutocomplete:\n\t\t\t\treturn container.stores.get('commands').runApplicationCommandAutocomplete(response, interaction);\n\t\t\tcase InteractionType.MessageComponent:\n\t\t\tcase InteractionType.ModalSubmit:\n\t\t\t\treturn container.stores.get('interaction-handlers').runHandler(response, interaction);\n\t\t\tdefault: {\n\t\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\t\treturn response.end(ErrorMessages.UnknownInteractionType);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface ClientOptions {\n\t/**\n\t * The public key from Discord, available under \"General Information\" after opening an application from\n\t * [Discord's applications](https://discord.com/developers/applications).\n\t *\n\t * @default process.env.DISCORD_PUBLIC_KEY\n\t */\n\tdiscordPublicKey?: string;\n\n\t/**\n\t * The Discord token used for authenticating requests outside of interaction responses.\n\t *\n\t * @default process.env.DISCORD_TOKEN\n\t */\n\tdiscordToken?: string;\n\n\t/**\n\t * The options to be passed to the underlying REST library.\n\t */\n\trestOptions?: Partial<RESTOptions>;\n\n\t/**\n\t * The body size limit in bytes.\n\t * @default 1024 * 1024 // (1 MiB)\n\t */\n\tbodySizeLimit?: number;\n\n\t/**\n\t * Whether to reply with a 500 status code to Discord if an error occurs while processing an interaction.\n\t * @default true\n\t */\n\thttpReplyOnError?: boolean;\n\n\t/**\n\t * The ID of the client.\n\t *\n\t * @default process.env.DISCORD_CLIENT_ID ?? Buffer.from(token.split('.')[0], 'base64').toString()\n\t */\n\tclientId?: string;\n\n\t/**\n\t * The prefix to use for authentication in REST calls.\n\t * @default 'Bot'\n\t * @since 2.0.0\n\t */\n\tauthPrefix?: RequestAuthPrefix;\n}\n\nexport interface LoadOptions {\n\t/**\n\t * The base user directory, if set to `null`, the library will not call {@link StoreRegistry.registerPath},\n\t * meaning that you will need to manually set each folder for each store. Please read the aforementioned method's\n\t * documentation for more information.\n\t */\n\tbaseUserDirectory?: string | null;\n}\n\nexport interface ListenOptions extends Omit<NetListenOptions, 'path' | 'readableAll' | 'writableAll'> {\n\t/**\n\t * The port at which the server will listen for requests.\n\t */\n\tport: number;\n\n\t/**\n\t * The address at which the server will be started.\n\t */\n\taddress?: string;\n\n\t/**\n\t * The path the HTTP server will listen to.\n\t * @default process.env.HTTP_POST_PATH ?? '/'\n\t */\n\tpostPath?: `/${string}`;\n\n\t/**\n\t * The options to pass to the `createServer` function.\n\t */\n\tserverOptions?: ServerOptions;\n}\n\nexport namespace Client {\n\texport type Options = ClientOptions;\n\texport type PieceLoadOptions = LoadOptions;\n\texport type ServerListenOptions = ListenOptions;\n}\n\ndeclare module '@sapphire/pieces' {\n\texport interface StoreRegistryEntries {\n\t\tcommands: CommandStore;\n\t\t'interaction-handlers': InteractionHandlerStore;\n\t\tlisteners: ListenerStore;\n\t}\n\n\texport interface Container {\n\t\tclient: Client;\n\t\tidParser: IIdParser;\n\t\trest: REST;\n\t\tapplicationCommandRegistry: ApplicationCommandRegistry;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAY,YAAL;;;;;;;;CAQN;;;;;CAMA;;;;;;CAOA;;;;;;CAOA;;;;;CAMA;;;;;CAMA;;;;;;;CAQA;;;;;;CAOA;;;;;;CAOA;;;;;;CAOA;;;;;;;;CASA;;;;CAKA;;;;;;;;;;;;CAaA;;;;;;;CAQA;;;;;;;CAQA;;;;;;;CAQA;;;;;CAKA;;;;;;;;CASA;;;;;;;CAQA;;;;;;CAOA;;;;;;;;;;CAWA;;;;;;;;;;;;CAaA;;;;;;;;;;;CAYA;;;;;CAMA;;;;;;CAOA;;;;;CAMA;;;;CAKA;;;;;;;CAQA;;;;;;CAOA;;;;;;;;;;CAWA;;;;;CAMA;;;;;CAMA;;;;;CAMA;;;;;;;CAQA;;;;;;CAOA;;;;;;;CAQA;;;;;CAMA;;;;;;;;;CAUA;;;;;;;CAQA;;;;;CAMA;;;;;CAMA;;;;CAKA;;;;;CAMA;;;;;CAMA;;;;;CAMA;;;;;;;;CASA;;;;;CAMA;;;;;;CAOA;;;;;;;CAQA;;;;;CAMA;;;;;;CAOA;;;;;CAMA;;;;;CAMA;;;;;CAMA;;;;CAKA;;;;;CAMA;;;;;CAMA;;;;;CAMA;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;EAC5C,IAAI,OAAO,MAAM,GAAG;GACnB,SAAS;GACT,OAAO,SAAS,IAAI,OAAO,UAAU,CAAC;EACvC;EAEA,MAAM,OAAO,OAAO,OAAO;EAE3B,IAAI,CAAC,MADe,WAAW,MAAM,WAAW,WAAW,GAAG,GAClD;GACX,SAAS;GACT,OAAO,SAAS,IAAI,cAAc,gBAAgB;EACnD;EAEA,OAAO,KAAK,kBAAkB,KAAK,MAAM,IAAI,GAAsE,QAAQ;CAC5H;CAEA,MAAgB,kBACf,aACA,UAC0B;EAC1B,IAAI,YAAY,SAAS,gBAAgB,MAAM;GAC9C,SAAS;GACT,OAAO,SAAS,IAAI,SAAS,IAAI;EAClC;EAEA,QAAQ,YAAY,MAApB;GACC,KAAK,gBAAgB,oBACpB,OAAOA,YAAU,OAAO,IAAI,UAAU,CAAC,CAAC,sBAAsB,UAAU,WAAW;GACpF,KAAK,gBAAgB,gCACpB,OAAOA,YAAU,OAAO,IAAI,UAAU,CAAC,CAAC,kCAAkC,UAAU,WAAW;GAChG,KAAK,gBAAgB;GACrB,KAAK,gBAAgB,aACpB,OAAOA,YAAU,OAAO,IAAI,sBAAsB,CAAC,CAAC,WAAW,UAAU,WAAW;GACrF;IACC,SAAS;IACT,OAAO,SAAS,IAAI,cAAc,sBAAsB;EAE1D;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["container","container","container","container","container","container","container","container","container","Piece","Store","container","Piece","Store","container","Piece","Store","container","container"],"sources":["../../src/lib/api/HttpCodes.ts","../../src/lib/components/StringIdParser.ts","../../src/lib/types/Enums.ts","../../src/lib/plugins/symbols.ts","../../src/lib/plugins/PluginManager.ts","../../src/lib/interactions/decorators/_shared.ts","../../src/lib/interactions/decorators/RegisterCommand.ts","../../src/lib/interactions/decorators/RegisterMessageCommand.ts","../../src/lib/interactions/decorators/RegisterSubcommand.ts","../../src/lib/interactions/decorators/RegisterSubcommandGroup.ts","../../src/lib/interactions/decorators/RegisterUserCommand.ts","../../src/lib/interactions/decorators/RestrictGuildIds.ts","../../src/lib/interactions/resolvers/InteractionOptions.ts","../../src/lib/interactions/shared/link.ts","../../src/lib/interactions/resolvers/ChatInputCommandResolver.ts","../../src/lib/interactions/resolvers/ContextMenuCommandResolver.ts","../../src/lib/interactions/shared/ApplicationCommandRegistryEntry.ts","../../src/lib/interactions/shared/ApplicationCommandRegistry.ts","../../src/lib/utils/constants.ts","../../src/lib/interactions/structures/common/symbols.ts","../../src/lib/interactions/structures/interactions/base/BaseInteraction.ts","../../src/lib/interactions/structures/interactions/AutocompleteInteraction.ts","../../src/lib/interactions/structures/interactions/base/CommandInteraction.ts","../../src/lib/interactions/structures/interactions/base/MessageComponentInteraction.ts","../../src/lib/interactions/structures/interactions/ChatInputCommandInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentButtonInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentChannelSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentMentionableSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentRoleSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentStringSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageComponentUserSelectInteraction.ts","../../src/lib/interactions/structures/interactions/MessageContextMenuCommandInteraction.ts","../../src/lib/interactions/structures/interactions/ModalSubmitInteraction.ts","../../src/lib/interactions/structures/interactions/UserContextMenuCommandInteraction.ts","../../src/lib/interactions/utils/util.ts","../../src/lib/interactions/structures/Message.ts","../../src/lib/errors/ChatInputRouterError.ts","../../src/lib/interactions/router/CommandRouterSubcommand.ts","../../src/lib/interactions/router/CommandRouterSubcommandGroup.ts","../../src/lib/interactions/router/CommandRouter.ts","../../src/lib/structures/Command.ts","../../src/lib/structures/CommandLoaderStrategy.ts","../../src/lib/structures/CommandStoreRouter.ts","../../src/lib/structures/CommandStore.ts","../../src/lib/structures/InteractionHandler.ts","../../src/lib/structures/InteractionHandlerStore.ts","../../src/lib/structures/Listener.ts","../../src/lib/structures/ListenerLoaderStrategy.ts","../../src/lib/structures/ListenerStore.ts","../../src/lib/utils/security.ts","../../src/lib/utils/streams.ts","../../src/lib/Client.ts","../../src/lib/plugins/Plugin.ts"],"sourcesContent":["// Copyright © 2020 - The Sapphire Community and its contributors | MIT\n// Source: https://github.com/sapphiredev/plugins/blob/a6471129ddab96146987a1dafa90f0576de8e2f2/packages/api/src/lib/structures/http/HttpCodes.ts\n\nexport enum HttpCodes {\n\t/**\n\t * Standard response for successful HTTP requests. The actual response will\n\t * depend on the request method used. In a GET request, the response will\n\t * contain an entity corresponding to the requested resource. In a POST\n\t * request, the response will contain an entity describing or containing the\n\t * result of the action.\n\t */\n\tOK = 200,\n\n\t/**\n\t * The request has been fulfilled, resulting in the creation of a new\n\t * resource.\n\t */\n\tCreated = 201,\n\n\t/**\n\t * The request has been accepted for processing, but the processing has not\n\t * been completed. The request might or might not be eventually acted upon,\n\t * and may be disallowed when processing occurs.\n\t */\n\tAccepted = 202,\n\n\t/**\n\t * The server is a transforming proxy (e.g. a Web accelerator) that received\n\t * a 200 OK from its origin, but is returning a modified version of the\n\t * origin's response.\n\t */\n\tNonAuthoritativeInformation = 203,\n\n\t/**\n\t * The server successfully processed the request, and is not returning any\n\t * content.\n\t */\n\tNoContent = 204,\n\n\t/**\n\t * The server successfully processed the request, asks that the requester\n\t * reset its document view, and is not returning any content.\n\t */\n\tResetContent = 205,\n\n\t/**\n\t * (RFC 7233) The server is delivering only part of the resource (byte\n\t * serving) due to a range header sent by the client. The range header is\n\t * used by HTTP clients to enable resuming of interrupted downloads, or\n\t * split a download into multiple simultaneous streams.\n\t */\n\tPartialContent = 206,\n\n\t/**\n\t * (WebDAV; RFC 4918) The message body that follows is by default an XML\n\t * message and can contain a number of separate response codes, depending on\n\t * how many sub-requests were made.\n\t */\n\tMultiStatus = 207,\n\n\t/**\n\t * (WebDAV; RFC 5842) The members of a DAV binding have already been\n\t * enumerated in a preceding part of the (multistatus) response, and are not\n\t * being included again.\n\t */\n\tAlreadyReported = 208,\n\n\t/**\n\t * (RFC 3229) The server has fulfilled a request for the resource, and the\n\t * response is a representation of the result of one or more\n\t * instance-manipulations applied to the current instance.\n\t */\n\tIMUsed = 226,\n\n\t/**\n\t * Indicates multiple options for the resource from which the client may\n\t * choose (via agent-driven content negotiation). For example, this code\n\t * could be used to present multiple video format options, to list files\n\t * with different filename extensions, or to suggest word-sense\n\t * disambiguation.\n\t */\n\tMultipleChoices = 300,\n\n\t/**\n\t * This and all future requests should be directed to the given URI.\n\t */\n\tMovedPermanently = 301,\n\n\t/**\n\t * (Previously \"Moved temporarily\") Tells the client to look at (browse to)\n\t * another URL. 302 has been superseded by 303 and 307. This is an example\n\t * of industry practice contradicting the standard. The HTTP/1.0\n\t * specification (RFC 1945) required the client to perform a temporary\n\t * redirect (the original describing phrase was \"Moved Temporarily\"), but\n\t * popular browsers implemented 302 with the functionality of a 303 See\n\t * Other. Therefore, HTTP/1.1 added status codes 303 and 307 to distinguish\n\t * between the two behaviours. However, some Web applications and frameworks\n\t * use the 302 status code as if it were the 303.\n\t */\n\tFound = 302,\n\n\t/**\n\t * The response to the request can be found under another URI using the GET\n\t * method. When received in response to a POST (or PUT/DELETE), the client\n\t * should presume that the server has received the data and should issue a\n\t * new GET request to the given URI.\n\t */\n\tSeeOther = 303,\n\n\t/**\n\t * (RFC 7232) Indicates that the resource has not been modified since the\n\t * version specified by the request headers If-Modified-Since or\n\t * If-None-Match. In such case, there is no need to retransmit the resource\n\t * since the client still has a previously-downloaded copy.\n\t */\n\tNotModified = 304,\n\n\t/**\n\t * The requested resource is available only through a proxy, the address for\n\t * which is provided in the response. For security reasons, many HTTP\n\t * clients (such as Mozilla Firefox and Internet Explorer) do not obey this\n\t * status code.\n\t */\n\tUseProxy = 305,\n\t/**\n\t * No longer used. Originally meant \"Subsequent requests should use the\n\t * specified proxy.\".\n\t */\n\tSwitchProxy = 306,\n\n\t/**\n\t * In this case, the request should be repeated with another URI; however,\n\t * future requests should still use the original URI. In contrast to how 302\n\t * was historically implemented, the request method is not allowed to be\n\t * changed when reissuing the original request. For example, a POST request\n\t * should be repeated using another POST request.\n\t */\n\tTemporaryRedirect = 307,\n\n\t/**\n\t * (RFC 7538) The request and all future requests should be repeated using\n\t * another URI. 307 and 308 parallel the behaviors of 302 and 301, but do\n\t * not allow the HTTP method to change. So, for example, submitting a form\n\t * to a permanently redirected resource may continue smoothly.\n\t */\n\tPermanentRedirect = 308,\n\n\t/**\n\t * The server cannot or will not process the request due to an apparent\n\t * client error (e.g., malformed request syntax, size too large, invalid\n\t * request message framing, or deceptive request routing).\n\t */\n\tBadRequest = 400,\n\n\t/**\n\t * (RFC 7235) Similar to 403 Forbidden, but specifically for use when\n\t * authentication is required and has failed or has not yet been provided.\n\t * The response must include a WWW-Authenticate header field containing a\n\t * challenge applicable to the requested resource. See Basic access\n\t * authentication and Digest access authentication. 401 semantically means\n\t * \"unauthorised\", the user does not have valid authentication credentials\n\t * for the target resource.\n\t */\n\tUnauthorized = 401,\n\n\t/**\n\t * Reserved for future use. The original intention was that this code might\n\t * be used as part of some form of digital cash or micropayment scheme, as\n\t * proposed, for example, by GNU Taler, but that has not yet happened, and\n\t * this code is not widely used. Google Developers API uses this status if a\n\t * particular developer has exceeded the daily limit on requests. Sipgate\n\t * uses this code if an account does not have sufficient funds to start a\n\t * call. Shopify uses this code when the store has not paid their fees and\n\t * is temporarily disabled. Stripe uses this code for failed payments where\n\t * parameters were correct, for example blocked fraudulent payments.\n\t */\n\tPaymentRequired = 402,\n\n\t/**\n\t * The request contained valid data and was understood by the server, but\n\t * the server is refusing action. This may be due to the user not having the\n\t * necessary permissions for a resource or needing an account of some sort,\n\t * or attempting a prohibited action (e.g. creating a duplicate record\n\t * where only one is allowed). This code is also typically used if the\n\t * request provided authentication by answering the WWW-Authenticate header\n\t * field challenge, but the server did not accept that authentication. The\n\t * request should not be repeated.\n\t */\n\tForbidden = 403,\n\n\t/**\n\t * The requested resource could not be found but may be available in the\n\t * future. Subsequent requests by the client are permissible.\n\t */\n\tNotFound = 404,\n\n\t/**\n\t * A request method is not supported for the requested resource; for example,\n\t * a GET request on a form that requires data to be presented via POST, or a\n\t * PUT request on a read-only resource.\n\t */\n\tMethodNotAllowed = 405,\n\n\t/**\n\t * The requested resource is capable of generating only content not\n\t * acceptable according to the Accept headers sent in the request. See Content negotiation.\n\t */\n\tNotAcceptable = 406,\n\n\t/**\n\t * (RFC 7235) The client must first authenticate itself with the proxy.\n\t */\n\tProxyAuthenticationRequired = 407,\n\n\t/**\n\t * The server timed out waiting for the request. According to HTTP\n\t * specifications: \"The client did not produce a request within the time\n\t * that the server was prepared to wait. The client MAY repeat the request\n\t * without modifications at any later time.\"\n\t */\n\tRequestTimeout = 408,\n\n\t/**\n\t * Indicates that the request could not be processed because of conflict in\n\t * the current state of the resource, such as an edit conflict between\n\t * multiple simultaneous updates.\n\t */\n\tConflict = 409,\n\n\t/**\n\t * Indicates that the resource requested is no longer available and will not\n\t * be available again. This should be used when a resource has been\n\t * intentionally removed and the resource should be purged. Upon receiving a\n\t * 410 status code, the client should not request the resource in the future.\n\t * Clients such as search engines should remove the resource from their\n\t * indices. Most use cases do not require clients and search engines to\n\t * purge the resource, and a \"404 Not Found\" may be used instead.\n\t */\n\tGone = 410,\n\n\t/**\n\t * The request did not specify the length of its content, which is required\n\t * by the requested resource.\n\t */\n\tLengthRequired = 411,\n\n\t/**\n\t * (RFC 7232) The server does not meet one of the preconditions that the\n\t * requester put on the request header fields.\n\t */\n\tPreconditionFailed = 412,\n\n\t/**\n\t * (RFC 7231) The request is larger than the server is willing or able to\n\t * process. Previously called \"Request Entity Too Large\".\n\t */\n\tPayloadTooLarge = 413,\n\n\t/**\n\t * (RFC 7231) The URI provided was too long for the server to process. Often\n\t * the result of too much data being encoded as a query-string of a GET\n\t * request, in which case it should be converted to a POST request. Called\n\t * \"Request-URI Too Long\" previously.\n\t */\n\tURITooLong = 414,\n\n\t/**\n\t * (RFC 7231) The request entity has a media type which the server or\n\t * resource does not support. For example, the client uploads an image as\n\t * image/svg+xml, but the server requires that images use a different format.\n\t */\n\tUnsupportedMediaType = 415,\n\n\t/**\n\t * (RFC 7233) The client has asked for a portion of the file (byte serving),\n\t * but the server cannot supply that portion. For example, if the client\n\t * asked for a part of the file that lies beyond the end of the file. Called\n\t * \"Requested Range Not Satisfiable\" previously.\n\t */\n\tRangeNotSatisfiable = 416,\n\n\t/**\n\t * The server cannot meet the requirements of the Expect request-header\n\t * field.\n\t */\n\tExpectationFailed = 417,\n\n\t/**\n\t * (RFC 2324, RFC 7168) This code was defined in 1998 as one of the\n\t * traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot\n\t * Control Protocol, and is not expected to be implemented by actual HTTP\n\t * servers. The RFC specifies this code should be returned by teapots\n\t * requested to brew coffee. This HTTP status is used as an Easter egg in\n\t * some websites, such as Google.com's I'm a teapot easter egg.\n\t */\n\tIAmATeapot = 418,\n\n\t/**\n\t * Returned by the Twitter Search and Trends API when the client is being rate limited.\n\t * The text is a quote from 'Demolition Man' and the '420' code is likely a reference\n\t * to this number's association with marijuana. Other services may wish to implement\n\t * the 429 Too Many Requests response code instead.\n\t */\n\tEnhanceYourCalm = 420,\n\n\t/**\n\t * (RFC 7540) The request was directed at a server that is not able to\n\t * produce a response (for example because of connection reuse).\n\t */\n\tMisdirectedRequest = 421,\n\n\t/**\n\t * (WebDAV; RFC 4918) The request was well-formed but was unable to be\n\t * followed due to semantic errors.\n\t */\n\tUnprocessableEntity = 422,\n\n\t/**\n\t * (WebDAV; RFC 4918) The resource that is being accessed is locked.\n\t */\n\tLocked = 423,\n\n\t/**\n\t * (WebDAV; RFC 4918) The request failed because it depended on another\n\t * request and that request failed (e.g., a PROPPATCH).\n\t */\n\tFailedDependency = 424,\n\n\t/**\n\t * (RFC 8470) Indicates that the server is unwilling to risk processing a\n\t * request that might be replayed.\n\t */\n\tTooEarly = 425,\n\n\t/**\n\t * The client should switch to a different protocol such as TLS/1.0, given\n\t * in the Upgrade header field.\n\t */\n\tUpgradeRequired = 426,\n\n\t/**\n\t * (RFC 6585) The origin server requires the request to be conditional.\n\t * Intended to prevent the 'lost update' problem, where a client GETs a\n\t * resource's state, modifies it, and PUTs it back to the server, when\n\t * meanwhile a third party has modified the state on the server, leading to\n\t * a conflict.\n\t */\n\tPreconditionRequired = 428,\n\n\t/**\n\t * (RFC 6585) The user has sent too many requests in a given amount of time.\n\t * Intended for use with rate-limiting schemes.\n\t */\n\tTooManyRequests = 429,\n\n\t/**\n\t * (RFC 6585) The server is unwilling to process the request because either\n\t * an individual header field, or all the header fields collectively, are\n\t * too large.\n\t */\n\tRequestHeaderFieldsTooLarge = 431,\n\n\t/**\n\t * (RFC 7725) A server operator has received a legal demand to deny access\n\t * to a resource or to a set of resources that includes the requested\n\t * resource. The code 451 was chosen as a reference to the novel Fahrenheit\n\t * 451 (see the Acknowledgements in the RFC).\n\t */\n\tUnavailableForLegalReasons = 451,\n\n\t/**\n\t * A generic error message, given when an unexpected condition was\n\t * encountered and no more specific message is suitable.\n\t */\n\tInternalServerError = 500,\n\n\t/**\n\t * The server either does not recognize the request method, or it lacks the\n\t * ability to fulfil the request. Usually this implies future availability\n\t * (e.g., a new feature of a web-service API).\n\t */\n\tNotImplemented = 501,\n\n\t/**\n\t * The server was acting as a gateway or proxy and received an invalid\n\t * response from the upstream server.\n\t */\n\tBadGateway = 502,\n\n\t/**\n\t * The server cannot handle the request (because it is overloaded or down\n\t * for maintenance). Generally, this is a temporary state.\n\t */\n\tServiceUnavailable = 503,\n\n\t/**\n\t * The server was acting as a gateway or proxy and did not receive a timely\n\t * response from the upstream server.\n\t */\n\tGatewayTimeout = 504,\n\n\t/**\n\t * The server does not support the HTTP protocol version used in the request.\n\t */\n\tHTTPVersionNotSupported = 505,\n\n\t/**\n\t * (RFC 2295) Transparent content negotiation for the request results in a\n\t * circular reference.\n\t */\n\tVariantAlsoNegotiates = 506,\n\n\t/**\n\t * (WebDAV; RFC 4918) The server is unable to store the representation\n\t * needed to complete the request.\n\t */\n\tInsufficientStorage = 507,\n\n\t/**\n\t * (WebDAV; RFC 5842) The server detected an infinite loop while processing\n\t * the request (sent instead of 208 Already Reported).\n\t */\n\tLoopDetected = 508,\n\n\t/**\n\t * (RFC 2774) Further extensions to the request are required for the server\n\t * to fulfil it.\n\t */\n\tNotExtended = 510,\n\n\t/**\n\t * (RFC 6585) The client needs to authenticate to gain network access.\n\t * Intended for use by intercepting proxies used to control access to the\n\t * network (e.g., \"captive portals\" used to require agreement to Terms of\n\t * Service before granting full Internet access via a Wi-Fi hotspot).\n\t */\n\tNetworkAuthenticationRequired = 511\n}\n","import type { IdParserRead, IIdParser } from './IIdParser.js';\n\nexport class StringIdParser implements IIdParser {\n\tpublic run(customId: string): IdParserRead | null {\n\t\tif (customId.length === 0) return null;\n\n\t\tconst index = customId.indexOf('.');\n\n\t\tif (index === -1) {\n\t\t\treturn { name: customId, content: null };\n\t\t}\n\n\t\treturn {\n\t\t\tname: customId.slice(0, index),\n\t\t\tcontent: customId\n\t\t\t\t.slice(index + 1)\n\t\t\t\t.split('.')\n\t\t\t\t.map((contentEntry) => contentEntry || null)\n\t\t};\n\t}\n}\n","export enum PluginHook {\n\tPreGenericsInitialization = 'preGenericsInitialization',\n\tPreInitialization = 'preInitialization',\n\tPostInitialization = 'postInitialization',\n\tPreLoad = 'preLoad',\n\tPostListen = 'postListen'\n}\n","export const preGenericsInitialization: unique symbol = Symbol('HttpFrameworkPluginsPreGenericsInitialization');\nexport const preInitialization: unique symbol = Symbol('HttpFrameworkPluginsPreInitialization');\nexport const postInitialization: unique symbol = Symbol('HttpFrameworkPluginsPostInitialization');\n\nexport const preLoad: unique symbol = Symbol('HttpFrameworkPluginsPreLoad');\nexport const postListen: unique symbol = Symbol('HttpFrameworkPluginsPostListen');\n","import type { Awaitable } from '@sapphire/utilities';\nimport type { Client, ClientOptions } from '../Client.js';\nimport { PluginHook } from '../types/Enums.js';\nimport type { Plugin } from './Plugin.js';\nimport { postInitialization, postListen, preGenericsInitialization, preInitialization, preLoad } from './symbols.js';\n\nexport type AsyncPluginHooks = PluginHook.PreLoad | PluginHook.PostListen;\nexport interface HttpFrameworkPluginAsyncHook {\n\t(this: Client, options: ClientOptions): Awaitable<unknown>;\n}\n\nexport type SyncPluginHooks = Exclude<PluginHook, AsyncPluginHooks>;\nexport interface HttpFrameworkPluginHook {\n\t(this: Client, options: ClientOptions): unknown;\n}\n\nexport interface HttpFrameworkPluginHookEntry<T = HttpFrameworkPluginHook | HttpFrameworkPluginAsyncHook> {\n\thook: T;\n\ttype: PluginHook;\n\tname?: string;\n}\n\nexport class PluginManager {\n\tpublic readonly registry = new Set<HttpFrameworkPluginHookEntry>();\n\n\tpublic registerHook(hook: HttpFrameworkPluginHook, type: SyncPluginHooks, name?: string): this;\n\tpublic registerHook(hook: HttpFrameworkPluginAsyncHook, type: AsyncPluginHooks, name?: string): this;\n\tpublic registerHook(hook: HttpFrameworkPluginHook | HttpFrameworkPluginAsyncHook, type: PluginHook, name?: string): this {\n\t\tif (typeof hook !== 'function') throw new TypeError(`The provided hook ${name ? `(${name}) ` : ''}is not a function`);\n\t\tthis.registry.add({ hook, type, name });\n\t\treturn this;\n\t}\n\n\tpublic registerPreGenericsInitializationHook(hook: HttpFrameworkPluginHook, name?: string) {\n\t\treturn this.registerHook(hook, PluginHook.PreGenericsInitialization, name);\n\t}\n\n\tpublic registerPreInitializationHook(hook: HttpFrameworkPluginHook, name?: string) {\n\t\treturn this.registerHook(hook, PluginHook.PreInitialization, name);\n\t}\n\n\tpublic registerPostInitializationHook(hook: HttpFrameworkPluginHook, name?: string) {\n\t\treturn this.registerHook(hook, PluginHook.PostInitialization, name);\n\t}\n\n\tpublic registerPreLoadHook(hook: HttpFrameworkPluginAsyncHook, name?: string) {\n\t\treturn this.registerHook(hook, PluginHook.PreLoad, name);\n\t}\n\n\tpublic registerPostListenHook(hook: HttpFrameworkPluginAsyncHook, name?: string) {\n\t\treturn this.registerHook(hook, PluginHook.PostListen, name);\n\t}\n\n\tpublic use(plugin: typeof Plugin) {\n\t\tconst possibleSymbolHooks: [symbol, PluginHook][] = [\n\t\t\t[preGenericsInitialization, PluginHook.PreGenericsInitialization],\n\t\t\t[preInitialization, PluginHook.PreInitialization],\n\t\t\t[postInitialization, PluginHook.PostInitialization],\n\t\t\t[preLoad, PluginHook.PreLoad],\n\t\t\t[postListen, PluginHook.PostListen]\n\t\t];\n\t\tfor (const [hookSymbol, hookType] of possibleSymbolHooks) {\n\t\t\tconst hook = Reflect.get(plugin, hookSymbol) as HttpFrameworkPluginHook | HttpFrameworkPluginAsyncHook;\n\t\t\tif (typeof hook !== 'function') continue;\n\t\t\tthis.registerHook(hook, hookType as any, plugin.name);\n\t\t}\n\t\treturn this;\n\t}\n\n\tpublic values(): Generator<HttpFrameworkPluginHookEntry, void, unknown>;\n\tpublic values(hook: SyncPluginHooks): Generator<HttpFrameworkPluginHookEntry<HttpFrameworkPluginHook>, void, unknown>;\n\tpublic values(hook: AsyncPluginHooks): Generator<HttpFrameworkPluginHookEntry<HttpFrameworkPluginAsyncHook>, void, unknown>;\n\tpublic *values(hook?: PluginHook): Generator<HttpFrameworkPluginHookEntry, void, unknown> {\n\t\tfor (const plugin of this.registry) {\n\t\t\tif (hook && plugin.type !== hook) continue;\n\t\t\tyield plugin;\n\t\t}\n\t}\n}\n","import { container } from '@sapphire/pieces';\nimport type { Command } from '../../structures/Command.js';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver';\nimport type { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver.js';\n\nexport function ensureChatInputCommandResolver<Options extends Command.Options>(target: typeof Command<Options>): ChatInputCommandResolver {\n\treturn container.applicationCommandRegistry.ensure(target).makeChatInput();\n}\n\nexport function ensureContextMenuCommandResolver<Options extends Command.Options>(target: typeof Command<Options>): ContextMenuCommandResolver {\n\treturn container.applicationCommandRegistry.ensure(target).makeContextMenu();\n}\n","import type { Command } from '../../structures/Command';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver';\nimport { ensureChatInputCommandResolver } from './_shared';\n\n/**\n * Registers a command for the chat input.\n *\n * @template Options - The options type for the command.\n * @param data - The command data.\n * @example\n * ```typescript\n * import { Command, RegisterCommand } from '@wolfstar/http-framework';\n *\n * (at)RegisterCommand({\n * \tname: 'ping',\n * \tdescription: 'A simple ping pong command'\n * })\n * export class UserCommand extends Command {\n * \tpublic async run(interaction: Command.ChatInputInteraction) {\n * \t\treturn interaction.reply('Pong!');\n * \t}\n * }\n * ```\n */\nexport function RegisterCommand<Options extends Command.Options = Command.Options>(data: ChatInputCommandResolver.CommandData) {\n\treturn function decorate(target: typeof Command<Options>) {\n\t\tensureChatInputCommandResolver(target).setCommand(data);\n\t};\n}\n","import { ApplicationCommandType } from 'discord-api-types/v10';\nimport type { Command } from '../../structures/Command';\nimport type { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver';\nimport { ensureContextMenuCommandResolver } from './_shared';\n\n/**\n * Registers a message command.\n *\n * @template Options - The options type for the command.\n * @param data - The command to register.\n * @returns A method decorator function, does not override the method.\n * @example\n * ```typescript\n * export class UserCommand extends Command {\n * \t(at)RegisterMessageCommand(createData())\n * \tpublic run(interaction: Command.MessageInteraction, data: TransformedArguments.Message) {\n * \t\t// ...\n * \t}\n * }\n * ```\n */\nexport function RegisterMessageCommand<Options extends Command.Options = Command.Options>(data: ContextMenuCommandResolver.CommandData) {\n\treturn function decorate(target: Command<Options>, method: string) {\n\t\tensureContextMenuCommandResolver(target.constructor as typeof Command).setCommand(data, ApplicationCommandType.Message, method);\n\t};\n}\n","import type { Command } from '../../structures/Command';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver';\nimport { ensureChatInputCommandResolver } from './_shared';\n\n/**\n * Registers a subcommand for a chat input command.\n *\n * @remarks This decorator must be used in conjunction with {@link RegisterSubcommand}.\n * @param data - The subcommand data.\n * @param subCommandGroupName - Optional name of the subcommand group.\n * @returns A decorator function that adds the subcommand to the target command.\n * @example\n * ```typescript\n * import { Command, RegisterCommand, RegisterSubcommand, RegisterSubcommandGroup } from '@wolfstar/http-framework';\n *\n * (at)RegisterCommand({\n * \tname: 'ping',\n * \tdescription: 'A simple ping pong command'\n * })\n * export class UserCommand extends Command {\n * \t(at)RegisterSubcommand({\n * \t\tname: 'subcommand',\n * \t\tdescription: 'A simple subcommand'\n * \t})\n * \tpublic async run(interaction: Command.ChatInputInteraction) {\n * \t\treturn interaction.reply('Pong!');\n * \t}\n * }\n * ```\n */\nexport function RegisterSubcommand<Options extends Command.Options = Command.Options>(\n\tdata: ChatInputCommandResolver.SubcommandData,\n\tsubCommandGroupName?: string | null\n) {\n\treturn function decorate(target: Command<Options>, method: string) {\n\t\tensureChatInputCommandResolver(target.constructor as typeof Command).addSubcommand(data, method, subCommandGroupName);\n\t};\n}\n","import type { Command } from '../../structures/Command';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver';\nimport { ensureChatInputCommandResolver } from './_shared';\n\n/**\n * Registers a subcommand group for a chat input command.\n *\n * @remarks This decorator must be used in conjunction with {@link RegisterSubcommand}.\n * @template Options - The options type for the command.\n * @param data - The subcommand group data.\n * @example\n * ```typescript\n * import { Command, RegisterCommand, RegisterSubcommand, RegisterSubcommandGroup } from '@wolfstar/http-framework';\n *\n * (at)RegisterCommand({\n * \tname: 'ping',\n * \tdescription: 'A simple ping pong command'\n * })\n * export class UserCommand extends Command {\n * \t(at)RegisterSubcommandGroup({\n * \t\tname: 'subcommand-group',\n * \t\tdescription: 'A simple subcommand group'\n * \t})\n * \t(at)RegisterSubcommand(\n * \t\t{ name: 'subcommand', description: 'A simple subcommand' },\n * \t\t'subcommand-group'\n * \t)\n * \tpublic async run(interaction: Command.ChatInputInteraction) {\n * \t\treturn interaction.reply('Pong!');\n * \t}\n * }\n * ```\n */\nexport function RegisterSubcommandGroup<Options extends Command.Options = Command.Options>(data: ChatInputCommandResolver.SubcommandGroupData) {\n\treturn function decorate(target: Command<Options>, method: string) {\n\t\tensureChatInputCommandResolver(target.constructor as typeof Command).addSubcommandGroup(data, method);\n\t};\n}\n","import { ApplicationCommandType } from 'discord-api-types/v10';\nimport type { Command } from '../../structures/Command';\nimport type { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver';\nimport { ensureContextMenuCommandResolver } from './_shared';\n\n/**\n * Registers a user command.\n *\n * @template Options - The options type for the command.\n * @param data - The command to register.\n * @returns A method decorator function, does not override the method.\n * @example\n * ```typescript\n * export class UserCommand extends Command {\n * \t(at)RegisterUserCommand(createData())\n * \tpublic run(interaction: Command.UserInteraction, data: TransformedArguments.User) {\n * \t\t// ...\n * \t}\n * }\n * ```\n */\nexport function RegisterUserCommand<Options extends Command.Options = Command.Options>(data: ContextMenuCommandResolver.CommandData) {\n\treturn function decorate(target: Command<Options>, method: string) {\n\t\tensureContextMenuCommandResolver(target.constructor as typeof Command).setCommand(data, ApplicationCommandType.User, method);\n\t};\n}\n","import { Collection } from '@discordjs/collection';\nimport type { Command } from '../../structures/Command.js';\n\nexport const restrictedGuildIdRegistry = new Collection<typeof Command<Command.Options>, readonly string[]>();\n\n/**\n * Decorator that restricts the guild IDs for a command.\n *\n * @param guildIds An array of guild IDs to restrict the command to.\n * @returns A decorator function.\n * @example\n * ```typescript\n * import { Command, RegisterCommand, RestrictGuildIds } from '@wolfstar/http-framework';\n *\n * (at)RegisterCommand({\n * \tname: 'ping',\n * \tdescription: 'A simple ping pong command'\n * })\n * (at)RestrictGuildIds(['123456789012345678', '123456789012345679'])\n * export class UserCommand extends Command {\n * \tpublic async run(interaction: Command.ChatInputInteraction) {\n * \t\treturn interaction.reply('Pong!');\n * \t}\n * }\n * ```\n */\nexport function RestrictGuildIds<Options extends Command.Options = Command.Options>(guildIds: readonly string[]) {\n\treturn function decorate(target: typeof Command<Options>) {\n\t\trestrictedGuildIdRegistry.set(target, guildIds);\n\t};\n}\n","import type { NonNullObject } from '@sapphire/utilities';\nimport {\n\tApplicationCommandOptionType,\n\ttype APIApplicationCommandInteractionDataBasicOption,\n\ttype APIApplicationCommandInteractionDataMentionableOption,\n\ttype APIApplicationCommandInteractionDataOption,\n\ttype APIApplicationCommandInteractionDataSubcommandGroupOption,\n\ttype APIApplicationCommandInteractionDataSubcommandOption,\n\ttype APIAttachment,\n\ttype APIInteractionDataResolved,\n\ttype APIInteractionDataResolvedChannel,\n\ttype APIInteractionDataResolvedGuildMember,\n\ttype APIMessage,\n\ttype APIMessageApplicationCommandInteractionData,\n\ttype APIRole,\n\ttype APIUser,\n\ttype APIUserApplicationCommandInteractionData\n} from 'discord-api-types/v10';\n\nexport function transformInteraction<T extends NonNullObject>(\n\tresolved: APIInteractionDataResolved,\n\toptions: readonly APIApplicationCommandInteractionDataOption[]\n): InteractionArguments<T> {\n\tconst extracted = extractTopLevelOptions(options);\n\treturn {\n\t\tsubCommand: extracted.subCommand?.name ?? null,\n\t\tsubCommandGroup: extracted.subCommandGroup?.name ?? null,\n\t\t...(transformArguments(resolved, extracted.options) as T)\n\t};\n}\n\nexport type InteractionArguments<T extends NonNullObject> = T & {\n\t/**\n\t * The name of the subcommand that was used by the user, if any.\n\t */\n\tsubCommand: string | null;\n\n\t/**\n\t * The name of the subcommand group that was used by the user, if any.\n\t */\n\tsubCommandGroup: string | null;\n};\n\nexport function transformAutocompleteInteraction<T extends NonNullObject>(\n\tresolved: APIInteractionDataResolved,\n\toptions: readonly APIApplicationCommandInteractionDataOption[]\n): AutocompleteInteractionArguments<T> {\n\tconst extracted = extractTopLevelOptions(options);\n\tconst focused = extracted.options.find((option) => (option as any).focused);\n\treturn {\n\t\tsubCommand: extracted.subCommand?.name ?? null,\n\t\tsubCommandGroup: extracted.subCommandGroup?.name ?? null,\n\t\tfocused: typeof focused === 'undefined' ? null : (focused.name as keyof T),\n\t\t...(transformArguments(resolved, extracted.options) as T)\n\t};\n}\n\nexport type AutocompleteInteractionArguments<T extends NonNullObject> = InteractionArguments<T> & {\n\t/**\n\t * The name of the argument that is focused, if any.\n\t */\n\tfocused: keyof T | null;\n};\n\nexport function extractTopLevelOptions(options: readonly APIApplicationCommandInteractionDataOption[]): ExtractedOptions {\n\tif (options.length) {\n\t\tconst [firstOption] = options;\n\t\tif (firstOption.type === ApplicationCommandOptionType.SubcommandGroup) {\n\t\t\tconst subCommand = firstOption.options[0];\n\t\t\treturn {\n\t\t\t\tsubCommandGroup: firstOption,\n\t\t\t\tsubCommand,\n\t\t\t\toptions: subCommand.options ?? []\n\t\t\t};\n\t\t}\n\n\t\tif (firstOption.type === ApplicationCommandOptionType.Subcommand) {\n\t\t\treturn {\n\t\t\t\tsubCommandGroup: null,\n\t\t\t\tsubCommand: firstOption,\n\t\t\t\toptions: firstOption.options ?? []\n\t\t\t};\n\t\t}\n\t}\n\n\treturn {\n\t\tsubCommandGroup: null,\n\t\tsubCommand: null,\n\t\toptions: options as readonly APIApplicationCommandInteractionDataBasicOption[]\n\t};\n}\n\nexport interface ExtractedOptions {\n\tsubCommandGroup: APIApplicationCommandInteractionDataSubcommandGroupOption | null;\n\tsubCommand: APIApplicationCommandInteractionDataSubcommandOption | null;\n\toptions: readonly APIApplicationCommandInteractionDataBasicOption[];\n}\n\nfunction transformArguments(\n\tresolved: APIInteractionDataResolved,\n\toptions: readonly APIApplicationCommandInteractionDataBasicOption[]\n): NonNullObject {\n\treturn Object.fromEntries(options.map((option) => [option.name, transformArgument(resolved, option)]));\n}\n\nfunction transformArgument(resolved: APIInteractionDataResolved, option: APIApplicationCommandInteractionDataBasicOption): TransformedArguments.Any {\n\tswitch (option.type) {\n\t\tcase ApplicationCommandOptionType.Attachment:\n\t\t\treturn resolved.attachments?.[option.value] ?? { id: option.value };\n\t\tcase ApplicationCommandOptionType.Channel:\n\t\t\treturn resolved.channels?.[option.value] ?? { id: option.value };\n\t\tcase ApplicationCommandOptionType.Mentionable:\n\t\t\treturn transformMentionable(resolved, option);\n\t\tcase ApplicationCommandOptionType.Role:\n\t\t\treturn resolved.roles?.[option.value] ?? { id: option.value };\n\t\tcase ApplicationCommandOptionType.User:\n\t\t\treturn { id: option.value, user: resolved.users?.[option.value] ?? null, member: resolved.members?.[option.value] ?? null };\n\t\tdefault:\n\t\t\treturn option.value;\n\t}\n}\n\nfunction transformMentionable(\n\tresolved: APIInteractionDataResolved,\n\toption: APIApplicationCommandInteractionDataMentionableOption\n): TransformedArguments.Mentionable {\n\tconst id = option.value;\n\n\tconst user = resolved.users?.[id];\n\tif (user) return { id, user, member: resolved.members?.[id] ?? null };\n\n\tconst channel = resolved.channels?.[id];\n\tif (channel) return { id, channel };\n\n\tconst role = resolved.roles?.[id];\n\tif (role) return { id, role };\n\n\treturn { id };\n}\n\nexport function transformUserInteraction(data: APIUserApplicationCommandInteractionData): TransformedArguments.User {\n\treturn { id: data.target_id, user: data.resolved.users[data.target_id], member: data.resolved.members?.[data.target_id] ?? null };\n}\n\nexport function transformMessageInteraction(data: APIMessageApplicationCommandInteractionData): TransformedArguments.Message {\n\treturn { id: data.target_id, message: data.resolved.messages[data.target_id] };\n}\n\nexport namespace TransformedArguments {\n\texport interface BasePartial {\n\t\tid: string;\n\t}\n\n\texport interface Message extends BasePartial {\n\t\tmessage: APIMessage;\n\t}\n\n\texport interface User extends BasePartial {\n\t\tuser: APIUser;\n\t\tmember: APIInteractionDataResolvedGuildMember | null;\n\t}\n\n\texport type Channel = APIInteractionDataResolvedChannel;\n\texport type Role = APIRole;\n\texport type Attachment = APIAttachment;\n\n\texport type Mentionable =\n\t\t| (BasePartial & User) //\n\t\t| (BasePartial & { channel: Channel })\n\t\t| (BasePartial & { role: Role })\n\t\t| BasePartial;\n\n\texport type Any = User | Channel | Role | Mentionable | number | string | boolean | Attachment | PartialAny;\n\n\texport interface PartialUser extends Omit<User, 'user'> {\n\t\tuser: User['user'] | null;\n\t}\n\n\texport type PartialAttachment = BasePartial;\n\texport type PartialChannel = BasePartial;\n\texport type PartialRole = BasePartial;\n\n\texport type PartialAny = PartialUser | PartialChannel | PartialRole | PartialAttachment;\n}\n\n/**\n * A map of the argument types to their respective resolved values.\n */\nexport interface ArgumentTypes {\n\t[ApplicationCommandOptionType.Attachment]: TransformedArguments.Attachment;\n\t[ApplicationCommandOptionType.Boolean]: boolean;\n\t[ApplicationCommandOptionType.Channel]: TransformedArguments.Channel;\n\t[ApplicationCommandOptionType.Integer]: number;\n\t[ApplicationCommandOptionType.Mentionable]: TransformedArguments.Mentionable;\n\t[ApplicationCommandOptionType.Number]: number;\n\t[ApplicationCommandOptionType.Role]: TransformedArguments.Role;\n\t[ApplicationCommandOptionType.String]: string;\n\t[ApplicationCommandOptionType.User]: TransformedArguments.User;\n\tattachment: this[ApplicationCommandOptionType.Attachment];\n\tboolean: this[ApplicationCommandOptionType.Boolean];\n\tchannel: this[ApplicationCommandOptionType.Channel];\n\tinteger: this[ApplicationCommandOptionType.Integer];\n\tmentionable: this[ApplicationCommandOptionType.Mentionable];\n\tnumber: this[ApplicationCommandOptionType.Number];\n\trole: this[ApplicationCommandOptionType.Role];\n\tstring: this[ApplicationCommandOptionType.String];\n\tuser: this[ApplicationCommandOptionType.User];\n}\n\n/**\n * Convenience type for creating arguments out of strings.\n *\n * @example\n * ```typescript\n * // Using named string:\n * type Options = MakeArguments<{\n * \tname: 'string';\n * \tfile: 'attachment';\n * }>;\n *\n * // ➥ type Options = {\n * // \tname: string;\n * // \tattachment: APIAttachment;\n * // };\n * ```\n *\n * @example\n * ```typescript\n * // Using named string:\n * type Options = MakeArguments<{\n * \tname: ApplicationCommandOptionType.String;\n * \tfile: ApplicationCommandOptionType.Attachment;\n * }>;\n *\n * // ➥ type Options = {\n * // \tname: string;\n * // \tattachment: APIAttachment;\n * // };\n * ```\n */\nexport type MakeArguments<T extends Record<string, keyof ArgumentTypes>> = { [K in keyof T]: ArgumentTypes[T[K]] };\n","const linkSymbol = Symbol('decorated-command.method.link');\n\n/**\n * Links the specified object with a name.\n *\n * @template T - The type of the object.\n * @param object - The object to link.\n * @param name - The name to link the object with.\n * @returns The linked object.\n * @internal\n */\nexport function linkMethod<T extends object>(object: T, name: string): T {\n\tObject.defineProperty(object, linkSymbol, { value: name });\n\treturn object;\n}\n\n/**\n * Retrieves the linked method from the given object.\n *\n * @param object - The object from which to retrieve the method.\n * @returns The name of the linked method as a string, or `null` if not found.\n * @internal\n */\nexport function getLinkedMethod(object: object): string | null {\n\treturn Reflect.get(object, linkSymbol) ?? null;\n}\n","import { SlashCommandBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from '@discordjs/builders';\nimport { isJSONEncodable, type JSONEncodable } from '@discordjs/util';\nimport { isFunction, isNullish } from '@sapphire/utilities';\nimport {\n\tApplicationCommandOptionType,\n\tApplicationCommandType,\n\ttype APIApplicationCommandOption,\n\ttype APIApplicationCommandSubcommandGroupOption,\n\ttype APIApplicationCommandSubcommandOption,\n\ttype RESTPostAPIChatInputApplicationCommandsJSONBody\n} from 'discord-api-types/v10';\nimport type { Void } from '../../utils/internals.js';\nimport { getLinkedMethod, linkMethod } from '../shared/link.js';\n\n/**\n * The command resolver for chat input commands.\n * @internal\n */\nexport class ChatInputCommandResolver implements JSONEncodable<ChatInputCommandResolver.ResolvedCommand> {\n\t#data: ChatInputCommandResolver.ResolvedCommand | null = null;\n\t#commandData: ChatInputCommandResolver.CommandData | null = null;\n\t#subcommandGroupData: [method: string | null, ChatInputCommandResolver.SubcommandGroupData][] = [];\n\t#subcommandData: (readonly [method: string | null, groupName: string | null, data: ChatInputCommandResolver.SubcommandData])[] = [];\n\n\t/**\n\t * Sets the command data for the ChatInputCommandResolver.\n\t *\n\t * @param data - The command data to set.\n\t * @returns The instance of ChatInputCommandResolver.\n\t */\n\tpublic setCommand(data: ChatInputCommandResolver.CommandData) {\n\t\tthis.#commandData = data;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a subcommand group to the ChatInputCommandResolver.\n\t *\n\t * @param data - The data of the subcommand group.\n\t * @param method - The method associated with the subcommand group (optional).\n\t * @returns The updated ChatInputCommandResolver instance.\n\t */\n\tpublic addSubcommandGroup(data: ChatInputCommandResolver.SubcommandGroupData, method?: string | null) {\n\t\tthis.#subcommandGroupData.push([method ?? null, data]);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a subcommand to the ChatInputCommandResolver.\n\t *\n\t * @param data - The data of the subcommand.\n\t * @param method - The method of the subcommand (optional).\n\t * @param groupName - The group name of the subcommand (optional).\n\t * @returns The updated ChatInputCommandResolver instance.\n\t */\n\tpublic addSubcommand(data: ChatInputCommandResolver.SubcommandData, method?: string | null, groupName?: string | null): this {\n\t\tthis.#subcommandData.push([method ?? null, groupName ?? null, data]);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Converts the ChatInputCommandResolver instance to a JSON representation.\n\t *\n\t * @returns The JSON representation of the ChatInputCommandResolver instance.\n\t */\n\tpublic toJSON(): ChatInputCommandResolver.ResolvedCommand {\n\t\treturn (this.#data ??= this.#resolve());\n\t}\n\n\t/**\n\t * Resolves the chat input command.\n\t *\n\t * @returns The resolved command.\n\t */\n\t#resolve(): ChatInputCommandResolver.ResolvedCommand {\n\t\tconst command = this.#normalizeCommand(this.#commandData);\n\t\tthis.#resolveSubcommandGroups(command);\n\t\tthis.#resolveSubcommands(command);\n\n\t\treturn command;\n\t}\n\n\t/**\n\t * Resolves the subcommand groups for the given command.\n\t *\n\t * @param command The resolved command.\n\t */\n\t#resolveSubcommandGroups(command: ChatInputCommandResolver.ResolvedCommand) {\n\t\tif (this.#subcommandGroupData.length === 0) return;\n\n\t\tcommand.options ??= [];\n\t\tfor (const [method, entry] of this.#subcommandGroupData) {\n\t\t\tlet data = this.#normalizeSubcommandGroup(entry);\n\t\t\tconst index = command.options.findIndex((option) => option.name === data.name);\n\t\t\tif (index === -1) {\n\t\t\t\tcommand.options.push(data);\n\t\t\t} else {\n\t\t\t\tdata = this.#mergeOption(command.options[index], data);\n\t\t\t\tcommand.options[index] = data;\n\t\t\t}\n\n\t\t\tif (method) linkMethod(data, method);\n\t\t}\n\t}\n\n\t/**\n\t * Resolves the subcommands for a given command.\n\t *\n\t * @param command - The resolved command object.\n\t */\n\t#resolveSubcommands(command: ChatInputCommandResolver.ResolvedCommand) {\n\t\tif (this.#subcommandData.length === 0) return;\n\n\t\tcommand.options ??= [];\n\t\tfor (const [method, groupName, entry] of this.#subcommandData) {\n\t\t\tlet data = this.#normalizeSubcommand(entry);\n\n\t\t\tlet parent: ChatInputCommandResolver.ResolvedCommand | ChatInputCommandResolver.ResolvedSubcommandGroup;\n\t\t\tif (groupName === null) {\n\t\t\t\tparent = command;\n\t\t\t} else {\n\t\t\t\tconst group = command.options.find((option) => option.name === groupName) as APIApplicationCommandOption | undefined;\n\t\t\t\tif (group === undefined) {\n\t\t\t\t\tthrow new Error(`The command '${command.name}' has no subcommand group named '${groupName}'`);\n\t\t\t\t}\n\n\t\t\t\tif (group.type !== ApplicationCommandOptionType.SubcommandGroup) {\n\t\t\t\t\tthrow new Error(`The command '${command.name}' has an option named '${groupName}' that is not a group`);\n\t\t\t\t}\n\n\t\t\t\tparent = group;\n\t\t\t}\n\n\t\t\tparent.options ??= [];\n\t\t\tconst index = parent.options.findIndex((option) => option.name === data.name);\n\t\t\tif (index === -1) {\n\t\t\t\tparent.options.push(data);\n\t\t\t} else {\n\t\t\t\tdata = this.#mergeOption(parent.options[index], data);\n\t\t\t\tparent.options[index] = data;\n\t\t\t}\n\n\t\t\tif (!method) continue;\n\n\t\t\tconst dataMethod = getLinkedMethod(data);\n\t\t\tif (dataMethod) {\n\t\t\t\tif (dataMethod !== method) {\n\t\t\t\t\tthrow new Error(`The command '${command.name}' has a subcommand named '${data.name}' that was already linked to '${dataMethod}'`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlinkMethod(data, method);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Normalizes the command data and returns the resolved command.\n\t *\n\t * @param data The command data to be normalized.\n\t * @returns The resolved command.\n\t * @throws An `Error` if the command data is null or undefined.\n\t */\n\t#normalizeCommand(data: ChatInputCommandResolver.CommandData | null): ChatInputCommandResolver.ResolvedCommand {\n\t\tif (isNullish(data)) {\n\t\t\tthrow new Error('Could not normalize command data');\n\t\t}\n\n\t\tif (isFunction(data)) {\n\t\t\tconst builder = new SlashCommandBuilder();\n\t\t\tdata = data(builder) ?? builder;\n\t\t}\n\n\t\treturn { type: ApplicationCommandType.ChatInput, ...(isJSONEncodable(data) ? data.toJSON() : data) };\n\t}\n\n\t/**\n\t * Normalizes the subcommand group data and returns the resolved subcommand group.\n\t *\n\t * @param data - The subcommand group data to be normalized.\n\t * @returns The normalized subcommand group.\n\t */\n\t#normalizeSubcommandGroup(data: ChatInputCommandResolver.SubcommandGroupData): ChatInputCommandResolver.ResolvedSubcommandGroup {\n\t\tif (isFunction(data)) {\n\t\t\tconst builder = new SlashCommandSubcommandGroupBuilder();\n\t\t\tdata = data(builder) ?? builder;\n\t\t}\n\n\t\treturn { type: ApplicationCommandOptionType.SubcommandGroup, ...(isJSONEncodable(data) ? data.toJSON() : data) };\n\t}\n\n\t/**\n\t * Normalizes the subcommand data and returns the resolved subcommand.\n\t *\n\t * @param data - The subcommand data to be normalized.\n\t * @returns The resolved subcommand.\n\t */\n\t#normalizeSubcommand(data: ChatInputCommandResolver.SubcommandData): ChatInputCommandResolver.ResolvedSubcommand {\n\t\tif (isFunction(data)) {\n\t\t\tconst builder = new SlashCommandSubcommandBuilder();\n\t\t\tdata = data(builder) ?? builder;\n\t\t}\n\n\t\treturn { type: ApplicationCommandOptionType.Subcommand, ...(isJSONEncodable(data) ? data.toJSON() : data) };\n\t}\n\n\t/**\n\t * Merges two arrays of {@linkcode APIApplicationCommandOption} objects.\n\t *\n\t * - If the 'existing' array is empty or undefined, the 'data' array is returned.\n\t * - If the 'data' array is empty or undefined, the 'existing' array is returned.\n\t * - If both arrays have elements, the options with the same name are merged.\n\t *\n\t * @param existing The existing array of {@linkcode APIApplicationCommandOption} objects.\n\t * @param data The data array of {@linkcode APIApplicationCommandOption} objects.\n\t * @returns The merged array of {@linkcode APIApplicationCommandOption} objects.\n\t */\n\t#mergeOptions(\n\t\texisting: APIApplicationCommandOption[] | undefined,\n\t\tdata: APIApplicationCommandOption[] | undefined\n\t): APIApplicationCommandOption[] {\n\t\tif (!existing?.length) return data ?? [];\n\t\tif (!data?.length) return existing;\n\n\t\tconst entries = new Map(existing.map((option) => [option.name, option]));\n\t\tfor (const option of data) {\n\t\t\tentries.set(option.name, this.#mergeOption(entries.get(option.name), option));\n\t\t}\n\n\t\treturn [...entries.values()];\n\t}\n\n\t/**\n\t * Merges two {@linkcode APIApplicationCommandOption} objects.\n\t *\n\t * - If the `existing` option is not provided, the `data` option is returned.\n\t * - If the types of the existing and data options do not match, a {@link TypeError} is thrown.\n\t * - If both existing and data options have 'options' property, the options are recursively merged.\n\t * - Otherwise, the options are shallow merged.\n\t * - If a method is present in either the data or existing option, it is linked to the merged option.\n\t *\n\t * @param existing - The existing {@linkcode APIApplicationCommandOption} object.\n\t * @param data - The data {@linkcode APIApplicationCommandOption} object.\n\t * @returns The merged {@linkcode APIApplicationCommandOption} object.\n\t */\n\t#mergeOption<Option extends APIApplicationCommandOption>(existing: APIApplicationCommandOption | undefined, data: Option): Option {\n\t\tif (!existing) return data;\n\t\tif (existing.type !== data.type) {\n\t\t\tconst existingType = ApplicationCommandOptionType[existing.type];\n\t\t\tconst dataType = ApplicationCommandOptionType[data.type];\n\t\t\tthrow new TypeError(`Mismatching types, expected '${existingType}', but received '${dataType}'`);\n\t\t}\n\n\t\tconst merged =\n\t\t\t'options' in existing && 'options' in data\n\t\t\t\t? { ...existing, ...data, options: this.#mergeOptions(existing.options, data.options) }\n\t\t\t\t: { ...existing, ...data };\n\n\t\tconst method = getLinkedMethod(data) ?? getLinkedMethod(existing);\n\t\treturn method ? linkMethod(merged, method) : merged;\n\t}\n}\n\nexport namespace ChatInputCommandResolver {\n\texport type CommandDataResolvable = Omit<ResolvedCommand, 'type'> | JSONEncodable<ResolvedCommand>;\n\texport type CommandData =\n\t\t| CommandDataResolvable //\n\t\t| ((builder: SlashCommandBuilder) => CommandDataResolvable | Void);\n\n\texport type SubcommandGroupDataResolvable = Omit<ResolvedSubcommandGroup, 'type'> | JSONEncodable<ResolvedSubcommandGroup>;\n\texport type SubcommandGroupData =\n\t\t| SubcommandGroupDataResolvable //\n\t\t| ((builder: SlashCommandSubcommandGroupBuilder) => SubcommandGroupDataResolvable | Void);\n\n\texport type SubcommandDataResolvable = Omit<ResolvedSubcommand, 'type'> | JSONEncodable<ResolvedSubcommand>;\n\texport type SubcommandData =\n\t\t| SubcommandDataResolvable //\n\t\t| ((builder: SlashCommandSubcommandBuilder) => SubcommandDataResolvable | Void);\n\n\texport type ResolvedCommand = RESTPostAPIChatInputApplicationCommandsJSONBody;\n\texport type ResolvedSubcommandGroup = APIApplicationCommandSubcommandGroupOption;\n\texport type ResolvedSubcommand = APIApplicationCommandSubcommandOption;\n}\n","import { ContextMenuCommandBuilder, type ContextMenuCommandType } from '@discordjs/builders';\nimport { isJSONEncodable, type JSONEncodable } from '@discordjs/util';\nimport { isFunction, isNullish } from '@sapphire/utilities';\nimport type { RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10';\nimport type { Void } from '../../utils/internals.js';\nimport { linkMethod } from '../shared/link.js';\n\n/**\n * The command resolver for context menu commands.\n * @internal\n */\nexport class ContextMenuCommandResolver implements JSONEncodable<ContextMenuCommandResolver.ResolvedCommand> {\n\t#data: ContextMenuCommandResolver.ResolvedCommand | null = null;\n\t#commandData: ContextMenuCommandResolver.CommandData | null = null;\n\t#commandType: ContextMenuCommandType | null = null;\n\t#commandMethod: string | null = null;\n\n\t/**\n\t * Sets the command data, type, and method for the context menu command resolver.\n\t *\n\t * @param data - The command data.\n\t * @param type - The command type.\n\t * @param method - The command method (optional).\n\t * @returns The updated context menu command resolver.\n\t */\n\tpublic setCommand(data: ContextMenuCommandResolver.CommandData, type: ContextMenuCommandType, method?: string | null) {\n\t\tthis.#commandData = data;\n\t\tthis.#commandType = type;\n\t\tthis.#commandMethod = method ?? null;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Converts the {@linkcode ContextMenuCommandResolver} instance to a JSON representation.\n\t *\n\t * @returns The JSON representation of the {@linkcode ContextMenuCommandResolver} instance.\n\t */\n\tpublic toJSON(): ContextMenuCommandResolver.ResolvedCommand {\n\t\treturn (this.#data ??= this.#resolve());\n\t}\n\n\t/**\n\t * Resolves the context menu command.\n\t *\n\t * @returns The resolved command.\n\t */\n\t#resolve(): ContextMenuCommandResolver.ResolvedCommand {\n\t\tconst data = this.#commandData;\n\t\tconst type = this.#commandType;\n\t\tif (isNullish(data) || isNullish(type)) {\n\t\t\tthrow new Error('Could not normalize command data');\n\t\t}\n\n\t\tconst resolved = this.#normalizeContextMenuCommand(data, type);\n\t\treturn this.#commandMethod ? linkMethod(resolved, this.#commandMethod) : resolved;\n\t}\n\n\t/**\n\t * Normalizes the context menu command.\n\t *\n\t * @param data - The command data.\n\t * @param type - The command type.\n\t * @returns The normalized context menu command.\n\t */\n\t#normalizeContextMenuCommand(\n\t\tdata: ContextMenuCommandResolver.CommandData,\n\t\ttype: ContextMenuCommandType\n\t): RESTPostAPIContextMenuApplicationCommandsJSONBody {\n\t\tif (isFunction(data)) {\n\t\t\tconst builder = new ContextMenuCommandBuilder().setType(type);\n\t\t\tdata = data(builder) ?? builder;\n\t\t}\n\n\t\treturn { type, ...(isJSONEncodable(data) ? data.toJSON() : data) };\n\t}\n}\n\nexport namespace ContextMenuCommandResolver {\n\texport type CommandDataResolvable =\n\t\t| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'type'>\n\t\t| JSONEncodable<RESTPostAPIContextMenuApplicationCommandsJSONBody>;\n\texport type CommandData =\n\t\t| CommandDataResolvable //\n\t\t| ((builder: ContextMenuCommandBuilder) => CommandDataResolvable | Void);\n\n\texport type ResolvedCommand = RESTPostAPIContextMenuApplicationCommandsJSONBody;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { JSONEncodable } from '@discordjs/util';\nimport type {\n\tRESTPostAPIApplicationCommandsJSONBody,\n\tRESTPostAPIPrimaryEntryPointApplicationCommandJSONBody,\n\tSnowflake\n} from 'discord-api-types/v10';\nimport { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver.js';\nimport { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver.js';\n\n/**\n * Represents an entry in the application command registry.\n *\n * This class provides methods to manage and manipulate application command data.\n *\n * @since 2.0.0\n */\nexport class ApplicationCommandRegistryEntry implements JSONEncodable<ApplicationCommandRegistryEntry.Command[]> {\n\t#chatInput: ChatInputCommandResolver | null = null;\n\t#contextMenu: ContextMenuCommandResolver[] = [];\n\t#ids = new Collection<null | Snowflake, Snowflake>();\n\n\t/**\n\t * Retrieves the loaded global ID of the {@linkcode ApplicationCommandRegistryEntry}.\n\t *\n\t * @since 2.0.0\n\t * @returns The loaded global ID of the {@linkcode ApplicationCommandRegistryEntry}, or `null` if it's not set.\n\t */\n\tpublic getGlobalId(): Snowflake | null {\n\t\treturn this.#ids.get(null) ?? null;\n\t}\n\n\t/**\n\t * Sets the loaded global ID for the {@linkcode ApplicationCommandRegistryEntry}.\n\t *\n\t * @since 2.0.0\n\t * @param value - The Snowflake value to set as the global ID.\n\t * @returns The updated {@linkcode ApplicationCommandRegistryEntry} instance.\n\t */\n\tpublic setGlobalId(value: Snowflake) {\n\t\tthis.#ids.set(null, value);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Retrieves the loaded guild ID associated with the given guild ID.\n\t *\n\t * @since 2.0.0\n\t * @param guildId The guild ID to retrieve.\n\t * @returns The associated guild ID, or null if not found.\n\t */\n\tpublic getGuildId(guildId: Snowflake): Snowflake | null {\n\t\treturn this.#ids.get(guildId) ?? null;\n\t}\n\n\t/**\n\t * Sets the loaded guild ID for the registry entry.\n\t *\n\t * @since 2.0.0\n\t * @param guildId - The guild ID to set.\n\t * @param value - The value to associate with the guild ID.\n\t * @returns The updated registry entry.\n\t */\n\tpublic setGuildId(guildId: Snowflake, value: Snowflake): this {\n\t\tthis.#ids.set(guildId, value);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Gets the chat input command resolver.\n\t *\n\t * @since 2.0.0\n\t * @returns The chat input command resolver or `null` if not set.\n\t */\n\tpublic get chatInput(): ChatInputCommandResolver | null {\n\t\treturn this.#chatInput;\n\t}\n\n\t/**\n\t * Gets the context menu commands associated with this registry entry.\n\t *\n\t * @since 2.0.0\n\t * @returns An array of {@linkcode ContextMenuCommandResolver} objects representing the context menu commands.\n\t */\n\tpublic get contextMenu(): ContextMenuCommandResolver[] {\n\t\treturn this.#contextMenu;\n\t}\n\n\t/**\n\t * Converts the {@linkcode ApplicationCommandRegistryEntry} to a JSON representation.\n\t *\n\t * @since 2.0.0\n\t * @returns An array of Command objects in JSON format.\n\t */\n\tpublic toJSON(): ApplicationCommandRegistryEntry.Command[] {\n\t\treturn this.#chatInput === null\n\t\t\t? this.#contextMenu.map((command) => command.toJSON())\n\t\t\t: [this.#chatInput.toJSON(), ...this.#contextMenu.map((command) => command.toJSON())];\n\t}\n\n\t/**\n\t * Creates a chat input command resolver.\n\t * If the resolver has already been created, it returns the existing instance.\n\t *\n\t * @since 2.0.0\n\t * @returns The chat input command resolver.\n\t * @internal\n\t */\n\tpublic makeChatInput(): ChatInputCommandResolver {\n\t\treturn (this.#chatInput ??= new ChatInputCommandResolver());\n\t}\n\n\t/**\n\t * Creates a context menu command resolver and adds it to the context menu.\n\t *\n\t * @since 2.0.0\n\t * @returns The created context menu command resolver.\n\t * @internal\n\t */\n\tpublic makeContextMenu(): ContextMenuCommandResolver {\n\t\tconst resolver = new ContextMenuCommandResolver();\n\t\tthis.#contextMenu.push(resolver);\n\t\treturn resolver;\n\t}\n}\n\nexport namespace ApplicationCommandRegistryEntry {\n\texport type Command = Exclude<RESTPostAPIApplicationCommandsJSONBody, RESTPostAPIPrimaryEntryPointApplicationCommandJSONBody>;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { REST, RequestData, RouteLike } from '@discordjs/rest';\nimport type { JSONEncodable } from '@discordjs/util';\nimport { container } from '@sapphire/pieces';\nimport {\n\tApplicationCommandType,\n\tRoutes,\n\ttype RESTPutAPIApplicationCommandsJSONBody,\n\ttype RESTPutAPIApplicationCommandsResult,\n\ttype RESTPutAPIApplicationGuildCommandsJSONBody,\n\ttype RESTPutAPIApplicationGuildCommandsResult,\n\ttype Snowflake\n} from 'discord-api-types/v10';\nimport type { Command } from '../../structures/Command.js';\nimport { restrictedGuildIdRegistry } from '../decorators/RestrictGuildIds.js';\nimport { ApplicationCommandRegistryEntry } from './ApplicationCommandRegistryEntry.js';\n\nexport type RequestAuthPrefix = RequestData['authPrefix'];\n\n/**\n * Represents a registry for application commands.\n *\n * @remarks This registry is globally available through {@linkcode container.applicationCommandRegistry}.\n * @since 2.0.0\n */\nexport class ApplicationCommandRegistry implements JSONEncodable<ApplicationCommandRegistryEntry.Command[]> {\n\t#entries = new Collection<typeof Command<Command.Options>, ApplicationCommandRegistryEntry>();\n\t#rest: REST | null = null;\n\t#clientId: Snowflake | null = null;\n\t#authPrefix: RequestAuthPrefix = 'Bot';\n\n\tpublic get store() {\n\t\treturn container.stores.get('commands');\n\t}\n\n\t/**\n\t * Sets up the application command registry with the provided options.\n\t *\n\t * @since 2.0.0\n\t * @param options - The setup options for the application command registry.\n\t * @returns The updated instance of the application command registry.\n\t */\n\tpublic setup(options: Readonly<ApplicationCommandRegistry.SetupOptions>) {\n\t\tthis.#rest = options.rest;\n\t\tthis.#clientId = options.clientId;\n\t\tthis.#authPrefix = options.authPrefix ?? 'Bot';\n\t\treturn this;\n\t}\n\n\t/**\n\t * Retrieves the {@linkcode ApplicationCommandRegistryEntry} associated with the specified command class.\n\t *\n\t * @since 2.0.0\n\t * @template Options - The options type of the command class.\n\t * @param target - The command class to retrieve the entry for.\n\t * @returns The {@linkcode ApplicationCommandRegistryEntry} associated with the command class, or null if not found.\n\t */\n\tpublic get<Options extends Command.Options>(target: typeof Command<Options>): ApplicationCommandRegistryEntry | null {\n\t\treturn this.#entries.get(target) ?? null;\n\t}\n\n\t/**\n\t * Deletes a command from the registry.\n\t *\n\t * @since 2.0.0\n\t * @template Options - The options type for the command.\n\t * @param target - The command to delete.\n\t * @returns True if the command was successfully deleted, false otherwise.\n\t */\n\tpublic delete<Options extends Command.Options>(target: typeof Command<Options>): boolean {\n\t\treturn this.#entries.delete(target);\n\t}\n\n\t/**\n\t * Retrieves or creates an {@linkcode ApplicationCommandRegistryEntry} for the specified command class.\n\t *\n\t * @since 2.0.0\n\t * @template Options - The options type for the command.\n\t * @param target - The command class to ensure registration for.\n\t * @returns The application command registry entry for the command.\n\t */\n\tpublic ensure<Options extends Command.Options>(target: typeof Command<Options>): ApplicationCommandRegistryEntry {\n\t\treturn this.#entries.ensure(target, () => new ApplicationCommandRegistryEntry());\n\t}\n\n\t/**\n\t * Converts the {@linkcode ApplicationCommandRegistryEntry} objects to an array of command objects in JSON format.\n\t *\n\t * @since 2.0.0\n\t * @returns An array of Command objects in JSON format.\n\t */\n\tpublic toJSON(): ApplicationCommandRegistryEntry.Command[] {\n\t\treturn this.#entries.map((entry) => entry.toJSON()).flat(1);\n\t}\n\n\t/**\n\t * Loads the commands from the specified base user directory.\n\t *\n\t * @since 2.0.0\n\t * @param baseUserDirectory - The base user directory to load the commands from, define it as `null` to not register\n\t * a path for the file system loader.\n\t * @returns A promise that resolves when all the commands are loaded.\n\t */\n\tpublic loadCommands(baseUserDirectory?: string | URL | null) {\n\t\tif (baseUserDirectory !== null) {\n\t\t\tcontainer.stores.registerPath(baseUserDirectory);\n\t\t}\n\n\t\treturn this.store.loadAll();\n\t}\n\n\t/**\n\t * Retrieves the loaded chat input commands from the application command registry.\n\t *\n\t * @since 2.0.0\n\t * @returns A collection of chat input commands.\n\t */\n\tpublic getLoadedChatInputCommands() {\n\t\tconst collection = new Collection<string, ApplicationCommandRegistryEntry>();\n\t\tfor (const registryEntry of this.#entries.values()) {\n\t\t\tif (registryEntry.chatInput) collection.set(registryEntry.chatInput.toJSON().name, registryEntry);\n\t\t}\n\n\t\treturn collection;\n\t}\n\n\t/**\n\t * Retrieves the loaded context menu commands.\n\t *\n\t * @since 2.0.0\n\t * @returns A collection of context menu commands.\n\t */\n\tpublic getLoadedContextMenuCommands() {\n\t\tconst collection = new Collection<string, ApplicationCommandRegistryEntry>();\n\t\tfor (const registryEntry of this.#entries.values()) {\n\t\t\tfor (const entry of registryEntry.contextMenu) {\n\t\t\t\tcollection.set(entry.toJSON().name, registryEntry);\n\t\t\t}\n\t\t}\n\n\t\treturn collection;\n\t}\n\n\t/**\n\t * Retrieves the loaded global commands from the application command registry.\n\t *\n\t * @since 2.0.0\n\t * @returns An array of loaded global commands.\n\t */\n\tpublic getLoadedGlobalCommands(): ApplicationCommandRegistryEntry.Command[] {\n\t\treturn this.#entries\n\t\t\t.filter((_, command) => !restrictedGuildIdRegistry.get(command)?.length)\n\t\t\t.map((entry) => entry.toJSON())\n\t\t\t.flat(1);\n\t}\n\n\t/**\n\t * Retrieves the loaded guild commands from the application command registry.\n\t *\n\t * @since 2.0.0\n\t * @returns A collection of guild commands, where the key is the guild ID and the value is an array of commands.\n\t */\n\tpublic getLoadedGuildCommands(): Collection<Snowflake, ApplicationCommandRegistryEntry.Command[]> {\n\t\tconst collection = new Collection<Snowflake, ApplicationCommandRegistryEntry.Command[]>();\n\n\t\tfor (const [command, guildIds] of restrictedGuildIdRegistry) {\n\t\t\tif (guildIds.length === 0) continue;\n\n\t\t\tconst entry = this.#entries.get(command);\n\t\t\tif (!entry) continue;\n\n\t\t\tconst commands = entry.toJSON();\n\t\t\tfor (const guildId of guildIds) {\n\t\t\t\tcollection.ensure(guildId, () => []).push(...commands);\n\t\t\t}\n\t\t}\n\n\t\treturn collection;\n\t}\n\n\t/**\n\t * Registers all the non guild-restricted commands globally.\n\t *\n\t * @since 2.0.0\n\t * @returns The raw result from registering the commands globally.\n\t */\n\tpublic pushGlobalCommands() {\n\t\treturn this.#push(Routes.applicationCommands(this.clientId), this.getLoadedGlobalCommands(), null);\n\t}\n\n\t/**\n\t * Registers all the non guild-restricted commands in a single guild.\n\t *\n\t * @since 2.0.0\n\t * @param guildId The guild to register the commands at.\n\t * @returns The raw result from registering the commands in the specified guild.\n\t */\n\tpublic pushGlobalCommandsInGuild(guildId: Snowflake) {\n\t\treturn this.#push(Routes.applicationGuildCommands(this.clientId, guildId), this.getLoadedGlobalCommands(), guildId);\n\t}\n\n\t/**\n\t * Registers all the commands including guild-restricted ones in a single guild.\n\t *\n\t * @param guildId The guild to register the commands at.\n\t * @returns The raw result from registering the commands in the specified guild.\n\t */\n\tpublic pushAllCommandsInGuild(guildId: Snowflake) {\n\t\treturn this.#push(Routes.applicationGuildCommands(this.clientId, guildId), this.toJSON(), guildId);\n\t}\n\n\t/**\n\t * Registers all the guild-restricted commands in their respective guilds.\n\t *\n\t * @returns The settled promises from all the guild command registrations.\n\t */\n\tpublic pushGuildRestrictedCommands(): Promise<PromiseSettledResult<RESTPutAPIApplicationGuildCommandsResult>[]> {\n\t\tconst promises = this.getLoadedGuildCommands().map((commands, guildId) =>\n\t\t\tthis.#push(Routes.applicationGuildCommands(this.clientId, guildId), commands, guildId)\n\t\t);\n\n\t\treturn Promise.allSettled(promises);\n\t}\n\n\tasync #push<GuildId extends Snowflake | null>(route: RouteLike, body: BodyOf<GuildId>, guildId: GuildId): Promise<ResultOf<GuildId>> {\n\t\tif (this.#rest === null) {\n\t\t\tthrow new Error('The ApplicationCommandRegistry has not been setup yet.');\n\t\t}\n\n\t\tconst entries = (await this.#rest.put(route, { body, authPrefix: this.#authPrefix })) as ResultOf<GuildId>;\n\t\tif (entries.length === 0) return entries;\n\n\t\tconst { router } = this.store;\n\t\tfor (const entry of entries) {\n\t\t\tconst command = entry.type === ApplicationCommandType.ChatInput ? router.getChatInput(entry.name) : router.getContextMenu(entry.name);\n\t\t\tconst registry = command?.registry;\n\t\t\tif (!registry) continue;\n\n\t\t\tif (guildId === null) {\n\t\t\t\tregistry.setGlobalId(entry.id);\n\t\t\t} else {\n\t\t\t\tregistry.setGuildId(guildId, entry.id);\n\t\t\t}\n\t\t}\n\n\t\treturn entries;\n\t}\n\n\tprivate get clientId() {\n\t\tif (this.#clientId === null) throw new Error('The ApplicationCommandRegistry has not been setup yet.');\n\t\treturn this.#clientId;\n\t}\n}\n\nexport namespace ApplicationCommandRegistry {\n\texport interface SetupOptions {\n\t\trest: REST;\n\t\tclientId: Snowflake;\n\t\tauthPrefix?: RequestAuthPrefix;\n\t}\n}\n\nexport const applicationCommandRegistry = new ApplicationCommandRegistry();\ncontainer.applicationCommandRegistry = applicationCommandRegistry;\n\ntype BodyOf<GuildId extends Snowflake | null> = Snowflake | null extends GuildId\n\t? RESTPutAPIApplicationCommandsJSONBody | RESTPutAPIApplicationGuildCommandsJSONBody\n\t: Snowflake extends GuildId\n\t\t? RESTPutAPIApplicationGuildCommandsJSONBody\n\t\t: RESTPutAPIApplicationCommandsJSONBody;\ntype ResultOf<GuildId extends Snowflake | null> = Snowflake | null extends GuildId\n\t? RESTPutAPIApplicationCommandsResult | RESTPutAPIApplicationGuildCommandsResult\n\t: Snowflake extends GuildId\n\t\t? RESTPutAPIApplicationGuildCommandsResult\n\t\t: RESTPutAPIApplicationCommandsResult;\n","import { InteractionResponseType } from 'discord-api-types/v10';\n\nexport const ErrorMessages = {\n\tInternalError: JSON.stringify({ message: 'Received an internal error' }),\n\tInvalidBodySize: JSON.stringify({ message: 'Request body exceeds maximum body size' }),\n\tInvalidContentLengthInteger: JSON.stringify({ message: 'Content-Length is not an integer number' }),\n\tInvalidContentLengthNegative: JSON.stringify({ message: 'Content-Length must not be zero or negative' }),\n\tInvalidContentLengthTooBig: JSON.stringify({ message: \"Content-Length is superior to the server's body size limit\" }),\n\tInvalidCustomId: JSON.stringify({ message: 'Could not parse the `custom_id` field' }),\n\tInvalidSignature: JSON.stringify({ message: 'Received invalid signature' }),\n\tMissingBodyData: JSON.stringify({ message: 'Missing body data' }),\n\tMissingCommandName: JSON.stringify({ message: 'Missing command name' }),\n\tMissingSignatureInformation: JSON.stringify({ message: 'Missing signature information' }),\n\tNotFound: JSON.stringify({ message: 'Not found' }),\n\tUnknownCommandHandler: JSON.stringify({ message: 'Unknown command handler' }),\n\tUnknownCommandName: JSON.stringify({ message: 'Unknown command name' }),\n\tUnknownHandlerName: JSON.stringify({ message: 'Unknown handler name' }),\n\tUnknownInteractionType: JSON.stringify({ message: 'Received unknown interaction type' }),\n\tUnsupportedHttpMethod: JSON.stringify({ message: 'Unsupported HTTP method' })\n} as const;\n\nexport const Payloads = {\n\tPong: JSON.stringify({ type: InteractionResponseType.Pong })\n} as const;\n","export const Data = Symbol('data');\nexport const Response = Symbol('response');\n","import { container } from '@sapphire/pieces';\nimport { Result, err } from '@sapphire/result';\nimport { isNullish, isNullishOrEmpty, type NonNullObject } from '@sapphire/utilities';\nimport {\n\tRoutes,\n\ttype APIChannel,\n\ttype APIGuild,\n\ttype APIInteraction,\n\ttype APIPingInteraction,\n\ttype RESTGetAPIChannelResult,\n\ttype RESTGetAPIGuildResult\n} from 'discord-api-types/v10';\nimport type { ServerResponse } from 'node:http';\nimport { HttpCodes } from '../../../../api/HttpCodes.js';\nimport type { DiscordResult } from '../../../utils/util-types.js';\nimport { resultFromDiscord } from '../../../utils/util.js';\nimport { Data, Response } from '../../common/symbols.js';\n\nexport type BaseInteractionType = Exclude<APIInteraction, APIPingInteraction>;\n\nexport abstract class BaseInteraction<T extends BaseInteractionType = BaseInteractionType> {\n\tprotected readonly [Data]: T;\n\tprotected readonly [Response]: ServerResponse;\n\n\tpublic constructor(response: ServerResponse, data: T) {\n\t\tthis[Data] = data;\n\t\tthis[Response] = response;\n\t}\n\n\tpublic get replied() {\n\t\treturn this[Response].writableEnded;\n\t}\n\n\t/**\n\t * The ID of the interaction.\n\t */\n\tpublic get id(): T['id'] {\n\t\treturn this[Data].id;\n\t}\n\n\t/**\n\t * The type of the interaction.\n\t */\n\tpublic get type(): T['type'] {\n\t\treturn this[Data].type;\n\t}\n\n\t/**\n\t * Bitwise set of permissions the app or bot has within the channel the interaction was sent from.\n\t */\n\tpublic get app_permissions(): T['app_permissions'] {\n\t\treturn this[Data].app_permissions;\n\t}\n\n\t/**\n\t * Bitwise set of permissions the app or bot has within the channel the interaction was sent from.\n\t *\n\t * @seealso {@link app_permissions} for the raw data.\n\t */\n\tpublic get applicationPermissions() {\n\t\treturn typeof this.app_permissions === 'string' ? BigInt(this.app_permissions) : undefined;\n\t}\n\n\t/**\n\t * The ID of the application the interaction is for.\n\t */\n\tpublic get application_id(): T['application_id'] {\n\t\treturn this[Data].application_id;\n\t}\n\n\t/**\n\t * The ID of the application the interaction is for.\n\t *\n\t * @seealso {@link application_id} for the raw data.\n\t */\n\tpublic get applicationId(): T['application_id'] {\n\t\treturn this.application_id;\n\t}\n\n\t/**\n\t * Mapping of installation contexts that the interaction was authorized for\n\t * to related user or guild IDs.\n\t */\n\tpublic get authorizing_integration_owners(): T['authorizing_integration_owners'] {\n\t\treturn this[Data].authorizing_integration_owners;\n\t}\n\n\t/**\n\t * Mapping of installation contexts that the interaction was authorized for\n\t * to related user or guild IDs.\n\t *\n\t * @seealso {@link authorizing_integration_owners} for the raw data.\n\t */\n\tpublic get authorizingIntegrationOwners(): T['authorizing_integration_owners'] {\n\t\treturn this.authorizing_integration_owners;\n\t}\n\n\t/**\n\t * The channel of the interaction.\n\t */\n\tpublic get channel(): T['channel'] {\n\t\treturn this[Data].channel;\n\t}\n\n\t/**\n\t * The channel the interaction was sent from.\n\t * @deprecated Use {@link channel}.id instead.\n\t */\n\tpublic get channel_id(): T['channel_id'] {\n\t\treturn this.channel?.id;\n\t}\n\n\t/**\n\t * The channel the interaction was sent from.\n\t * @deprecated Use {@link channel}.id instead.\n\t *\n\t * @seealso {@link channel_id} for the raw data.\n\t */\n\tpublic get channelId(): T['channel_id'] {\n\t\treturn this.channel?.id;\n\t}\n\n\t/**\n\t * Context where the interaction was triggered from.\n\t */\n\tpublic get context(): T['context'] {\n\t\treturn this[Data].context;\n\t}\n\n\t/**\n\t * The command data payload.\n\t */\n\tpublic get data(): T['data'] {\n\t\treturn this[Data].data;\n\t}\n\n\t/**\n\t * For monetized apps, any entitlements for the invoking user, representing\n\t * access to premium SKUs.\n\t */\n\tpublic get entitlements(): T['entitlements'] {\n\t\treturn this[Data].entitlements;\n\t}\n\n\t/**\n\t * The guild the interaction was sent from.\n\t */\n\tpublic get guild_id(): T['guild_id'] {\n\t\treturn this[Data].guild_id;\n\t}\n\n\t/**\n\t * The guild the interaction was sent from.\n\t *\n\t * @seealso {@link guild_id} for the raw data.\n\t */\n\tpublic get guildId(): T['guild_id'] {\n\t\treturn this.guild_id;\n\t}\n\n\t/**\n\t * The guild's preferred locale, if invoked in a guild.\n\t */\n\tpublic get guild_locale(): T['guild_locale'] {\n\t\treturn this[Data].guild_locale;\n\t}\n\n\t/**\n\t * The guild's preferred locale, if invoked in a guild.\n\t *\n\t * @seealso {@link guild_locale} for the raw data.\n\t */\n\tpublic get guildLocale(): T['guild_locale'] {\n\t\treturn this.guild_locale;\n\t}\n\n\t/**\n\t * The selected language of the invoking user.\n\t */\n\tpublic get locale(): T['locale'] {\n\t\treturn this[Data].locale;\n\t}\n\n\t/**\n\t * Guild member data for the invoking user, including permissions.\n\t *\n\t * **This is only sent when an interaction is invoked in a guild**.\n\t */\n\tpublic get member(): T['member'] {\n\t\treturn this[Data].member;\n\t}\n\n\t/**\n\t * A continuation token for responding to the interaction.\n\t */\n\tpublic get token(): T['token'] {\n\t\treturn this[Data].token;\n\t}\n\n\t/**\n\t * User object for the invoking user.\n\t */\n\tpublic get user() {\n\t\treturn (this[Data].member?.user ?? this[Data].user)!;\n\t}\n\n\t/**\n\t * Read-only property, always `1`.\n\t */\n\tpublic get version(): T['version'] {\n\t\treturn this[Data].version;\n\t}\n\n\t/**\n\t * Determines whether or not the interaction was sent from a guild.\n\t * @returns The casted interaction type.\n\t */\n\tpublic inGuild(): this is InGuild<this> {\n\t\treturn !isNullish(this.guild_id);\n\t}\n\n\t/**\n\t * Fetches the channel the interaction was sent from.\n\t * @returns The fetched channel.\n\t * @remarks **This requires REST to have a token.**\n\t * @seealso {@link channel}.\n\t */\n\tpublic async fetchChannel(): Promise<Result.Err<Error> | DiscordResult<APIChannel>> {\n\t\tif (isNullishOrEmpty(this.channel)) return err(new Error('The interaction was not sent from a channel'));\n\t\treturn resultFromDiscord(container.rest.get(Routes.channel(this.channel.id)) as Promise<RESTGetAPIChannelResult>);\n\t}\n\n\t/**\n\t * Fetches the channel the interaction was sent from.\n\t * @returns The fetched channel.\n\t * @remarks **This requires REST to have a token.**\n\t */\n\tpublic async fetchGuild(): Promise<Result.Err<Error> | DiscordResult<APIGuild>> {\n\t\tif (isNullishOrEmpty(this.guildId)) return err(new Error('The interaction was not sent from a guild'));\n\t\treturn resultFromDiscord(container.rest.get(Routes.guild(this.guildId)) as Promise<RESTGetAPIGuildResult>);\n\t}\n\n\tprotected _sendReply(data: NonNullObject) {\n\t\tconst response = this[Response];\n\t\tif (response.writableEnded) throw new Error('Cannot send response, the request has already been replied.');\n\n\t\tresponse.statusCode = HttpCodes.OK;\n\t\treturn new Promise<void>((resolve) => {\n\t\t\tresponse.on('close', () => {\n\t\t\t\tresolve();\n\t\t\t});\n\t\t\tresponse.end(JSON.stringify(data));\n\t\t});\n\t}\n}\n\nexport type InGuild<T extends BaseInteraction> = T & {\n\tget guild_id(): NonNullable<T['guild_id']>;\n\tget guildId(): NonNullable<T['guildId']>;\n\tget guild_locale(): NonNullable<T['guild_locale']>;\n\tget guildLocale(): NonNullable<T['guildLocale']>;\n\tget member(): NonNullable<T['member']>;\n};\n","import { InteractionResponseType, type APIApplicationCommandAutocompleteInteraction } from 'discord-api-types/v10';\nimport { BaseInteraction } from './base/BaseInteraction.js';\nimport type { AutocompleteResponseData, AutocompleteResponseOptions } from './base/common.js';\n\nexport class AutocompleteInteraction extends BaseInteraction<AutocompleteInteraction.Type> {\n\t/**\n\t * Responds to the interaction with an autocomplete result.\n\t * @param data The data to be sent.\n\t */\n\tpublic reply(data: AutocompleteResponseOptions): Promise<void> {\n\t\tconst body: AutocompleteResponseData = { type: InteractionResponseType.ApplicationCommandAutocompleteResult, data };\n\t\treturn this._sendReply(body);\n\t}\n\n\t/**\n\t * Responds to the interaction with an empty autocomplete result.\n\t */\n\tpublic replyEmpty(): Promise<void> {\n\t\treturn this.reply({ choices: [] });\n\t}\n}\n\nexport namespace AutocompleteInteraction {\n\texport type Type = APIApplicationCommandAutocompleteInteraction;\n}\n","import { container } from '@sapphire/pieces';\nimport {\n\tInteractionResponseType,\n\tRoutes,\n\ttype APIChatInputApplicationCommandInteraction,\n\ttype APIMessageApplicationCommandInteraction,\n\ttype APIUserApplicationCommandInteraction,\n\ttype RESTPostAPIInteractionFollowupResult\n} from 'discord-api-types/v10';\nimport type { AsyncDiscordResult } from '../../../utils/util-types.js';\nimport { resultFromDiscord } from '../../../utils/util.js';\nimport { Message, PartialMessage } from '../../Message.js';\nimport { BaseInteraction } from './BaseInteraction.js';\nimport type {\n\tDeferResponseData,\n\tDeferResponseOptions,\n\tFollowupOptions,\n\tMessageResponseData,\n\tMessageResponseOptions,\n\tModalResponseData,\n\tModalResponseOptions\n} from './common.js';\n\nexport type BaseCommandInteractionType =\n\t| APIChatInputApplicationCommandInteraction\n\t| APIUserApplicationCommandInteraction\n\t| APIMessageApplicationCommandInteraction;\n\nexport class CommandInteraction<T extends BaseCommandInteractionType> extends BaseInteraction<T> {\n\t/**\n\t * Responds to the interaction with a message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async reply(data: MessageResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: MessageResponseData = { type: InteractionResponseType.ChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async defer(data?: DeferResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: DeferResponseData = { type: InteractionResponseType.DeferredChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Responds to the interaction with a popup modal.\n\t * @param data The data to be sent.\n\t */\n\tpublic showModal(data: ModalResponseOptions): Promise<void> {\n\t\tconst body: ModalResponseData = { type: InteractionResponseType.Modal, data };\n\t\treturn this._sendReply(body);\n\t}\n\n\t/**\n\t * Sends a follow-up message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async followup({ files, ...body }: FollowupOptions): AsyncDiscordResult<Message<this>> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.post(Routes.webhook(this.applicationId, this.token), {\n\t\t\t\tbody,\n\t\t\t\tfiles,\n\t\t\t\tauth: false\n\t\t\t}) as Promise<RESTPostAPIInteractionFollowupResult>\n\t\t);\n\n\t\treturn result.map((message) => new Message(this, message));\n\t}\n}\n","import { container } from '@sapphire/pieces';\nimport {\n\tInteractionResponseType,\n\tRoutes,\n\ttype APIMessageComponentButtonInteraction,\n\ttype APIMessageComponentSelectMenuInteraction,\n\ttype RESTPostAPIInteractionFollowupResult\n} from 'discord-api-types/v10';\nimport type { AsyncDiscordResult } from '../../../utils/util-types.js';\nimport { resultFromDiscord } from '../../../utils/util.js';\nimport { Message, PartialMessage } from '../../Message.js';\nimport { Data } from '../../common/symbols.js';\nimport { BaseInteraction } from './BaseInteraction.js';\nimport type {\n\tDeferResponseData,\n\tDeferResponseOptions,\n\tDeferUpdateResult,\n\tFollowupOptions,\n\tMessageResponseData,\n\tMessageResponseOptions,\n\tModalResponseData,\n\tModalResponseOptions,\n\tUpdateData,\n\tUpdateOptions\n} from './common.js';\n\nexport type MessageComponentInteractionType = APIMessageComponentButtonInteraction | APIMessageComponentSelectMenuInteraction;\n\nexport abstract class MessageComponentInteraction<T extends MessageComponentInteractionType> extends BaseInteraction<T> {\n\t/**\n\t * The message the interaction was attached to.\n\t */\n\tpublic get message() {\n\t\treturn this[Data].message;\n\t}\n\n\t/**\n\t * ACK a button interaction and update it to a loading state.\n\t */\n\tpublic async deferUpdate(): Promise<PartialMessage<this>> {\n\t\tconst body: DeferUpdateResult = { type: InteractionResponseType.DeferredMessageUpdate };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async update(data?: UpdateOptions): Promise<PartialMessage<this>> {\n\t\tconst body: UpdateData = { type: InteractionResponseType.UpdateMessage, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Responds to the interaction with a message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async reply(data: MessageResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: MessageResponseData = { type: InteractionResponseType.ChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async defer(data?: DeferResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: DeferResponseData = { type: InteractionResponseType.DeferredChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Responds to the interaction with a popup modal.\n\t * @param data The data to be sent.\n\t */\n\tpublic showModal(data: ModalResponseOptions): Promise<void> {\n\t\tconst body: ModalResponseData = { type: InteractionResponseType.Modal, data };\n\t\treturn this._sendReply(body);\n\t}\n\n\t/**\n\t * Sends a follow-up message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async followup({ files, ...body }: FollowupOptions): AsyncDiscordResult<Message<this>> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.post(Routes.webhook(this.applicationId, this.token), {\n\t\t\t\tbody,\n\t\t\t\tfiles,\n\t\t\t\tauth: false\n\t\t\t}) as Promise<RESTPostAPIInteractionFollowupResult>\n\t\t);\n\n\t\treturn result.map((message) => new Message(this, message));\n\t}\n}\n","import type { APIChatInputApplicationCommandInteraction } from 'discord-api-types/v10';\nimport { CommandInteraction } from './base/CommandInteraction.js';\n\nexport class ChatInputCommandInteraction extends CommandInteraction<ChatInputCommandInteraction.Type> {}\n\nexport namespace ChatInputCommandInteraction {\n\texport type Type = APIChatInputApplicationCommandInteraction;\n}\n","import type { APIMessageComponentButtonInteraction } from 'discord-api-types/v10';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentButtonInteraction extends MessageComponentInteraction<MessageComponentButtonInteraction.Type> {}\n\nexport namespace MessageComponentButtonInteraction {\n\texport type Type = APIMessageComponentButtonInteraction;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { APIBaseInteraction, APIMessageChannelSelectInteractionData, InteractionType, Snowflake } from 'discord-api-types/v10';\nimport type { TransformedArguments } from '../../resolvers/InteractionOptions.js';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentChannelSelectInteraction extends MessageComponentInteraction<MessageComponentChannelSelectInteraction.Type> {\n\t/**\n\t * Gets the IDs of the selected channels.\n\t */\n\tpublic get ids(): Snowflake[] {\n\t\treturn this.data.values;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected channels.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.values}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.entries}.\n\t */\n\tpublic get channels(): Collection<Snowflake, MessageComponentChannelSelectInteraction.Value> {\n\t\treturn new Collection(this.entries());\n\t}\n\n\t/**\n\t * Returns an iterator of the selected channel IDs.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.ids}.\n\t */\n\tpublic *keys(): IterableIterator<Snowflake> {\n\t\tyield* this.ids;\n\t}\n\n\t/**\n\t * Returns an iterator of the selected channels.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.channels}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.entries}.\n\t */\n\tpublic *values(): IterableIterator<MessageComponentChannelSelectInteraction.Value> {\n\t\tconst { resolved } = this.data;\n\t\tfor (const id of this.ids) {\n\t\t\tyield resolved.channels[id];\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator of [ID, Channel] pairs.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.channels}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.values}.\n\t */\n\tpublic *entries(): IterableIterator<[Snowflake, MessageComponentChannelSelectInteraction.Value]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [value.id, value];\n\t\t}\n\t}\n}\n\nexport namespace MessageComponentChannelSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageChannelSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n\texport type Value = TransformedArguments.Channel;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { APIBaseInteraction, APIMessageMentionableSelectInteractionData, APIRole, InteractionType, Snowflake } from 'discord-api-types/v10';\nimport type { TransformedArguments } from '../../resolvers/InteractionOptions.js';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentMentionableSelectInteraction extends MessageComponentInteraction<MessageComponentMentionableSelectInteraction.Type> {\n\t/**\n\t * Gets the IDs of the selected users and roles.\n\t */\n\tpublic get ids(): Snowflake[] {\n\t\treturn this.data.values;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected users.\n\t *\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.values}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.entries}.\n\t */\n\tpublic get users(): Collection<Snowflake, MessageComponentMentionableSelectInteraction.ValueUser> {\n\t\tconst output = new Collection<Snowflake, MessageComponentMentionableSelectInteraction.ValueUser>();\n\t\tconst { users, members } = this.data.resolved;\n\t\tif (users) {\n\t\t\tfor (const user of Object.values(users)) {\n\t\t\t\toutput.set(user.id, { id: user.id, user, member: members?.[user.id] ?? null });\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected roles.\n\t *\n\t * @note The collection will always be empty if the interaction came from direct messages.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.values}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.entries}.\n\t */\n\tpublic get roles(): Collection<Snowflake, APIRole> {\n\t\tconst output = new Collection<Snowflake, APIRole>();\n\t\tconst { roles } = this.data.resolved;\n\t\tif (roles) {\n\t\t\tfor (const role of Object.values(roles)) {\n\t\t\t\toutput.set(role.id, role);\n\t\t\t}\n\t\t}\n\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected users, members, and roles.\n\t *\n\t * @note The collection will always be empty if the interaction came from direct messages.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.values}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.entries}.\n\t */\n\tpublic get mentionables(): Collection<Snowflake, MessageComponentMentionableSelectInteraction.Value> {\n\t\treturn new Collection(this.entries());\n\t}\n\n\t/**\n\t * Returns an iterator of the selected users and roles IDs.\n\t *\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.ids}.\n\t */\n\tpublic *keys(): IterableIterator<Snowflake> {\n\t\tyield* this.ids;\n\t}\n\n\t/**\n\t * Returns an iterator of the selected users, members, and roles.\n\t *\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.users}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.roles}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.entries}.\n\t */\n\tpublic *values(): IterableIterator<MessageComponentMentionableSelectInteraction.Value> {\n\t\tconst { resolved } = this.data;\n\t\tfor (const id of this.ids) {\n\t\t\tconst user = resolved.users?.[id];\n\t\t\tif (user) {\n\t\t\t\tyield { id, user, member: resolved.members?.[id] ?? null };\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst role = resolved.roles?.[id];\n\t\t\tif (role) {\n\t\t\t\tyield { id, role };\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tyield { id };\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator of [ID, Mentionable] pairs.\n\t *\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.users}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.roles}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentMentionableSelectInteraction.values}.\n\t */\n\tpublic *entries(): IterableIterator<[Snowflake, MessageComponentMentionableSelectInteraction.Value]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [value.id, value];\n\t\t}\n\t}\n}\n\nexport namespace MessageComponentMentionableSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageMentionableSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n\texport type Value = ValueUser | { id: string; role: TransformedArguments.Role } | { id: string };\n\n\texport type ValueUser = { id: string } & TransformedArguments.User;\n}\n","import { Collection } from '@discordjs/collection';\nimport type { APIBaseInteraction, APIMessageRoleSelectInteractionData, InteractionType, Snowflake } from 'discord-api-types/v10';\nimport type { TransformedArguments } from '../../resolvers/InteractionOptions.js';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentRoleSelectInteraction extends MessageComponentInteraction<MessageComponentRoleSelectInteraction.Type> {\n\t/**\n\t * Gets the IDs of the selected roles.\n\t */\n\tpublic get ids(): Snowflake[] {\n\t\treturn this.data.values;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected roles.\n\t *\n\t * @seealso {@link MessageComponentRoleSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.values}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.entries}.\n\t */\n\tpublic get roles(): Collection<Snowflake, MessageComponentRoleSelectInteraction.Value> {\n\t\treturn new Collection(this.entries());\n\t}\n\n\t/**\n\t * Returns an iterator of the selected role IDs.\n\t *\n\t * @seealso {@link MessageComponentRoleSelectInteraction.ids}.\n\t */\n\tpublic *keys(): IterableIterator<Snowflake> {\n\t\tyield* this.ids;\n\t}\n\n\t/**\n\t * Returns an iterator of the selected channels.\n\t *\n\t * @seealso {@link MessageComponentRoleSelectInteraction.roles}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.entries}.\n\t */\n\tpublic *values(): IterableIterator<MessageComponentRoleSelectInteraction.Value> {\n\t\tconst { resolved } = this.data;\n\t\tfor (const id of this.ids) {\n\t\t\tyield resolved.roles[id];\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator of [ID, Role] pairs.\n\t *\n\t * @seealso {@link MessageComponentRoleSelectInteraction.roles}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentRoleSelectInteraction.values}.\n\t */\n\tpublic *entries(): IterableIterator<[Snowflake, MessageComponentRoleSelectInteraction.Value]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [value.id, value];\n\t\t}\n\t}\n}\n\nexport namespace MessageComponentRoleSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageRoleSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n\texport type Value = TransformedArguments.Role;\n}\n","import type { APIBaseInteraction, APIMessageStringSelectInteractionData, InteractionType } from 'discord-api-types/v10';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentStringSelectInteraction extends MessageComponentInteraction<MessageComponentStringSelectInteraction.Type> {\n\tpublic get values(): string[] {\n\t\treturn this.data.values ?? [];\n\t}\n}\n\nexport namespace MessageComponentStringSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageStringSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n}\n\nexport {\n\t/** @deprecated Use {@link MessageComponentStringSelectInteraction} instead. */\n\tMessageComponentStringSelectInteraction as MessageComponentSelectMenuInteraction\n};\n","import { Collection } from '@discordjs/collection';\nimport type { APIBaseInteraction, APIMessageUserSelectInteractionData, InteractionType, Snowflake } from 'discord-api-types/v10';\nimport type { TransformedArguments } from '../../resolvers/InteractionOptions.js';\nimport { MessageComponentInteraction } from './base/MessageComponentInteraction.js';\n\nexport class MessageComponentUserSelectInteraction extends MessageComponentInteraction<MessageComponentUserSelectInteraction.Type> {\n\t/**\n\t * Gets the IDs of the selected users.\n\t */\n\tpublic get ids(): Snowflake[] {\n\t\treturn this.data.values;\n\t}\n\n\t/**\n\t * Creates a collection with all the selected users.\n\t *\n\t * @seealso {@link MessageComponentChannelSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.values}.\n\t * @seealso {@link MessageComponentChannelSelectInteraction.entries}.\n\t */\n\tpublic get users(): Collection<Snowflake, MessageComponentUserSelectInteraction.Value> {\n\t\treturn new Collection(this.entries());\n\t}\n\n\t/**\n\t * Returns an iterator of the selected user IDs.\n\t *\n\t * @seealso {@link MessageComponentUserSelectInteraction.ids}.\n\t */\n\tpublic *keys(): IterableIterator<Snowflake> {\n\t\tyield* this.ids;\n\t}\n\n\t/**\n\t * Returns an iterator of the selected users.\n\t *\n\t * @seealso {@link MessageComponentUserSelectInteraction.users}.\n\t * @seealso {@link MessageComponentUserSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentUserSelectInteraction.entries}.\n\t */\n\tpublic *values(): IterableIterator<MessageComponentUserSelectInteraction.Value> {\n\t\tconst { resolved } = this.data;\n\t\tfor (const id of this.ids) {\n\t\t\tyield { id, user: resolved.users[id], member: resolved.members?.[id] ?? null };\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator of [ID, User] pairs.\n\t *\n\t * @seealso {@link MessageComponentUserSelectInteraction.channels}.\n\t * @seealso {@link MessageComponentUserSelectInteraction.keys}.\n\t * @seealso {@link MessageComponentUserSelectInteraction.values}.\n\t */\n\tpublic *entries(): IterableIterator<[Snowflake, MessageComponentUserSelectInteraction.Value]> {\n\t\tfor (const value of this.values()) {\n\t\t\tyield [value.user.id, value];\n\t\t}\n\t}\n}\n\nexport namespace MessageComponentUserSelectInteraction {\n\ttype Base = APIBaseInteraction<InteractionType.MessageComponent, APIMessageUserSelectInteractionData>;\n\texport type Type = Base & Required<Pick<Base, 'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'>>;\n\texport type Value = TransformedArguments.User;\n}\n","import type { APIMessageApplicationCommandInteraction } from 'discord-api-types/v10';\nimport { CommandInteraction } from './base/CommandInteraction.js';\n\nexport class MessageContextMenuCommandInteraction extends CommandInteraction<MessageContextMenuCommandInteraction.Type> {}\n\nexport namespace MessageContextMenuCommandInteraction {\n\texport type Type = APIMessageApplicationCommandInteraction;\n}\n","import { container } from '@sapphire/pieces';\nimport { InteractionResponseType, Routes, type APIModalSubmitInteraction, type RESTPostAPIInteractionFollowupResult } from 'discord-api-types/v10';\nimport type { AsyncDiscordResult } from '../../utils/util-types.js';\nimport { resultFromDiscord } from '../../utils/util.js';\nimport { Message, PartialMessage } from '../Message.js';\nimport { Data } from '../common/symbols.js';\nimport { BaseInteraction } from './base/BaseInteraction.js';\nimport type {\n\tDeferResponseData,\n\tDeferResponseOptions,\n\tDeferUpdateResult,\n\tFollowupOptions,\n\tMessageResponseData,\n\tMessageResponseOptions,\n\tUpdateData,\n\tUpdateOptions\n} from './base/common.js';\n\nexport class ModalSubmitInteraction extends BaseInteraction<ModalSubmitInteraction.Type> {\n\t/**\n\t * The message the interaction was attached to, if any.\n\t */\n\tpublic get message() {\n\t\treturn this[Data].message;\n\t}\n\n\t/**\n\t * ACK a button interaction and update it to a loading state.\n\t */\n\tpublic async deferUpdate(): Promise<PartialMessage<this>> {\n\t\tconst body: DeferUpdateResult = { type: InteractionResponseType.DeferredMessageUpdate };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async update(data?: UpdateOptions): Promise<PartialMessage<this>> {\n\t\tconst body: UpdateData = { type: InteractionResponseType.UpdateMessage, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Responds to the interaction with a message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async reply(data: MessageResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: MessageResponseData = { type: InteractionResponseType.ChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * ACK an interaction and edit a response later. The user sees a loading state.\n\t * @param data The data to be sent, if any.\n\t */\n\tpublic async defer(data?: DeferResponseOptions): Promise<PartialMessage<this>> {\n\t\tconst body: DeferResponseData = { type: InteractionResponseType.DeferredChannelMessageWithSource, data };\n\t\tawait this._sendReply(body);\n\t\treturn new PartialMessage(this);\n\t}\n\n\t/**\n\t * Sends a follow-up message.\n\t * @param data The data to be sent.\n\t */\n\tpublic async followup({ files, ...body }: FollowupOptions): AsyncDiscordResult<Message<this>> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.post(Routes.webhook(this.applicationId, this.token), {\n\t\t\t\tbody,\n\t\t\t\tfiles,\n\t\t\t\tauth: false\n\t\t\t}) as Promise<RESTPostAPIInteractionFollowupResult>\n\t\t);\n\n\t\treturn result.map((message) => new Message(this, message));\n\t}\n}\n\nexport namespace ModalSubmitInteraction {\n\texport type Type = APIModalSubmitInteraction;\n}\n","import type { APIUserApplicationCommandInteraction } from 'discord-api-types/v10';\nimport { CommandInteraction } from './base/CommandInteraction.js';\n\nexport class UserContextMenuCommandInteraction extends CommandInteraction<UserContextMenuCommandInteraction.Type> {}\n\nexport namespace UserContextMenuCommandInteraction {\n\texport type Type = APIUserApplicationCommandInteraction;\n}\n","import { container } from '@sapphire/pieces';\nimport { Result } from '@sapphire/result';\nimport {\n\tApplicationCommandType,\n\tComponentType,\n\tInteractionType,\n\ttype APIChatInputApplicationCommandInteraction,\n\ttype APIMessageApplicationCommandInteraction,\n\ttype APIMessageComponentButtonInteraction,\n\ttype APIUserApplicationCommandInteraction\n} from 'discord-api-types/v10';\nimport type { ServerResponse } from 'node:http';\nimport { HttpCodes } from '../../api/HttpCodes.js';\nimport { ErrorMessages } from '../../utils/constants.js';\nimport {\n\tAutocompleteInteraction,\n\tChatInputCommandInteraction,\n\tMessageComponentButtonInteraction,\n\tMessageComponentChannelSelectInteraction,\n\tMessageComponentMentionableSelectInteraction,\n\tMessageComponentRoleSelectInteraction,\n\tMessageComponentStringSelectInteraction,\n\tMessageComponentUserSelectInteraction,\n\tMessageContextMenuCommandInteraction,\n\tModalSubmitInteraction,\n\tUserContextMenuCommandInteraction,\n\ttype BaseInteractionType\n} from '../structures/interactions/index.js';\nimport type { AsyncDiscordResult } from './util-types.js';\n\nexport function makeInteraction<T extends BaseInteractionType>(response: ServerResponse, interaction: T): TransformRaw<T>;\nexport function makeInteraction(response: ServerResponse, interaction: BaseInteractionType) {\n\tswitch (interaction.type) {\n\t\tcase InteractionType.ApplicationCommand: {\n\t\t\tswitch (interaction.data.type) {\n\t\t\t\tcase ApplicationCommandType.ChatInput:\n\t\t\t\t\treturn new ChatInputCommandInteraction(response, interaction as APIChatInputApplicationCommandInteraction);\n\t\t\t\tcase ApplicationCommandType.User:\n\t\t\t\t\treturn new UserContextMenuCommandInteraction(response, interaction as APIUserApplicationCommandInteraction);\n\t\t\t\tcase ApplicationCommandType.Message:\n\t\t\t\t\treturn new MessageContextMenuCommandInteraction(response, interaction as APIMessageApplicationCommandInteraction);\n\t\t\t\tcase ApplicationCommandType.PrimaryEntryPoint:\n\t\t\t\t\tthrow new Error('PrimaryEntryPoint is not supported');\n\t\t\t}\n\t\t}\n\t\tcase InteractionType.MessageComponent:\n\t\t\tswitch (interaction.data.component_type) {\n\t\t\t\tcase ComponentType.Button:\n\t\t\t\t\treturn new MessageComponentButtonInteraction(response, interaction as APIMessageComponentButtonInteraction);\n\t\t\t\tcase ComponentType.ChannelSelect:\n\t\t\t\t\treturn new MessageComponentChannelSelectInteraction(response, interaction as MessageComponentChannelSelectInteraction.Type);\n\t\t\t\tcase ComponentType.MentionableSelect:\n\t\t\t\t\treturn new MessageComponentMentionableSelectInteraction(\n\t\t\t\t\t\tresponse,\n\t\t\t\t\t\tinteraction as MessageComponentMentionableSelectInteraction.Type\n\t\t\t\t\t);\n\t\t\t\tcase ComponentType.RoleSelect:\n\t\t\t\t\treturn new MessageComponentRoleSelectInteraction(response, interaction as MessageComponentRoleSelectInteraction.Type);\n\t\t\t\tcase ComponentType.StringSelect:\n\t\t\t\t\treturn new MessageComponentStringSelectInteraction(response, interaction as MessageComponentStringSelectInteraction.Type);\n\t\t\t\tcase ComponentType.UserSelect:\n\t\t\t\t\treturn new MessageComponentUserSelectInteraction(response, interaction as MessageComponentUserSelectInteraction.Type);\n\t\t\t}\n\t\tcase InteractionType.ApplicationCommandAutocomplete:\n\t\t\treturn new AutocompleteInteraction(response, interaction);\n\t\tcase InteractionType.ModalSubmit:\n\t\t\treturn new ModalSubmitInteraction(response, interaction);\n\t}\n}\n\nexport type TransformRaw<T extends BaseInteractionType> = T extends AutocompleteInteraction.Type\n\t? AutocompleteInteraction\n\t: T extends ChatInputCommandInteraction.Type\n\t\t? ChatInputCommandInteraction\n\t\t: T extends UserContextMenuCommandInteraction.Type\n\t\t\t? UserContextMenuCommandInteraction\n\t\t\t: T extends MessageContextMenuCommandInteraction.Type\n\t\t\t\t? MessageContextMenuCommandInteraction\n\t\t\t\t: T extends MessageComponentButtonInteraction.Type\n\t\t\t\t\t? MessageComponentButtonInteraction\n\t\t\t\t\t: T extends MessageComponentChannelSelectInteraction.Type\n\t\t\t\t\t\t? MessageComponentChannelSelectInteraction\n\t\t\t\t\t\t: T extends MessageComponentMentionableSelectInteraction.Type\n\t\t\t\t\t\t\t? MessageComponentMentionableSelectInteraction\n\t\t\t\t\t\t\t: T extends MessageComponentRoleSelectInteraction.Type\n\t\t\t\t\t\t\t\t? MessageComponentRoleSelectInteraction\n\t\t\t\t\t\t\t\t: T extends MessageComponentStringSelectInteraction.Type\n\t\t\t\t\t\t\t\t\t? MessageComponentStringSelectInteraction\n\t\t\t\t\t\t\t\t\t: T extends MessageComponentUserSelectInteraction.Type\n\t\t\t\t\t\t\t\t\t\t? MessageComponentUserSelectInteraction\n\t\t\t\t\t\t\t\t\t\t: T extends ModalSubmitInteraction.Type\n\t\t\t\t\t\t\t\t\t\t\t? ModalSubmitInteraction\n\t\t\t\t\t\t\t\t\t\t\t: never;\n\n/**\n * Handles a received error. This function must only be called if the HTTP\n * interaction was not replied to.\n *\n * This function has a special case for string errors, which are translated to a\n * regular message with content as the error.\n *\n * When an error is thrown, the error is emitted in client, and a generic error\n * message is sent back to Discord.\n * @param response The HTTP request we can response to.\n * @param error The error to handle.\n * @returns The response object.\n */\nexport function handleError(response: ServerResponse, error: unknown): ServerResponse {\n\tcontainer.client.emit('error', error);\n\n\tif (!container.client.httpReplyOnError || response.closed) return response;\n\n\tresponse.statusCode = HttpCodes.InternalServerError;\n\treturn response.end(ErrorMessages.InternalError);\n}\n\nexport function resultFromDiscord<T>(promise: Promise<T>): AsyncDiscordResult<T> {\n\treturn Result.fromAsync(promise);\n}\n","import { makeURLSearchParams } from '@discordjs/rest';\nimport { container } from '@sapphire/pieces';\nimport { isNullishOrEmpty } from '@sapphire/utilities';\nimport type { APIMessage, RESTDeleteAPIInteractionOriginalResponseResult } from 'discord-api-types/v10';\nimport {\n\tRoutes,\n\ttype APIChannel,\n\ttype RESTGetAPIInteractionOriginalResponseResult,\n\ttype RESTPatchAPIInteractionOriginalResponseJSONBody,\n\ttype RESTPatchAPIInteractionOriginalResponseResult\n} from 'discord-api-types/v10';\nimport type { AddFiles, AsyncDiscordResult } from '../utils/util-types.js';\nimport { resultFromDiscord } from '../utils/util.js';\nimport { Data } from './common/symbols.js';\nimport type { BaseInteraction } from './interactions/index.js';\n\nexport class PartialMessage<I extends BaseInteraction = BaseInteraction> {\n\tpublic readonly interaction: I;\n\n\tpublic constructor(interaction: I) {\n\t\tthis.interaction = interaction;\n\t}\n\n\t/**\n\t * The ID of the message.\n\t */\n\tpublic get id() {\n\t\treturn '@original';\n\t}\n\n\t/**\n\t * The thread, if the message started one.\n\t */\n\tpublic get thread(): APIChannel | undefined {\n\t\treturn undefined;\n\t}\n\n\t/**\n\t * Retrieves the message from Discord, returns a clone of the instance.\n\t */\n\tpublic async get(): AsyncDiscordResult<Message> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.get(Routes.webhookMessage(this.interaction.applicationId, this.interaction.token, this.id), {\n\t\t\t\tauth: false,\n\t\t\t\tquery: makeURLSearchParams({ thread_id: this.thread?.id })\n\t\t\t}) as Promise<RESTGetAPIInteractionOriginalResponseResult>\n\t\t);\n\t\treturn result.map((data) => new Message(this.interaction, data));\n\t}\n\n\t/**\n\t * Updates the message, returns a clone of the instance.\n\t * @param data The data to be sent.\n\t */\n\tpublic async update({ files, ...body }: UpdateResponseOptions): AsyncDiscordResult<Message> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.patch(Routes.webhookMessage(this.interaction.applicationId, this.interaction.token, this.id), {\n\t\t\t\tbody,\n\t\t\t\tfiles,\n\t\t\t\tauth: false,\n\t\t\t\tquery: makeURLSearchParams({ thread_id: this.thread?.id })\n\t\t\t}) as Promise<RESTPatchAPIInteractionOriginalResponseResult>\n\t\t);\n\t\treturn result.map((data) => new Message(this.interaction, data));\n\t}\n\n\t/**\n\t * Deletes the message.\n\t */\n\tpublic async delete(): AsyncDiscordResult<this> {\n\t\tconst result = await resultFromDiscord(\n\t\t\tcontainer.rest.delete(Routes.webhookMessage(this.interaction.applicationId, this.interaction.token, this.id), {\n\t\t\t\tauth: false,\n\t\t\t\tquery: makeURLSearchParams({ thread_id: this.thread?.id })\n\t\t\t}) as Promise<RESTDeleteAPIInteractionOriginalResponseResult>\n\t\t);\n\t\treturn result.map(() => this);\n\t}\n}\n\nexport type UpdateResponseResult = RESTPatchAPIInteractionOriginalResponseResult;\nexport type UpdateResponseOptions = AddFiles<RESTPatchAPIInteractionOriginalResponseJSONBody>;\n\nexport class Message<I extends BaseInteraction = BaseInteraction> extends PartialMessage<I> {\n\tprivate readonly [Data]: APIMessage;\n\n\tpublic constructor(interaction: I, data: APIMessage) {\n\t\tsuper(interaction);\n\t\tthis[Data] = data;\n\t}\n\n\t/**\n\t * The ID of the message.\n\t *\n\t * @raw\n\t */\n\tpublic override get id() {\n\t\treturn this[Data].id;\n\t}\n\n\t/**\n\t * The ID of the channel the message is from.\n\t *\n\t * @raw\n\t * @seealso {@link channelId} for the camelCase property.\n\t */\n\tpublic get channel_id(): APIMessage['channel_id'] {\n\t\treturn this[Data].channel_id;\n\t}\n\n\t/**\n\t * The ID of the channel the message is from.\n\t */\n\tpublic get channelId(): APIMessage['channel_id'] {\n\t\treturn this.channel_id;\n\t}\n\n\t/**\n\t * The author of this message (only a valid user in the case where the message is generated by a user or bot user)\n\t *\n\t * If the message is generated by a webhook, the author object corresponds to the webhook's id,\n\t * username, and avatar. You can tell if a message is generated by a webhook by checking for the {@link webhookId} property\n\t *\n\t * @raw\n\t * @seealso {@link https://discord.com/developers/docs/resources/user#user-object}\n\t */\n\tpublic get author(): APIMessage['author'] {\n\t\treturn this[Data].author;\n\t}\n\n\t/**\n\t * The contents of the message.\n\t *\n\t * @raw\n\t */\n\tpublic get content(): APIMessage['content'] {\n\t\treturn this[Data].content;\n\t}\n\n\t/**\n\t * The timestamp the message was sent at.\n\t *\n\t * @raw\n\t * @seealso {@link createdTimestamp} for the parsed timestamp.\n\t * @seealso {@link createdAt} for the Date instance created from the parsed timestamp.\n\t */\n\tpublic get timestamp(): APIMessage['timestamp'] {\n\t\treturn this[Data].timestamp;\n\t}\n\n\t/**\n\t * The timestamp the message was sent at.\n\t *\n\t * @seealso {@link timestamp} for the raw data.\n\t */\n\tpublic get createdTimestamp(): number {\n\t\treturn Date.parse(this.timestamp);\n\t}\n\n\t/**\n\t * The {@link Date} version of {@link createdTimestamp}.\n\t */\n\tpublic get createdAt(): Date {\n\t\treturn new Date(this.createdTimestamp);\n\t}\n\n\t/**\n\t * The timestamp the message was edited at, `null` if it was never edited.\n\t *\n\t * @raw\n\t * @seealso {@link editedTimestamp} for the parsed timestamp.\n\t * @seealso {@link editedAt} for the Date instance created from the parsed timestamp.\n\t */\n\tpublic get edited_timestamp(): APIMessage['edited_timestamp'] {\n\t\treturn this[Data].edited_timestamp;\n\t}\n\n\t/**\n\t * The timestamp the message was edited at, `null` if it was never edited.\n\t */\n\tpublic get editedTimestamp(): number | null {\n\t\tconst value = this.edited_timestamp;\n\t\treturn isNullishOrEmpty(value) ? null : Date.parse(value);\n\t}\n\n\t/**\n\t * The {@link Date} version of {@link editedTimestamp}.\n\t */\n\tpublic get editedAt(): Date | null {\n\t\tconst value = this.editedTimestamp;\n\t\treturn isNullishOrEmpty(value) ? null : new Date(value);\n\t}\n\n\t/**\n\t * Whether or not the message is a TTS message.\n\t *\n\t * @raw\n\t */\n\tpublic get tts(): APIMessage['tts'] {\n\t\treturn this[Data].tts;\n\t}\n\n\t/**\n\t * Whether or not the message mentioned everyone.\n\t *\n\t * @raw\n\t * @seealso {@link mention_everyone} for the camelCase property.\n\t */\n\tpublic get mention_everyone(): APIMessage['mention_everyone'] {\n\t\treturn this[Data].mention_everyone;\n\t}\n\n\t/**\n\t * Whether or not the message mentioned everyone.\n\t *\n\t * @seealso {@link mention_everyone} for the raw data.\n\t */\n\tpublic get mentionEveryone(): APIMessage['mention_everyone'] {\n\t\treturn this.mention_everyone;\n\t}\n\n\t/**\n\t * The users specifically mentioned in the message.\n\t *\n\t * @raw\n\t * @seealso {@link https://discord.com/developers/docs/resources/user#user-object}\n\t */\n\tpublic get mentions(): APIMessage['mentions'] {\n\t\treturn this[Data].mentions;\n\t}\n\n\t/**\n\t * The roles specifically mentioned in the message.\n\t *\n\t * @raw\n\t * @seealso {@link https://discord.com/developers/docs/topics/permissions#role-object}\n\t */\n\tpublic get mention_roles(): APIMessage['mention_roles'] {\n\t\treturn this[Data].mention_roles;\n\t}\n\n\t/**\n\t * The roles specifically mentioned in the message.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/topics/permissions#role-object}\n\t * @seealso {@link mention_roles} for the raw data.\n\t */\n\tpublic get mentionRoles(): APIMessage['mention_roles'] {\n\t\treturn this.mention_roles;\n\t}\n\n\t/**\n\t * The channels specifically mentioned in this message.\n\t *\n\t * Not all channel mentions in a message will appear in {@link mentionChannels}:\n\t * - Only textual channels that are visible to everyone in a lurkable guild will ever be included.\n\t * - Only crossposted messages (via Channel Following) currently include {@link mentionChannels} at all.\n\t *\n\t * @raw\n\t * @seealso {@link mentionChannels} for the camelCase property with an empty array default.\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#channel-mention-object}\n\t */\n\tpublic get mention_channels(): APIMessage['mention_channels'] {\n\t\treturn this[Data].mention_channels;\n\t}\n\n\t/**\n\t * The channels specifically mentioned in this message.\n\t *\n\t * Not all channel mentions in a message will appear in {@link mentionChannels}:\n\t * - Only textual channels that are visible to everyone in a lurkable guild will ever be included.\n\t * - Only crossposted messages (via Channel Following) currently include {@link mentionChannels} at all.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#channel-mention-object}\n\t */\n\tpublic get mentionChannels(): APIMessage['mention_channels'] {\n\t\treturn this[Data].mention_channels ?? [];\n\t}\n\n\t/**\n\t * A nonce that can be used for optimistic message sending (up to 25 characters).\n\t *\n\t * @raw\n\t */\n\tpublic get nonce(): APIMessage['nonce'] {\n\t\treturn this[Data].nonce;\n\t}\n\n\t/**\n\t * Whether or not the message is pinned.\n\t *\n\t * @raw\n\t */\n\tpublic get pinned(): APIMessage['pinned'] {\n\t\treturn this[Data].pinned;\n\t}\n\n\t/**\n\t * The attached files.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#attachment-object}\n\t */\n\tpublic get attachments(): APIMessage['attachments'] {\n\t\treturn this[Data].attachments;\n\t}\n\n\t/**\n\t * The embedded content.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#embed-object}\n\t */\n\tpublic get embeds(): APIMessage['embeds'] {\n\t\treturn this[Data].embeds;\n\t}\n\n\t/**\n\t * The reactions the message has.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#reaction-object}\n\t */\n\tpublic get reactions(): APIMessage['reactions'] {\n\t\treturn this[Data].reactions ?? [];\n\t}\n\n\t/**\n\t * The webhook ID.\n\t */\n\tpublic get webhook_id(): APIMessage['webhook_id'] {\n\t\treturn this[Data].webhook_id;\n\t}\n\n\t/**\n\t * The webhook ID.\n\t *\n\t * @seealso {@link webhook_id} for the raw data.\n\t */\n\tpublic get webhookId() {\n\t\treturn this.webhook_id ?? null;\n\t}\n\n\t/**\n\t * The message's type.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#message-object-message-types}\n\t */\n\tpublic get type() {\n\t\treturn this[Data].type;\n\t}\n\n\t/**\n\t * The thread, if the message started one.\n\t */\n\tpublic override get thread() {\n\t\treturn this[Data].thread;\n\t}\n\n\t/**\n\t * The message flags combined as a bitfield.\n\t *\n\t * @seealso {@link https://discord.com/developers/docs/resources/channel#message-object-message-flags}\n\t * @seealso {@link https://en.wikipedia.org/wiki/Bit_field}\n\t */\n\tpublic get flags() {\n\t\treturn this[Data].flags;\n\t}\n\n\t/**\n\t * The message's components, such as buttons, action rows, or other interactive components.\n\t */\n\tpublic get components() {\n\t\treturn this[Data].components ?? [];\n\t}\n\n\t/**\n\t * The stickers the message contains, if any.\n\t */\n\tpublic get sticker_items() {\n\t\treturn this[Data].sticker_items;\n\t}\n\n\t/**\n\t * The stickers the message contains, if any.\n\t *\n\t * @seealso {@link sticker_items} for the raw data.\n\t */\n\tpublic get stickerItems() {\n\t\treturn this.sticker_items ?? [];\n\t}\n}\n","import type { APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption } from 'discord-api-types/v10';\nimport type { Command } from '../structures/Command.js';\n\n/**\n * Represents an error that is thrown when a {@link ChatInputRouter} encounters an error.\n * @since 2.0.0\n */\nexport class ChatInputRouterError<Options extends Command.Options = Command.Options> extends Error {\n\t/**\n\t * The key identifying the error.\n\t * @since 2.0.0\n\t */\n\tpublic readonly key: keyof typeof ChatInputRouterErrors;\n\n\t/**\n\t * The command that was being processed when the error was thrown.\n\t * @since 2.0.0\n\t */\n\tpublic readonly command: Command<Options>;\n\n\t/**\n\t * The subcommand group that was being processed when the error was thrown, if any.\n\t * @since 2.0.0\n\t */\n\tpublic readonly group: APIApplicationCommandSubcommandGroupOption | null;\n\n\t/**\n\t * The subcommand that was being processed when the error was thrown, if any.\n\t * @since 2.0.0\n\t */\n\tpublic readonly subcommand: APIApplicationCommandSubcommandOption | null;\n\n\tpublic constructor(\n\t\tkey: keyof typeof ChatInputRouterErrors,\n\t\tcommand: Command<Options>,\n\t\tgroup?: APIApplicationCommandSubcommandGroupOption | null,\n\t\tsubcommand?: APIApplicationCommandSubcommandOption | null\n\t) {\n\t\tsuper(ChatInputRouterErrors[key](command.name, group?.name ?? '', subcommand?.name ?? ''));\n\t\tthis.key = key;\n\t\tthis.command = command;\n\t\tthis.group = group ?? null;\n\t\tthis.subcommand = subcommand ?? null;\n\t}\n\n\t/**\n\t * The path of the command that was being processed when the error was thrown.\n\t * @since 2.0.0\n\t */\n\tpublic get path() {\n\t\treturn `${this.command.name}${this.group ? `/${this.group.name}` : ''}${this.subcommand ? `/${this.subcommand.name}` : ''}`;\n\t}\n}\n\nexport const ChatInputRouterErrors = {\n\tDuplicatedSubcommandGroup: (command: string, subcommandGroup: string) =>\n\t\t`Duplicated subcommand group named '${subcommandGroup}' in command '${command}'`,\n\tDuplicatedSubcommand: (command: string, subcommandGroup: string, subcommand: string) =>\n\t\t`Duplicated subcommand named '${subcommand}' in subcommand group '${subcommandGroup}' in command '${command}'`,\n\tSubcommandGroupLinkInvalid: (command: string, subcommandGroup: string) =>\n\t\t`Subcommand group named '${subcommandGroup}' in command '${command}' is not linked to a method`,\n\tSubcommandLinkInvalid: (command: string, subcommandGroup: string, subcommand: string) =>\n\t\t`Subcommand named '${subcommand}' ${\n\t\t\tsubcommandGroup ? `in subcommand group '${subcommandGroup}' ` : ''\n\t\t}in command '${command}' is not linked to a method`\n} as const;\n","import { isFunction } from '@sapphire/utilities';\nimport type { APIApplicationCommandSubcommandOption } from 'discord-api-types/v10';\nimport { ChatInputRouterError } from '../../errors/ChatInputRouterError';\nimport type { Command } from '../../structures/Command.js';\nimport type { CommandRouterSubcommandGroup } from './CommandRouterSubcommandGroup';\n\n/**\n * Represents a subcommand in a command router.\n *\n * @template Options - The options type for the command.\n * @internal\n */\nexport class CommandRouterSubcommand<Options extends Command.Options = Command.Options> {\n\t#subcommandMapping: string | null = null;\n\n\t/**\n\t * Checks if the subcommand is a subcommand group.\n\t *\n\t * @returns True if the subcommand is a subcommand group, false otherwise.\n\t */\n\tpublic isSubcommandGroup(): this is CommandRouterSubcommandGroup {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Checks if the subcommand is a subcommand.\n\t *\n\t * @returns True if the subcommand is a subcommand, false otherwise.\n\t */\n\tpublic isSubcommand(): this is CommandRouterSubcommand {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Throws an error indicating that the subcommand is a subcommand group.\n\t *\n\t * @throws Error - Cannot assert subcommand on a subcommand group.\n\t */\n\tpublic assertSubcommandGroup(): never {\n\t\tthrow new Error('Cannot assert subcommand on a subcommand group');\n\t}\n\n\t/**\n\t * Asserts that the subcommand is a subcommand.\n\t *\n\t * @returns The current subcommand instance.\n\t */\n\tpublic assertSubcommand(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Gets the subcommand mapping.\n\t *\n\t * @returns The subcommand mapping.\n\t */\n\tpublic getSubcommandMapping(): string | null {\n\t\treturn this.#subcommandMapping;\n\t}\n\n\t/**\n\t * Sets the subcommand mapping.\n\t *\n\t * @param command - The command instance.\n\t * @param subcommand - The subcommand option.\n\t * @param method - The method name.\n\t * @returns The current subcommand instance.\n\t * @throws ChatInputRouterError - Throws an error if the method is not a function.\n\t */\n\tpublic setSubcommandMapping(command: Command<Options>, subcommand: APIApplicationCommandSubcommandOption, method: string) {\n\t\tif (!isFunction(Reflect.get(command, method))) {\n\t\t\tthrow new ChatInputRouterError('SubcommandLinkInvalid', command, null, subcommand);\n\t\t}\n\n\t\tthis.#subcommandMapping = method;\n\t\treturn this;\n\t}\n}\n","import { Collection } from '@discordjs/collection';\nimport { isFunction } from '@sapphire/utilities';\nimport type { APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption } from 'discord-api-types/v10';\nimport { ChatInputRouterError } from '../../errors/ChatInputRouterError';\nimport type { Command } from '../../structures/Command.js';\nimport type { CommandRouterSubcommand } from './CommandRouterSubcommand';\n\n/**\n * Represents a subcommand group in a command router.\n *\n * @template Options - The options type for the command.\n * @internal\n */\nexport class CommandRouterSubcommandGroup<Options extends Command.Options = Command.Options> {\n\t#subcommandGroupMapping: string | null = null;\n\t#subcommandMapping = new Collection<string, string>();\n\n\t/**\n\t * Checks if this instance is a subcommand group.\n\t *\n\t * @returns True if this instance is a subcommand group, false otherwise.\n\t */\n\tpublic isSubcommandGroup(): this is CommandRouterSubcommandGroup {\n\t\treturn true;\n\t}\n\n\t/**\n\t * Checks if this instance is a subcommand.\n\t *\n\t * @returns True if this instance is a subcommand, false otherwise.\n\t */\n\tpublic isSubcommand(): this is CommandRouterSubcommand {\n\t\treturn false;\n\t}\n\n\t/**\n\t * Asserts that this instance is a subcommand group.\n\t *\n\t * @returns The current instance.\n\t */\n\tpublic assertSubcommandGroup(): this {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Throws an error indicating that this instance cannot be asserted as a subcommand.\n\t * @throws Error - An error indicating that subcommand cannot be asserted on a subcommand group.\n\t */\n\tpublic assertSubcommand(): never {\n\t\tthrow new Error('Cannot assert subcommand on a subcommand group');\n\t}\n\n\t/**\n\t * Gets the subcommand group mapping.\n\t *\n\t * @returns The subcommand group mapping.\n\t */\n\tpublic getSubcommandGroupMapping(): string | null {\n\t\treturn this.#subcommandGroupMapping;\n\t}\n\n\t/**\n\t * Gets the subcommand mapping for the specified subcommand.\n\t *\n\t * @param subcommand - The name of the subcommand.\n\t * @returns The subcommand mapping.\n\t */\n\tpublic getSubcommandMapping(subcommand: string): string | null {\n\t\treturn this.#subcommandMapping.get(subcommand) ?? null;\n\t}\n\n\t/**\n\t * Sets the subcommand group mapping.\n\t *\n\t * @param command - The command instance.\n\t * @param group - The subcommand group option.\n\t * @param method - The method name.\n\t * @returns The current instance.\n\t * @throws ChatInputRouterError - If the method is not a function on the command instance.\n\t */\n\tpublic setSubcommandGroupMapping(command: Command<Options>, group: APIApplicationCommandSubcommandGroupOption, method: string) {\n\t\tif (!isFunction(Reflect.get(command, method))) {\n\t\t\tthrow new ChatInputRouterError('SubcommandGroupLinkInvalid', command, group, null);\n\t\t}\n\n\t\tthis.#subcommandGroupMapping = method;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the subcommand mapping.\n\t *\n\t * @param command - The command instance.\n\t * @param group - The subcommand group option.\n\t * @param subcommand - The subcommand option.\n\t * @param method - The method name.\n\t * @returns The current instance.\n\t * @throws ChatInputRouterError - If the method is not a function on the command instance.\n\t */\n\tpublic setSubcommandMapping(\n\t\tcommand: Command<Options>,\n\t\tgroup: APIApplicationCommandSubcommandGroupOption,\n\t\tsubcommand: APIApplicationCommandSubcommandOption,\n\t\tmethod: string\n\t) {\n\t\tif (!isFunction(Reflect.get(command, method))) {\n\t\t\tthrow new ChatInputRouterError('SubcommandLinkInvalid', command, group, subcommand);\n\t\t}\n\n\t\tthis.#subcommandMapping.set(subcommand.name, method);\n\t\treturn this;\n\t}\n}\n","import { Collection } from '@discordjs/collection';\nimport { container } from '@sapphire/pieces';\nimport { isFunction } from '@sapphire/utilities';\nimport {\n\tApplicationCommandOptionType,\n\tApplicationCommandType,\n\ttype APIChatInputApplicationCommandInteractionData,\n\ttype APIContextMenuInteractionData\n} from 'discord-api-types/v10';\nimport type { Command } from '../../structures/Command.js';\nimport type { ChatInputCommandResolver } from '../resolvers/ChatInputCommandResolver.js';\nimport type { ContextMenuCommandResolver } from '../resolvers/ContextMenuCommandResolver.js';\nimport { getLinkedMethod } from '../shared/link.js';\nimport { CommandRouterSubcommand } from './CommandRouterSubcommand.js';\nimport { CommandRouterSubcommandGroup } from './CommandRouterSubcommandGroup.js';\n\n/**\n * Represents a command router that handles routing of interactions for a specific command.\n *\n * @since 2.0.0\n * @template Options - The options type for the command.\n */\nexport class CommandRouter<Options extends Command.Options = Command.Options> {\n\t#command: Command<Options>;\n\t#chatInputName: string | null = null;\n\t#chatInputRouter = new Collection<string, CommandRouterSubcommandGroup | CommandRouterSubcommand>();\n\t#messageContextMenuRouter = new Collection<string, string>();\n\t#userContextMenuRouter = new Collection<string, string>();\n\n\tpublic constructor(command: Command<Options>) {\n\t\tthis.#command = command;\n\n\t\tconst entry = container.applicationCommandRegistry.get(command.constructor as typeof Command<Options>);\n\t\tif (entry === null) {\n\t\t\tconsole.warn(`CommandRouter: No entry found for command '${command.name}'`);\n\t\t} else {\n\t\t\tthis.#populateChatInputRouter(entry.chatInput);\n\t\t\tthis.#populateContextMenuRouter(entry.contextMenu);\n\t\t}\n\t}\n\n\t/**\n\t * The name of the registered chat input command for this command, if any.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic get chatInputName(): string | null {\n\t\treturn this.#chatInputName;\n\t}\n\n\t/**\n\t * The names of the registered context menu commands for this command, if any.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic get contextMenuNames(): string[] {\n\t\treturn [...this.#messageContextMenuRouter.keys(), ...this.#userContextMenuRouter.keys()];\n\t}\n\n\t/**\n\t * Routes a chat input interaction based on the provided data.\n\t *\n\t * @since 2.0.0\n\t * @param data - The data of the chat input interaction.\n\t * @returns The mapped command name or `null` if no mapping is found.\n\t */\n\tpublic routeChatInputInteraction(data: APIChatInputApplicationCommandInteractionData): string | null {\n\t\tif (!data.options?.length) return 'chatInputRun';\n\n\t\tconst [firstOption] = data.options;\n\t\tif (firstOption.type === ApplicationCommandOptionType.Subcommand) {\n\t\t\tconst entry = this.#chatInputRouter.get(firstOption.name);\n\t\t\treturn entry?.isSubcommand() ? entry.getSubcommandMapping() : null;\n\t\t}\n\n\t\tif (firstOption.type === ApplicationCommandOptionType.SubcommandGroup) {\n\t\t\tconst entry = this.#chatInputRouter.get(firstOption.name);\n\t\t\treturn entry?.isSubcommandGroup() ? (entry.getSubcommandMapping(firstOption.options[0].name) ?? entry.getSubcommandGroupMapping()) : null;\n\t\t}\n\n\t\treturn 'chatInputRun';\n\t}\n\n\t/**\n\t * Routes a context menu interaction based on the provided data.\n\t *\n\t * @since 2.0.0\n\t * @param data - The data for the context menu interaction.\n\t * @returns The result of the context menu interaction, or null if no result is found.\n\t */\n\tpublic routeContextMenuInteraction(data: APIContextMenuInteractionData): string | null {\n\t\treturn this.#getContextMenuCollection(data.type)?.get(data.name) ?? null;\n\t}\n\n\t#populateChatInputRouter(entry: ChatInputCommandResolver | null) {\n\t\tif (entry === null) return;\n\n\t\tconst data = entry.toJSON();\n\t\tthis.#chatInputName = data.name;\n\t\tif (!data.options?.length) return;\n\n\t\tconst command = this.#command;\n\t\tconst chatInputRouter = this.#chatInputRouter;\n\t\tfor (const option of data.options) {\n\t\t\tif (option.type === ApplicationCommandOptionType.SubcommandGroup) {\n\t\t\t\tconst entry = chatInputRouter.ensure(option.name, () => new CommandRouterSubcommandGroup()).assertSubcommandGroup();\n\t\t\t\tconst subcommandGroupMethod = getLinkedMethod(option);\n\t\t\t\tif (subcommandGroupMethod) entry.setSubcommandGroupMapping(command, option, subcommandGroupMethod);\n\n\t\t\t\tfor (const subOption of option.options ?? []) {\n\t\t\t\t\tconst subcommandMethod = getLinkedMethod(subOption);\n\t\t\t\t\tif (subcommandMethod) entry.setSubcommandMapping(command, option, subOption, subcommandMethod);\n\t\t\t\t}\n\t\t\t} else if (option.type === ApplicationCommandOptionType.Subcommand) {\n\t\t\t\tconst entry = chatInputRouter.ensure(option.name, () => new CommandRouterSubcommand()).assertSubcommand();\n\t\t\t\tconst subcommandMethod = getLinkedMethod(option);\n\t\t\t\tif (subcommandMethod) entry.setSubcommandMapping(command, option, subcommandMethod);\n\t\t\t}\n\t\t}\n\t}\n\n\t#populateContextMenuRouter(entries: ContextMenuCommandResolver[]) {\n\t\tconst command = this.#command;\n\t\tfor (const entry of entries) {\n\t\t\tconst data = entry.toJSON();\n\t\t\tconst method = getLinkedMethod(data);\n\t\t\tif (!method) continue;\n\n\t\t\tif (isFunction(Reflect.get(command, method))) {\n\t\t\t\tthis.#getContextMenuCollection(data.type)?.set(data.name, method);\n\t\t\t} else {\n\t\t\t\tthrow new Error(`Context menu command named \"${data.name}\" is not linked to a method`);\n\t\t\t}\n\t\t}\n\t}\n\n\t#getContextMenuCollection(type: ApplicationCommandType) {\n\t\tswitch (type) {\n\t\t\tcase ApplicationCommandType.Message:\n\t\t\t\treturn this.#messageContextMenuRouter;\n\t\t\tcase ApplicationCommandType.User:\n\t\t\t\treturn this.#userContextMenuRouter;\n\t\t\tdefault:\n\t\t\t\treturn null;\n\t\t}\n\t}\n}\n","import { Piece } from '@sapphire/pieces';\nimport type { Awaitable, NonNullObject } from '@sapphire/utilities';\nimport type { AutocompleteInteractionArguments, Interactions } from '../interactions/index.js';\nimport { CommandRouter } from '../interactions/router/CommandRouter.js';\n\nexport abstract class Command<Options extends Command.Options = Command.Options> extends Piece<Options, 'commands'> {\n\t/**\n\t * The router for the command.\n\t * @since 2.0.0\n\t */\n\tpublic readonly router: CommandRouter<Options>;\n\n\tpublic constructor(context: Command.LoaderContext, options: Options = {} as Options) {\n\t\tsuper(context, options);\n\t\tthis.router = new CommandRouter(this);\n\t}\n\n\t/**\n\t * Gets the registry for this command.\n\t *\n\t * @returns The registry for this command, or `null` if it is not registered.\n\t */\n\tpublic get registry() {\n\t\treturn this.container.applicationCommandRegistry.get(this.constructor as typeof Command) ?? null;\n\t}\n\n\t/**\n\t * Responds to the chat input command for this command\n\t *\n\t * @param interaction - The interaction to be handled.\n\t * @param args - The parsed arguments for this autocomplete interaction.\n\t */\n\tpublic chatInputRun(interaction: Command.ApplicationCommandInteraction, args: NonNullObject): Awaitable<unknown>;\n\tpublic chatInputRun() {\n\t\tthrow new Error(`The method 'chatInputRun' has not been implemented in ${this.name}.`);\n\t}\n\n\t/**\n\t * Responds to an auto completable option for this command\n\t *\n\t * @param interaction - The interaction to be handled.\n\t * @param args - The parsed arguments for this autocomplete interaction.\n\t * @returns The response to the autocomplete interaction.\n\t */\n\tpublic autocompleteRun(interaction: Command.AutocompleteInteraction, args: Command.AutocompleteArguments<any>): Awaitable<unknown>;\n\tpublic autocompleteRun() {\n\t\tthrow new Error(`The method 'autocompleteRun' has not been implemented in ${this.name}.`);\n\t}\n}\n\nexport namespace Command {\n\texport type AutocompleteInteraction = Interactions.Autocomplete;\n\texport type AutocompleteArguments<T extends object> = AutocompleteInteractionArguments<T>;\n\n\texport type ChatInputInteraction = Interactions.ChatInputCommand;\n\texport type UserInteraction = Interactions.UserContextMenuCommand;\n\texport type MessageInteraction = Interactions.MessageContextMenuCommand;\n\n\texport type ContextMenuInteraction = Interactions.ContextMenuCommand;\n\texport type ApplicationCommandInteraction = Interactions.ApplicationCommand;\n\n\texport type Interaction = ChatInputInteraction | AutocompleteInteraction | UserInteraction | MessageInteraction;\n\texport type InteractionData = Interaction['data'];\n\n\t// Piece re-exports\n\t/** @deprecated Use {@linkcode LoaderContext} instead. */\n\texport type Context = LoaderContext;\n\texport type LoaderContext = Piece.LoaderContext<'commands'>;\n\texport type JSON = Piece.JSON;\n\texport type LocationJSON = Piece.LocationJSON;\n\texport type Options = Piece.Options;\n}\n","import { LoaderStrategy } from '@sapphire/pieces';\nimport type { Command } from './Command.js';\nimport type { CommandStore } from './CommandStore.js';\n\n/**\n * Represents a strategy for loading and unloading commands.\n *\n * @since 2.0.0\n */\nexport class CommandLoaderStrategy extends LoaderStrategy<Command> {\n\t/**\n\t * Called when a command is loaded.\n\t *\n\t * @since 2.0.0\n\t * @param store - The command store.\n\t * @param piece - The command being loaded.\n\t * @returns The loaded command.\n\t */\n\tpublic override onLoad(store: CommandStore, piece: Command) {\n\t\tif (piece.router.chatInputName) {\n\t\t\tstore.router.addChatInputMapping(piece.router.chatInputName, piece);\n\t\t}\n\n\t\tfor (const name of piece.router.contextMenuNames) {\n\t\t\tstore.router.addContextMenuMapping(name, piece);\n\t\t}\n\n\t\treturn piece;\n\t}\n\n\t/**\n\t * Called when a command is unloaded.\n\t *\n\t * @since 2.0.0\n\t * @param store - The command store.\n\t * @param piece - The command being unloaded.\n\t * @returns The unloaded command.\n\t */\n\tpublic override onUnload(store: CommandStore, piece: Command) {\n\t\tif (piece.router.chatInputName) {\n\t\t\tstore.router.removeChatInputMapping(piece.router.chatInputName);\n\t\t}\n\n\t\tfor (const name of piece.router.contextMenuNames) {\n\t\t\tstore.router.removeContextMenuMapping(name);\n\t\t}\n\n\t\treturn piece;\n\t}\n}\n","import { Collection } from '@discordjs/collection';\nimport { ApplicationCommandType, type APIApplicationCommandInteraction } from 'discord-api-types/v10';\nimport type { Command } from './Command.js';\n\n/**\n * Represents a router for mapping commands to chat inputs and context menus.\n *\n * @since 2.0.0\n */\nexport class CommandStoreRouter {\n\t#chatInputMappings = new Collection<string, Command>();\n\t#contextMenuMappings = new Collection<string, Command>();\n\n\t/**\n\t * Gets the command associated with the given interaction.\n\t *\n\t * @since 2.0.0\n\t * @param interaction - The interaction object.\n\t * @returns The command associated with the interaction, or null if not found.\n\t */\n\tpublic get(interaction: APIApplicationCommandInteraction) {\n\t\treturn interaction.data.type === ApplicationCommandType.ChatInput\n\t\t\t? this.getChatInput(interaction.data.name)\n\t\t\t: this.getContextMenu(interaction.data.name);\n\t}\n\n\t/**\n\t * Gets the chat input command with the specified name.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the chat input command.\n\t * @returns The chat input command with the specified name, or null if not found.\n\t */\n\tpublic getChatInput(name: string): Command | null {\n\t\treturn this.#chatInputMappings.get(name) ?? null;\n\t}\n\n\t/**\n\t * Gets the context menu command with the specified name.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the context menu command.\n\t * @returns The context menu command with the specified name, or null if not found.\n\t */\n\tpublic getContextMenu(name: string): Command | null {\n\t\treturn this.#contextMenuMappings.get(name) ?? null;\n\t}\n\n\t/**\n\t * Adds a chat input mapping.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the mapping.\n\t * @param command - The command to be mapped.\n\t * @internal\n\t */\n\tpublic addChatInputMapping(name: string, command: Command): void {\n\t\tthis.#chatInputMappings.set(name, command);\n\t}\n\n\t/**\n\t * Adds a context menu mapping.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the mapping.\n\t * @param command - The command to be mapped.\n\t * @internal\n\t */\n\tpublic addContextMenuMapping(name: string, command: Command): void {\n\t\tthis.#contextMenuMappings.set(name, command);\n\t}\n\n\t/**\n\t * Removes a chat input mapping.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the mapping to be removed.\n\t * @returns True if the mapping was successfully removed, false otherwise.\n\t * @internal\n\t */\n\tpublic removeChatInputMapping(name: string): boolean {\n\t\treturn this.#chatInputMappings.delete(name);\n\t}\n\n\t/**\n\t * Removes a context menu mapping.\n\t *\n\t * @since 2.0.0\n\t * @param name - The name of the mapping to be removed.\n\t * @returns True if the mapping was successfully removed, false otherwise.\n\t * @internal\n\t */\n\tpublic removeContextMenuMapping(name: string): boolean {\n\t\treturn this.#contextMenuMappings.delete(name);\n\t}\n}\n","import { container, Store } from '@sapphire/pieces';\nimport { Result } from '@sapphire/result';\nimport type { Awaitable } from '@sapphire/utilities';\nimport {\n\tApplicationCommandType,\n\ttype APIApplicationCommandAutocompleteInteraction,\n\ttype APIApplicationCommandInteraction,\n\ttype APIApplicationCommandInteractionData,\n\ttype APIPrimaryEntryPointCommandInteraction\n} from 'discord-api-types/v10';\nimport type { ServerResponse } from 'node:http';\nimport { HttpCodes } from '../api/HttpCodes.js';\nimport {\n\ttransformAutocompleteInteraction,\n\ttransformInteraction,\n\ttransformMessageInteraction,\n\ttransformUserInteraction\n} from '../interactions/index.js';\nimport { handleError, makeInteraction } from '../interactions/utils/util.js';\nimport { ErrorMessages } from '../utils/constants.js';\nimport { Command } from './Command.js';\nimport { CommandLoaderStrategy } from './CommandLoaderStrategy.js';\nimport { CommandStoreRouter } from './CommandStoreRouter.js';\n\nexport class CommandStore extends Store<Command, 'commands'> {\n\t/**\n\t * The router instance for handling commands in the CommandStore.\n\t *\n\t * @since 2.0.0\n\t */\n\tpublic router = new CommandStoreRouter();\n\n\tpublic constructor() {\n\t\tsuper(Command, { name: 'commands', strategy: new CommandLoaderStrategy() });\n\t}\n\n\t/**\n\t * Runs an application command.\n\t *\n\t * @since 1.0.0\n\t * @param response - The server response object.\n\t * @param interaction - The API application command interaction object.\n\t * @returns A promise that resolves to the server response.\n\t */\n\tpublic async runApplicationCommand(\n\t\tresponse: ServerResponse,\n\t\tinteraction: Exclude<APIApplicationCommandInteraction, APIPrimaryEntryPointCommandInteraction>\n\t): Promise<ServerResponse> {\n\t\tconst command = this.router.get(interaction);\n\t\tif (!command) {\n\t\t\tcontainer.client.emit('commandNameUnknown', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\treturn response.end(ErrorMessages.UnknownCommandName);\n\t\t}\n\n\t\tconst context = { command, interaction, response };\n\t\tconst method = this.#routeCommandMethodName(command, interaction.data);\n\t\tif (!method) {\n\t\t\tcontainer.client.emit('commandMethodUnknown', context);\n\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\treturn response.end(ErrorMessages.UnknownCommandHandler);\n\t\t}\n\n\t\tcontainer.client.emit('commandRun', context);\n\t\tconst result = await Result.fromAsync(() => this.#runCommandMethod(command, method, makeInteraction(response, interaction)));\n\t\tresult\n\t\t\t.inspect((value) => container.client.emit('commandSuccess', context, value))\n\t\t\t.inspectErr((error) => (container.client.emit('commandError', error, context), handleError(response, error)));\n\n\t\tcontainer.client.emit('commandFinish', context);\n\t\treturn response;\n\t}\n\n\t/**\n\t * Runs the application command autocomplete.\n\t *\n\t * @since 1.0.0\n\t * @param response - The server response object.\n\t * @param interaction - The API application command autocomplete interaction object.\n\t * @returns A promise that resolves to the server response.\n\t */\n\tpublic async runApplicationCommandAutocomplete(\n\t\tresponse: ServerResponse,\n\t\tinteraction: APIApplicationCommandAutocompleteInteraction\n\t): Promise<ServerResponse> {\n\t\tif (!interaction.data?.name) {\n\t\t\tcontainer.client.emit('commandNameMissing', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.BadRequest;\n\t\t\treturn response.end(ErrorMessages.MissingCommandName);\n\t\t}\n\n\t\tconst command = this.router.getChatInput(interaction.data.name);\n\t\tif (!command) {\n\t\t\tcontainer.client.emit('commandNameUnknown', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\treturn response.end(ErrorMessages.UnknownCommandName);\n\t\t}\n\n\t\tconst context = { command, interaction, response };\n\t\tconst options = transformAutocompleteInteraction(interaction.data.resolved ?? {}, interaction.data.options);\n\n\t\tcontainer.client.emit('autocompleteRun', context);\n\t\tconst result = await Result.fromAsync(() => command.autocompleteRun(makeInteraction(response, interaction), options));\n\t\tresult\n\t\t\t.inspect((value) => container.client.emit('autocompleteSuccess', context, value))\n\t\t\t.inspectErr((error) => (container.client.emit('autocompleteError', error, context), handleError(response, error)));\n\n\t\tcontainer.client.emit('autocompleteFinish', context);\n\t\treturn response;\n\t}\n\n\t/**\n\t * Executes a command method on a command object.\n\t *\n\t * @since 1.0.0\n\t * @param command - The command object.\n\t * @param method - The name of the method to execute.\n\t * @param interaction - The application command interaction.\n\t * @returns A promise that resolves to the result of the method execution.\n\t */\n\t#runCommandMethod(command: Command, method: string, interaction: Command.ApplicationCommandInteraction): Awaitable<unknown> {\n\t\treturn Reflect.apply(Reflect.get(command, method), command, [interaction, this.#createArguments(interaction.data)]);\n\t}\n\n\t/**\n\t * Determines the method name to route a command based on the type of interaction data.\n\t *\n\t * @since 1.0.0\n\t * @param command - The command object.\n\t * @param data - The interaction data.\n\t * @returns The method name to route the command, or null if no method is found.\n\t * @throws Error - If the interaction data type is not recognized.\n\t */\n\t#routeCommandMethodName(command: Command, data: Command.ApplicationCommandInteraction['data']): string | null {\n\t\tswitch (data.type) {\n\t\t\tcase ApplicationCommandType.ChatInput:\n\t\t\t\treturn command.router.routeChatInputInteraction(data);\n\t\t\tcase ApplicationCommandType.User:\n\t\t\tcase ApplicationCommandType.Message:\n\t\t\t\treturn command.router.routeContextMenuInteraction(data);\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Unreachable');\n\t\t}\n\t}\n\n\t/**\n\t * Creates arguments based on the provided {@linkcode APIApplicationCommandInteractionData}.\n\t *\n\t * @since 1.0.0\n\t * @param data The {@linkcode APIApplicationCommandInteractionData} object.\n\t * @returns The transformed arguments based on the interaction data.\n\t * @throws Error - If the {@linkcode ApplicationCommandType} is unsupported.\n\t */\n\t#createArguments(data: APIApplicationCommandInteractionData) {\n\t\tswitch (data.type) {\n\t\t\tcase ApplicationCommandType.ChatInput:\n\t\t\t\treturn transformInteraction(data.resolved ?? {}, data.options ?? []);\n\t\t\tcase ApplicationCommandType.User:\n\t\t\t\treturn transformUserInteraction(data);\n\t\t\tcase ApplicationCommandType.Message:\n\t\t\t\treturn transformMessageInteraction(data);\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Unknown ApplicationCommandType');\n\t\t}\n\t}\n}\n","import { Piece } from '@sapphire/pieces';\nimport type { Interactions } from '../interactions/index.js';\n\nexport abstract class InteractionHandler<Options extends InteractionHandler.Options = InteractionHandler.Options> extends Piece<\n\tOptions,\n\t'interaction-handlers'\n> {\n\tpublic constructor(context: InteractionHandler.LoaderContext, options: Options = {} as Options) {\n\t\tsuper(context, options);\n\t}\n\n\tpublic abstract run(interaction: InteractionHandler.Interaction, customIdValue: unknown): Awaited<unknown>;\n}\n\nexport namespace InteractionHandler {\n\texport type ButtonInteraction = Interactions.MessageComponentButton;\n\texport type SelectMenuInteraction = Interactions.MessageComponentSelectMenu;\n\texport type ModalInteraction = Interactions.ModalSubmit;\n\texport type MessageComponentInteraction = Interactions.MessageComponent;\n\n\texport type ContextMenuInteraction = Interactions.ContextMenuCommand;\n\texport type ApplicationCommandInteraction = Interactions.ApplicationCommand;\n\n\texport type Interaction = Interactions.MessageComponent;\n\texport type InteractionData = Interaction['data'];\n\n\t// Piece re-exports\n\t/** @deprecated Use {@linkcode LoaderContext} instead. */\n\texport type Context = LoaderContext;\n\texport type LoaderContext = Piece.LoaderContext<'interaction-handlers'>;\n\texport type JSON = Piece.JSON;\n\texport type LocationJSON = Piece.LocationJSON;\n\texport type Options = Piece.Options;\n}\n","import { container, Store } from '@sapphire/pieces';\nimport { Result } from '@sapphire/result';\nimport type { APIMessageComponentInteraction, APIModalSubmitInteraction } from 'discord-api-types/v10';\nimport type { ServerResponse } from 'node:http';\nimport { HttpCodes } from '../api/HttpCodes.js';\nimport { handleError, makeInteraction } from '../interactions/utils/util.js';\nimport { ErrorMessages } from '../utils/constants.js';\nimport { InteractionHandler } from './InteractionHandler.js';\n\nexport class InteractionHandlerStore extends Store<InteractionHandler, 'interaction-handlers'> {\n\tpublic constructor() {\n\t\tsuper(InteractionHandler, { name: 'interaction-handlers' });\n\t}\n\n\tpublic async runHandler(\n\t\tresponse: ServerResponse,\n\t\tinteraction: APIMessageComponentInteraction | APIModalSubmitInteraction\n\t): Promise<ServerResponse> {\n\t\tconst parsed = container.idParser.run(interaction.data.custom_id);\n\t\tif (parsed === null) {\n\t\t\tcontainer.client.emit('interactionHandlerNameInvalid', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.BadRequest;\n\t\t\treturn response.end(ErrorMessages.InvalidCustomId);\n\t\t}\n\n\t\tconst handler = this.get(parsed.name);\n\t\tif (!handler) {\n\t\t\tcontainer.client.emit('interactionHandlerNameUnknown', interaction, response);\n\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\treturn response.end(ErrorMessages.UnknownHandlerName);\n\t\t}\n\n\t\tconst context = { handler, interaction, response };\n\t\tcontainer.client.emit('interactionHandlerRun', context);\n\t\tconst result = await Result.fromAsync(() => handler.run(makeInteraction(response, interaction), parsed.content));\n\t\tresult\n\t\t\t.inspect((value) => container.client.emit('interactionHandlerSuccess', context, value))\n\t\t\t.inspectErr((error) => (container.client.emit('interactionHandlerError', error, context), handleError(response, error)));\n\n\t\tcontainer.client.emit('interactionHandlerFinish', context);\n\t\treturn response;\n\t}\n}\n","// Copyright © 2020 - The Sapphire Community and its contributors | MIT\n// Source: https://github.com/sapphiredev/framework/blob/effcede3c54e0f0335369137a9b76060729df32c/src/lib/structures/Listener.ts\n\nimport { Piece, type Container } from '@sapphire/pieces';\nimport type { Awaitable } from '@sapphire/utilities';\n\nexport abstract class Listener<Options extends Listener.Options = Listener.Options> extends Piece<Options, 'listeners'> {\n\tpublic emitter: Listener.Emitter;\n\tpublic event: string;\n\tprotected _listener: (...args: readonly any[]) => unknown;\n\n\tpublic constructor(context: Listener.LoaderContext, options: Options) {\n\t\tsuper(context, options);\n\n\t\tthis.emitter = typeof options.emitter === 'string' ? this.container[options.emitter] : (options.emitter ?? this.container.client);\n\t\tthis.event = options.event ?? this.name;\n\t\tthis._listener = this.run.bind(this);\n\t}\n\n\tpublic abstract run(...args: readonly any[]): Awaitable<unknown>;\n}\n\nexport namespace Listener {\n\t/** @deprecated Use {@linkcode LoaderContext} instead. */\n\texport type Context = LoaderContext;\n\texport type LoaderContext = Piece.LoaderContext<'listeners'>;\n\texport type JSON = Piece.JSON;\n\texport type LocationJSON = Piece.LocationJSON;\n\texport interface Options extends Piece.Options {\n\t\temitter: Emitter | { [K in keyof Container]: Container[K] extends Emitter ? K : never }[keyof Container];\n\t\tevent?: string;\n\t}\n\n\texport interface Emitter {\n\t\ton(eventName: string, listener: (...args: any[]) => void): this;\n\t\tonce(eventName: string, listener: (...args: any[]) => void): this;\n\t\toff(eventName: string, listener: (...args: any[]) => void): this;\n\t\tsetMaxListeners(n: number): this;\n\t\tgetMaxListeners(): number;\n\t\temit(eventName: string, ...args: any[]): boolean;\n\t}\n}\n","// Copyright © 2020 - The Sapphire Community and its contributors | MIT\n// Source: https://github.com/sapphiredev/framework/blob/e9a7966f0bad532deb1a7da617b57db902ae06a6/src/lib/structures/ListenerLoaderStrategy.ts\n\nimport { LoaderStrategy } from '@sapphire/pieces';\nimport type { Listener } from './Listener.js';\nimport type { ListenerStore } from './ListenerStore.js';\n\n/**\n * Represents a strategy for loading and unloading listeners.\n *\n * @since 2.1.0\n */\nexport class ListenerLoaderStrategy extends LoaderStrategy<Listener> {\n\t/**\n\t * Called when a listener is loaded.\n\t *\n\t * @since 2.1.0\n\t * @param store - The listener store.\n\t * @param piece - The listener being loaded.\n\t * @returns The loaded listener.\n\t */\n\tpublic override onLoad(_store: ListenerStore, piece: Listener) {\n\t\tconst emitter = piece.emitter!;\n\n\t\t// Increment the maximum amount of listeners by one:\n\t\tconst maxListeners = emitter.getMaxListeners();\n\t\tif (maxListeners !== 0) emitter.setMaxListeners(maxListeners + 1);\n\n\t\temitter.on(piece.event, piece['_listener']);\n\t}\n\n\t/**\n\t * Called when a listener is unloaded.\n\t *\n\t * @since 2.1.0\n\t * @param store - The listener store.\n\t * @param piece - The listener being unloaded.\n\t * @returns The unloaded listener.\n\t */\n\tpublic override onUnload(_store: ListenerStore, piece: Listener) {\n\t\tconst emitter = piece.emitter!;\n\n\t\t// Increment the maximum amount of listeners by one:\n\t\tconst maxListeners = emitter.getMaxListeners();\n\t\tif (maxListeners !== 0) emitter.setMaxListeners(maxListeners - 1);\n\n\t\temitter.off(piece.event, piece['_listener']);\n\t}\n}\n","// Copyright © 2020 - The Sapphire Community and its contributors | MIT\n// Source: https://github.com/sapphiredev/framework/blob/effcede3c54e0f0335369137a9b76060729df32c/src/lib/structures/ListenerStore.ts\n\nimport { Store } from '@sapphire/pieces';\nimport { Listener } from './Listener.js';\nimport { ListenerLoaderStrategy } from './ListenerLoaderStrategy.js';\n\nexport class ListenerStore extends Store<Listener, 'listeners'> {\n\tpublic constructor() {\n\t\tsuper(Listener, { name: 'listeners', strategy: new ListenerLoaderStrategy() });\n\t}\n}\n","import { webcrypto } from 'node:crypto';\n\nexport type HeaderValue = string | string[];\nexport type Key = webcrypto.CryptoKey;\n\nconst AlgorithmName = 'Ed25519';\n\nfunction headerToString(header: HeaderValue): string {\n\treturn typeof header === 'string' ? header : header[0];\n}\n\nexport function makeKey(key: string): Promise<Key> {\n\treturn webcrypto.subtle.importKey('raw', Buffer.from(key, 'hex'), { name: AlgorithmName }, true, ['verify']);\n}\n\n/**\n * Validates a payload from Discord against its signature and key.\n * @param body The request body.\n * @param signature The value of the `x-signature-ed25519` header.\n * @param signature The value of the `x-signature-timestamp` header.\n * @param key The public key from the Discord developer dashboard, generated by {@link makeKey}\n */\nexport async function verifyBody(body: string, signature: string | string[], timestamp: string | string[], key: Key) {\n\tconst signatureData = Buffer.from(headerToString(signature), 'hex');\n\tconst data = Buffer.isBuffer(body)\n\t\t? Buffer.concat([Buffer.from(headerToString(timestamp)), body])\n\t\t: Buffer.from(`${headerToString(timestamp)}${body}`);\n\n\treturn webcrypto.subtle.verify(AlgorithmName, key, signatureData, Buffer.from(data));\n}\n","import { container } from '@sapphire/pieces';\nimport { err, ok, type Result } from '@sapphire/result';\nimport { isNullishOrEmpty } from '@sapphire/utilities';\nimport type { IncomingMessage } from 'node:http';\nimport { TextDecoder } from 'node:util';\nimport { ErrorMessages } from './constants.js';\n\n/**\n * Safely reads the {@link IncomingMessage incoming message}'s body as a string.\n * @param request The incoming message to get the data from.\n * @returns The string, if it's within the body size limit.\n */\nexport async function getSafeTextBody(request: IncomingMessage): Promise<Result.Err<string> | Result.Ok<string>> {\n\tlet limit = container.client.bodySizeLimit;\n\n\t// Validate the Content-Length header:\n\tif (!isNullishOrEmpty(request.headers['content-length'])) {\n\t\tconst parsed = Number(request.headers['content-length']);\n\t\tif (!Number.isSafeInteger(parsed)) return err(ErrorMessages.InvalidContentLengthInteger);\n\t\tif (parsed <= 0) return err(ErrorMessages.InvalidContentLengthNegative);\n\t\tif (parsed > limit) return err(ErrorMessages.InvalidContentLengthTooBig);\n\n\t\t// If it's a valid length, set the limit to it.\n\t\tlimit = parsed;\n\t}\n\n\tconst decoder = new TextDecoder();\n\n\tlet output = '';\n\tfor await (const chunk of request) {\n\t\tconst part = typeof chunk === 'string' ? chunk : decoder.decode(chunk, { stream: true });\n\t\tif (part.length + output.length > limit) return err(ErrorMessages.InvalidBodySize);\n\n\t\toutput += part;\n\t}\n\n\t// Flush the streaming TextDecoder so that any pending\n\t// incomplete multibyte characters are handled.\n\tconst part = decoder.decode(undefined, { stream: false });\n\tif (part.length + output.length > limit) return err(ErrorMessages.InvalidBodySize);\n\n\toutput += part;\n\treturn ok(output);\n}\n","import { REST, type RESTOptions } from '@discordjs/rest';\nimport { container } from '@sapphire/pieces';\nimport { isNullishOrEmpty } from '@sapphire/utilities';\nimport { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';\nimport { InteractionType, type APIInteraction, type APIPrimaryEntryPointCommandInteraction } from 'discord-api-types/v10';\nimport { createServer, type IncomingMessage, type Server, type ServerOptions, type ServerResponse } from 'node:http';\nimport type { ListenOptions as NetListenOptions } from 'node:net';\nimport type { MappedClientEvents } from './ClientEvents.js';\nimport { HttpCodes } from './api/HttpCodes.js';\nimport type { IIdParser } from './components/IIdParser.js';\nimport { StringIdParser } from './components/StringIdParser.js';\nimport type { ApplicationCommandRegistry, RequestAuthPrefix } from './interactions/shared/ApplicationCommandRegistry.js';\nimport { PluginManager } from './plugins/PluginManager.js';\nimport type { Plugin } from './plugins/Plugin.js';\nimport { CommandStore } from './structures/CommandStore.js';\nimport { InteractionHandlerStore } from './structures/InteractionHandlerStore.js';\nimport { ListenerStore } from './structures/ListenerStore.js';\nimport { PluginHook } from './types/Enums.js';\nimport { ErrorMessages, Payloads } from './utils/constants.js';\nimport { makeKey, verifyBody, type Key } from './utils/security.js';\nimport { getSafeTextBody } from './utils/streams.js';\n\ncontainer.stores.register(new CommandStore());\ncontainer.stores.register(new InteractionHandlerStore());\ncontainer.stores.register(new ListenerStore());\n\nexport class Client extends AsyncEventEmitter<MappedClientEvents> {\n\tpublic server!: Server;\n\tpublic readonly id: string;\n\tpublic readonly options: ClientOptions;\n\tpublic readonly bodySizeLimit: number;\n\tpublic readonly httpReplyOnError: boolean;\n\t#discordPublicKey: string;\n\n\tpublic constructor(options: ClientOptions = {}) {\n\t\tsuper();\n\n\t\t// Persist the options without the Discord credentials: the token and public key are consumed\n\t\t// during construction (the token is handed to `container.rest`, the public key is hashed into\n\t\t// `#discordPublicKey`). Storing the sanitized copy first lets every lifecycle hook receive the\n\t\t// same credential-free options, so neither this public field nor the plugin hooks retain or\n\t\t// observe secrets for the lifetime of the client.\n\t\tthis.options = { ...options, discordToken: undefined, discordPublicKey: undefined };\n\n\t\tfor (const plugin of Client.plugins.values(PluginHook.PreGenericsInitialization)) {\n\t\t\tplugin.hook.call(this, this.options);\n\t\t\tthis.emit('pluginLoaded', plugin.type, plugin.name);\n\t\t}\n\n\t\tfor (const plugin of Client.plugins.values(PluginHook.PreInitialization)) {\n\t\t\tplugin.hook.call(this, this.options);\n\t\t\tthis.emit('pluginLoaded', plugin.type, plugin.name);\n\t\t}\n\n\t\tthis.bodySizeLimit = options.bodySizeLimit ?? 1024 * 1024;\n\t\tthis.httpReplyOnError = options.httpReplyOnError ?? true;\n\n\t\tconst discordPublicKey = options.discordPublicKey ?? process.env.DISCORD_PUBLIC_KEY;\n\t\tif (!discordPublicKey) throw new Error('The discordPublicKey cannot be empty');\n\t\tthis.#discordPublicKey = discordPublicKey;\n\n\t\tcontainer.rest = new REST(options.restOptions);\n\t\tconst token = options.discordToken ?? process.env.DISCORD_TOKEN;\n\t\tif (!token) throw new Error('The discordToken cannot be empty');\n\n\t\tthis.id = options.clientId ?? process.env.DISCORD_CLIENT_ID ?? Buffer.from(token.split('.')[0], 'base64').toString();\n\n\t\tcontainer.client = this;\n\t\tcontainer.rest.setToken(token);\n\t\tcontainer.idParser ??= new StringIdParser();\n\t\tcontainer.applicationCommandRegistry.setup({\n\t\t\tclientId: this.id,\n\t\t\trest: container.rest,\n\t\t\tauthPrefix: options.authPrefix\n\t\t});\n\n\t\tfor (const plugin of Client.plugins.values(PluginHook.PostInitialization)) {\n\t\t\tplugin.hook.call(this, this.options);\n\t\t\tthis.emit('pluginLoaded', plugin.type, plugin.name);\n\t\t}\n\t}\n\n\t/**\n\t * The plugin manager, holding every registered plugin hook.\n\t *\n\t * @since 2.4.0\n\t */\n\tpublic static readonly plugins = new PluginManager();\n\n\t/**\n\t * Registers a plugin onto the {@link Client}, applying all of its hooks.\n\t *\n\t * @since 2.4.0\n\t * @param plugin The plugin to register.\n\t */\n\tpublic static use(plugin: typeof Plugin) {\n\t\tthis.plugins.use(plugin);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Gets the application command registry.\n\t *\n\t * @since 2.0.0\n\t * @returns The application command registry.\n\t */\n\tpublic get registry() {\n\t\treturn container.applicationCommandRegistry;\n\t}\n\n\t/**\n\t * Loads all the commands.\n\t * @param options The load options.\n\t */\n\tpublic async load(options: LoadOptions = {}) {\n\t\tfor (const plugin of Client.plugins.values(PluginHook.PreLoad)) {\n\t\t\tawait plugin.hook.call(this, this.options);\n\t\t\tthis.emit('pluginLoaded', plugin.type, plugin.name);\n\t\t}\n\n\t\t// Register the user directory if not null:\n\t\tif (options.baseUserDirectory !== null) {\n\t\t\tcontainer.stores.registerPath(options.baseUserDirectory);\n\t\t}\n\n\t\tawait container.stores.load();\n\t}\n\n\t/**\n\t * Starts the HTTP server, listening for HTTP interactions.\n\t * @param options The listen options.\n\t */\n\tpublic async listen({ serverOptions, postPath, port, address, ...listenOptions }: ListenOptions) {\n\t\tconst key = await makeKey(this.#discordPublicKey);\n\t\tconst path = postPath ?? process.env.HTTP_POST_PATH ?? '/';\n\n\t\tthis.server = createServer(serverOptions ?? {});\n\t\tthis.server.on('request', (request, response) => void this.handleRawHttpMessage(request, response, path, key));\n\n\t\tawait new Promise<void>((resolve) => this.server.listen({ ...listenOptions, port, host: address }, resolve));\n\n\t\ttry {\n\t\t\tfor (const plugin of Client.plugins.values(PluginHook.PostListen)) {\n\t\t\t\tawait plugin.hook.call(this, this.options);\n\t\t\t\tthis.emit('pluginLoaded', plugin.type, plugin.name);\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// A postListen hook failed: close the server we just opened so it does not stay bound to the\n\t\t\t// port as an orphaned listener, then propagate the original error to the caller.\n\t\t\tawait new Promise<void>((resolve) => this.server.close(() => resolve()));\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprotected async handleRawHttpMessage(request: IncomingMessage, response: ServerResponse, path: string, key: Key) {\n\t\tresponse.setHeader('Content-Type', 'application/json');\n\n\t\tif (request.url !== path) {\n\t\t\tresponse.statusCode = HttpCodes.NotFound;\n\t\t\treturn response.end(ErrorMessages.NotFound);\n\t\t}\n\n\t\tif (request.method !== 'POST') {\n\t\t\tresponse.statusCode = HttpCodes.MethodNotAllowed;\n\t\t\treturn response.end(ErrorMessages.UnsupportedHttpMethod);\n\t\t}\n\n\t\tconst signature = request.headers['x-signature-ed25519'];\n\t\tconst timestamp = request.headers['x-signature-timestamp'];\n\n\t\tif (isNullishOrEmpty(signature) || isNullishOrEmpty(timestamp)) {\n\t\t\tresponse.statusCode = HttpCodes.Unauthorized;\n\t\t\treturn response.end(ErrorMessages.MissingSignatureInformation);\n\t\t}\n\n\t\tconst result = await getSafeTextBody(request);\n\t\tif (result.isErr()) {\n\t\t\tresponse.statusCode = HttpCodes.BadRequest;\n\t\t\treturn response.end(result.unwrapErr());\n\t\t}\n\n\t\tconst body = result.unwrap();\n\t\tconst valid = await verifyBody(body, signature, timestamp, key);\n\t\tif (!valid) {\n\t\t\tresponse.statusCode = HttpCodes.Unauthorized;\n\t\t\treturn response.end(ErrorMessages.InvalidSignature);\n\t\t}\n\n\t\treturn this.handleHttpMessage(JSON.parse(body) as Exclude<APIInteraction, APIPrimaryEntryPointCommandInteraction>, response);\n\t}\n\n\tprotected async handleHttpMessage(\n\t\tinteraction: Exclude<APIInteraction, APIPrimaryEntryPointCommandInteraction>,\n\t\tresponse: ServerResponse\n\t): Promise<ServerResponse> {\n\t\tif (interaction.type === InteractionType.Ping) {\n\t\t\tresponse.statusCode = HttpCodes.OK;\n\t\t\treturn response.end(Payloads.Pong);\n\t\t}\n\n\t\tswitch (interaction.type) {\n\t\t\tcase InteractionType.ApplicationCommand:\n\t\t\t\treturn container.stores.get('commands').runApplicationCommand(response, interaction);\n\t\t\tcase InteractionType.ApplicationCommandAutocomplete:\n\t\t\t\treturn container.stores.get('commands').runApplicationCommandAutocomplete(response, interaction);\n\t\t\tcase InteractionType.MessageComponent:\n\t\t\tcase InteractionType.ModalSubmit:\n\t\t\t\treturn container.stores.get('interaction-handlers').runHandler(response, interaction);\n\t\t\tdefault: {\n\t\t\t\tresponse.statusCode = HttpCodes.NotImplemented;\n\t\t\t\treturn response.end(ErrorMessages.UnknownInteractionType);\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport interface ClientOptions {\n\t/**\n\t * The public key from Discord, available under \"General Information\" after opening an application from\n\t * [Discord's applications](https://discord.com/developers/applications).\n\t *\n\t * @default process.env.DISCORD_PUBLIC_KEY\n\t */\n\tdiscordPublicKey?: string;\n\n\t/**\n\t * The Discord token used for authenticating requests outside of interaction responses.\n\t *\n\t * @default process.env.DISCORD_TOKEN\n\t */\n\tdiscordToken?: string;\n\n\t/**\n\t * The options to be passed to the underlying REST library.\n\t */\n\trestOptions?: Partial<RESTOptions>;\n\n\t/**\n\t * The body size limit in bytes.\n\t * @default 1024 * 1024 // (1 MiB)\n\t */\n\tbodySizeLimit?: number;\n\n\t/**\n\t * Whether to reply with a 500 status code to Discord if an error occurs while processing an interaction.\n\t * @default true\n\t */\n\thttpReplyOnError?: boolean;\n\n\t/**\n\t * The ID of the client.\n\t *\n\t * @default process.env.DISCORD_CLIENT_ID ?? Buffer.from(token.split('.')[0], 'base64').toString()\n\t */\n\tclientId?: string;\n\n\t/**\n\t * The prefix to use for authentication in REST calls.\n\t * @default 'Bot'\n\t * @since 2.0.0\n\t */\n\tauthPrefix?: RequestAuthPrefix;\n}\n\nexport interface LoadOptions {\n\t/**\n\t * The base user directory, if set to `null`, the library will not call {@link StoreRegistry.registerPath},\n\t * meaning that you will need to manually set each folder for each store. Please read the aforementioned method's\n\t * documentation for more information.\n\t */\n\tbaseUserDirectory?: string | null;\n}\n\nexport interface ListenOptions extends Omit<NetListenOptions, 'path' | 'readableAll' | 'writableAll'> {\n\t/**\n\t * The port at which the server will listen for requests.\n\t */\n\tport: number;\n\n\t/**\n\t * The address at which the server will be started.\n\t */\n\taddress?: string;\n\n\t/**\n\t * The path the HTTP server will listen to.\n\t * @default process.env.HTTP_POST_PATH ?? '/'\n\t */\n\tpostPath?: `/${string}`;\n\n\t/**\n\t * The options to pass to the `createServer` function.\n\t */\n\tserverOptions?: ServerOptions;\n}\n\nexport namespace Client {\n\texport type Options = ClientOptions;\n\texport type PieceLoadOptions = LoadOptions;\n\texport type ServerListenOptions = ListenOptions;\n}\n\ndeclare module '@sapphire/pieces' {\n\texport interface StoreRegistryEntries {\n\t\tcommands: CommandStore;\n\t\t'interaction-handlers': InteractionHandlerStore;\n\t\tlisteners: ListenerStore;\n\t}\n\n\texport interface Container {\n\t\tclient: Client;\n\t\tidParser: IIdParser;\n\t\trest: REST;\n\t\tapplicationCommandRegistry: ApplicationCommandRegistry;\n\t}\n}\n","import type { Awaitable } from '@sapphire/utilities';\nimport type { Client, ClientOptions } from '../Client.js';\nimport { postInitialization, postListen, preGenericsInitialization, preInitialization, preLoad } from './symbols.js';\n\n/**\n * The base class for all plugins. Plugins hook into the {@link Client}'s lifecycle by defining static\n * methods keyed by the plugin symbols. Use {@link PluginManager.use} (via `Client.use`) to register a plugin.\n *\n * @since 2.4.0\n */\nexport abstract class Plugin {\n\tpublic static [preGenericsInitialization]?: (this: Client, options: ClientOptions) => void;\n\tpublic static [preInitialization]?: (this: Client, options: ClientOptions) => void;\n\tpublic static [postInitialization]?: (this: Client, options: ClientOptions) => void;\n\tpublic static [preLoad]?: (this: Client, options: ClientOptions) => Awaitable<void>;\n\tpublic static [postListen]?: (this: Client, options: ClientOptions) => Awaitable<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAY,YAAL;;;;;;;;CAQN;;;;;CAMA;;;;;;CAOA;;;;;;CAOA;;;;;CAMA;;;;;CAMA;;;;;;;CAQA;;;;;;CAOA;;;;;;CAOA;;;;;;CAOA;;;;;;;;CASA;;;;CAKA;;;;;;;;;;;;CAaA;;;;;;;CAQA;;;;;;;CAQA;;;;;;;CAQA;;;;;CAKA;;;;;;;;CASA;;;;;;;CAQA;;;;;;CAOA;;;;;;;;;;CAWA;;;;;;;;;;;;CAaA;;;;;;;;;;;CAYA;;;;;CAMA;;;;;;CAOA;;;;;CAMA;;;;CAKA;;;;;;;CAQA;;;;;;CAOA;;;;;;;;;;CAWA;;;;;CAMA;;;;;CAMA;;;;;CAMA;;;;;;;CAQA;;;;;;CAOA;;;;;;;CAQA;;;;;CAMA;;;;;;;;;CAUA;;;;;;;CAQA;;;;;CAMA;;;;;CAMA;;;;CAKA;;;;;CAMA;;;;;CAMA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