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

@@ -2,7 +2,7 @@
const Base = require('./Base');
const ApplicationCommandPermissionsManager = require('../managers/ApplicationCommandPermissionsManager');
const { ApplicationCommandOptionTypes } = require('../util/Constants');
const { ApplicationCommandOptionTypes, ApplicationCommandTypes } = require('../util/Constants');
const SnowflakeUtil = require('../util/SnowflakeUtil');
/**
@@ -44,6 +44,12 @@ class ApplicationCommand extends Base {
*/
this.permissions = new ApplicationCommandPermissionsManager(this);
/**
* The type of this application command
* @type {ApplicationCommandType}
*/
this.type = ApplicationCommandTypes[data.type];
this._patch(data);
}
@@ -105,6 +111,7 @@ class ApplicationCommand extends Base {
* @typedef {Object} ApplicationCommandData
* @property {string} name The name of the command
* @property {string} description The description of the command
* @property {ApplicationCommandTypes} [type] The type of the command
* @property {ApplicationCommandOptionData[]} [options] Options for the command
* @property {boolean} [defaultPermission] Whether the command is enabled by default when the app is added to a guild
*/