feat: general component improvements (#5787)

This commit is contained in:
monbrey
2021-06-09 22:59:12 +10:00
committed by GitHub
parent 0156f693e0
commit c4f1c75efa
18 changed files with 111 additions and 48 deletions

View File

@@ -120,6 +120,14 @@ class Interaction extends Base {
isMessageComponent() {
return InteractionTypes[this.type] === InteractionTypes.MESSAGE_COMPONENT;
}
/**
* Indicates whether this interaction is a button interaction.
* @returns {boolean}
*/
isButton() {
return InteractionTypes[this.type] === InteractionTypes.MESSAGE_COMPONENT && this.componentType === 'BUTTON';
}
}
module.exports = Interaction;