diff --git a/src/structures/ApplicationCommand.js b/src/structures/ApplicationCommand.js index a3fb51499e12..ea4558efc71c 100644 --- a/src/structures/ApplicationCommand.js +++ b/src/structures/ApplicationCommand.js @@ -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} + */ + setName(name) { + return this.edit({ name }); + } + + /** + * Edits the description of this ApplicationCommand + * @param {string} description The new description of the command + * @returns {Promise} + */ + 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} + */ + 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} + */ + setOptions(options) { + return this.edit({ options }); + } + /** * Deletes this command. * @returns {Promise} diff --git a/typings/index.d.ts b/typings/index.d.ts index d42d925dc24f..4cdc0473afcd 100644 --- a/typings/index.d.ts +++ b/typings/index.d.ts @@ -226,6 +226,10 @@ export class ApplicationCommand extends Base { public version: Snowflake; public delete(): Promise>; public edit(data: ApplicationCommandData): Promise>; + public setName(name: string): Promise>; + public setDescription(description: string): Promise>; + public setDefaultPermission(defaultPermission?: boolean): Promise>; + public setOptions(options: ApplicationCommandOptionData[]): Promise>; public equals( command: ApplicationCommand | ApplicationCommandData | RawApplicationCommandData, enforceOptionorder?: boolean,