Downgrade to v13

[vi] cảm giác đau khổ
This commit is contained in:
March 7th
2022-03-24 17:55:32 +07:00
parent 9596b1a210
commit 7dfdef46a5
218 changed files with 8584 additions and 9108 deletions

View File

@@ -3,6 +3,7 @@
const Interaction = require('./Interaction');
const InteractionWebhook = require('./InteractionWebhook');
const InteractionResponses = require('./interfaces/InteractionResponses');
const { MessageComponentTypes } = require('../util/Constants');
/**
* Represents a message component interaction.
@@ -33,9 +34,9 @@ class MessageComponentInteraction extends Interaction {
/**
* The type of component which was interacted with
* @type {ComponentType}
* @type {string}
*/
this.componentType = data.data.component_type;
this.componentType = MessageComponentInteraction.resolveType(data.data.component_type);
/**
* Whether the reply to this interaction has been deferred
@@ -80,6 +81,16 @@ class MessageComponentInteraction extends Interaction {
.find(component => (component.customId ?? component.custom_id) === this.customId);
}
/**
* Resolves the type of a MessageComponent
* @param {MessageComponentTypeResolvable} type The type to resolve
* @returns {MessageComponentType}
* @private
*/
static resolveType(type) {
return typeof type === 'string' ? type : MessageComponentTypes[type];
}
// These are here only for documentation purposes - they are implemented by InteractionResponses
/* eslint-disable no-empty-function */
deferReply() {}
@@ -105,28 +116,3 @@ module.exports = MessageComponentInteraction;
* @external APIMessageButton
* @see {@link https://discord.com/developers/docs/interactions/message-components#button-object}
*/
/**
* @external ButtonComponent
* @see {@link https://discord.js.org/#/docs/builders/main/class/ButtonComponent}
*/
/**
* @external SelectMenuComponent
* @see {@link https://discord.js.org/#/docs/builders/main/class/SelectMenuComponent}
*/
/**
* @external SelectMenuOption
* @see {@link https://discord.js.org/#/docs/builders/main/class/SelectMenuComponent}
*/
/**
* @external ActionRow
* @see {@link https://discord.js.org/#/docs/builders/main/class/ActionRow}
*/
/**
* @external Embed
* @see {@link https://discord.js.org/#/docs/builders/main/class/Embed}
*/