feat: right-clickybois (context menu support for ApplicationCommand and CommandInteraction) (#6176)

Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
monbrey
2021-08-11 08:56:12 +10:00
committed by GitHub
parent 779e14ef61
commit 0266f28096
12 changed files with 328 additions and 180 deletions

View File

@@ -118,7 +118,15 @@ class Interaction extends Base {
* @returns {boolean}
*/
isCommand() {
return InteractionTypes[this.type] === InteractionTypes.APPLICATION_COMMAND;
return InteractionTypes[this.type] === InteractionTypes.APPLICATION_COMMAND && typeof this.targetId === 'undefined';
}
/**
* Indicates whether this interaction is a {@link ContextMenuInteraction}
* @returns {boolean}
*/
isContextMenu() {
return InteractionTypes[this.type] === InteractionTypes.APPLICATION_COMMAND && typeof this.targetId !== 'undefined';
}
/**