@globalart/nestcord
Version:
A module for creating Discord bots using NestJS, based on Discord.js
38 lines (37 loc) • 917 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContextMenuDiscovery = void 0;
const command_discovery_1 = require("../command.discovery");
/**
* The context menu discovery.
* @see CommandDiscovery
* @see ContextMenuMeta
*/
class ContextMenuDiscovery extends command_discovery_1.CommandDiscovery {
/**
* Gets the discovery type.
*/
getType() {
return this.meta.type;
}
/**
* Type guard for the context menu discovery.
*/
isContextMenu() {
return true;
}
/**
* Executes the context menu discovery.
* @param interaction The interaction to execute.
*/
execute(interaction) {
return super.execute([interaction]);
}
/**
* Converts the context menu discovery to JSON.
*/
toJSON() {
return this.meta;
}
}
exports.ContextMenuDiscovery = ContextMenuDiscovery;