feat(CommandInteractionResolvedData): access to "raw" resolved data (#6384)

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
monbrey
2021-08-13 00:04:40 +10:00
committed by GitHub
parent d9456a1a76
commit fff887b2f4
5 changed files with 83 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ const { TypeError } = require('../errors');
* A resolver for command interaction options.
*/
class CommandInteractionOptionResolver {
constructor(client, options) {
constructor(client, options, resolved) {
/**
* The client that instantiated this.
* @name CommandInteractionOptionResolver#client
@@ -55,6 +55,13 @@ class CommandInteractionOptionResolver {
* @readonly
*/
Object.defineProperty(this, 'data', { value: Object.freeze([...options]) });
/**
* The interaction resolved data
* @name CommandInteractionOptionResolver#resolved
* @type {Readonly<CommandInteractionResolvedData>}
*/
Object.defineProperty(this, 'resolved', { value: Object.freeze(resolved) });
}
/**