mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
feat(ApplicationCommand): add setX methods for easier editing (#7063)
Co-authored-by: awned <65061212+ceilingfans@users.noreply.github.com>
This commit is contained in:
@@ -170,6 +170,42 @@ class ApplicationCommand extends Base {
|
||||
return this.manager.edit(this, data, this.guildId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Edits the name of this ApplicationCommand
|
||||
* @param {string} name The new name of the command
|
||||
* @returns {Promise<ApplicationCommand>}
|
||||
*/
|
||||
setName(name) {
|
||||
return this.edit({ name });
|
||||
}
|
||||
|
||||
/**
|
||||
* Edits the description of this ApplicationCommand
|
||||
* @param {string} description The new description of the command
|
||||
* @returns {Promise<ApplicationCommand>}
|
||||
*/
|
||||
setDescription(description) {
|
||||
return this.edit({ description });
|
||||
}
|
||||
|
||||
/**
|
||||
* Edits the default permission of this ApplicationCommand
|
||||
* @param {boolean} [defaultPermission=true] The default permission for this command
|
||||
* @returns {Promise<ApplicationCommand>}
|
||||
*/
|
||||
setDefaultPermission(defaultPermission = true) {
|
||||
return this.edit({ defaultPermission });
|
||||
}
|
||||
|
||||
/**
|
||||
* Edits the options of this ApplicationCommand
|
||||
* @param {ApplicationCommandOptionData[]} options The options to set for this command
|
||||
* @returns {Promise<ApplicationCommand>}
|
||||
*/
|
||||
setOptions(options) {
|
||||
return this.edit({ options });
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes this command.
|
||||
* @returns {Promise<ApplicationCommand>}
|
||||
|
||||
Reference in New Issue
Block a user