feat(MessageSelectMenu): droppybois (#5692)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
monbrey
2021-06-25 07:25:16 +10:00
committed by GitHub
parent d984ac9d09
commit e5fcf0bee5
11 changed files with 336 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
'use strict';
const Base = require('./Base');
const { InteractionTypes } = require('../util/Constants');
const { InteractionTypes, MessageComponentTypes } = require('../util/Constants');
const SnowflakeUtil = require('../util/SnowflakeUtil');
/**
@@ -114,7 +114,7 @@ class Interaction extends Base {
}
/**
* Indicates whether this interaction is a component interaction.
* Indicates whether this interaction is a message component interaction.
* @returns {boolean}
*/
isMessageComponent() {
@@ -126,7 +126,21 @@ class Interaction extends Base {
* @returns {boolean}
*/
isButton() {
return InteractionTypes[this.type] === InteractionTypes.MESSAGE_COMPONENT && this.componentType === 'BUTTON';
return (
InteractionTypes[this.type] === InteractionTypes.MESSAGE_COMPONENT &&
MessageComponentTypes[this.componentType] === MessageComponentTypes.BUTTON
);
}
/**
* Indicates whether this interaction is a select menu interaction.
* @returns {boolean}
*/
isSelectMenu() {
return (
InteractionTypes[this.type] === InteractionTypes.MESSAGE_COMPONENT &&
MessageComponentTypes[this.componentType] === MessageComponentTypes.SELECT_MENU
);
}
}