mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user