mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
feat(MessageSelectMenu): droppybois (#5692)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user