diff --git a/index.d.ts b/index.d.ts index 552933d8d..7dde38a43 100644 --- a/index.d.ts +++ b/index.d.ts @@ -200,7 +200,7 @@ declare namespace Eris { description: T extends Constants["ApplicationCommandTypes"]["CHAT_INPUT"] ? string : never; options?: ApplicationCommandOption[]; type: T; - default_permission?: boolean; + defaultPermission?: boolean; } type AnyApplicationCommand = ChatInputApplicationCommand | MessageApplicationCommand | UserApplicationCommand; diff --git a/lib/Client.js b/lib/Client.js index 3e9184f93..d8e5e6508 100644 --- a/lib/Client.js +++ b/lib/Client.js @@ -552,7 +552,7 @@ class Client extends EventEmitter { * @arg {String} [command.description] The command description (Slash Commands Only) * @arg {Array} [command.options] An array of [command options](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure) * @arg {Number} [command.type] The type of application command, 1 for slash command, 2 for user, and 3 for message - * @arg {Boolean} [command.default_permission=true] Whether the command is enabled by default when the app is added to a guild + * @arg {Boolean} [command.defaultPermission=true] Whether the command is enabled by default when the app is added to a guild * @returns {Promise} Resolves with a commands object */ createCommand(command) { @@ -565,6 +565,7 @@ class Client extends EventEmitter { } } + command.default_permission = command.defaultPermission; return this.requestHandler.request("POST", Endpoints.COMMANDS(this.application.id), true, command); } @@ -622,7 +623,7 @@ class Client extends EventEmitter { * @arg {String} [command.description] The command description (Slash Commands Only) * @arg {Array} [command.options] An array of [command options](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure) * @arg {Number} [command.type] The type of application command, 1 for slash command, 2 for user, and 3 for message - * @arg {Boolean} [command.default_permission=true] Whether the command is enabled by default when the app is added to a guild + * @arg {Boolean} [command.defaultPermission=true] Whether the command is enabled by default when the app is added to a guild * @returns {Promise} Resolves with a commands object */ createGuildCommand(guildID, command) { @@ -635,6 +636,7 @@ class Client extends EventEmitter { } } + command.default_permission = command.defaultPermission; return this.requestHandler.request("POST", Endpoints.GUILD_COMMANDS(this.application.id, guildID), true, command); } @@ -1337,7 +1339,7 @@ class Client extends EventEmitter { * @arg {String} command.name The command name * @arg {String} [command.description] The command description (Slash Commands Only) * @arg {Array} [command.options] An array of [command options](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure) - * @arg {Boolean} [command.default_permission] Whether the command is enabled by default when the app is added to a guild + * @arg {Boolean} [command.defaultPermission] Whether the command is enabled by default when the app is added to a guild * @returns {Promise} Resolves with a commands object */ editCommand(commandID, command) { @@ -1352,6 +1354,7 @@ class Client extends EventEmitter { } } } + command.default_permission = command.defaultPermission; return this.requestHandler.request("PATCH", Endpoints.COMMAND(this.application.id, commandID), true, command); } @@ -1429,7 +1432,7 @@ class Client extends EventEmitter { * @arg {String} command.name The command name * @arg {String} [command.description] The command description (Slash Commands Only) * @arg {Array} [command.options] An array of [command options](https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure) - * @arg {Boolean} [command.default_permission] Whether the command is enabled by default when the app is added to a guild + * @arg {Boolean} [command.defaultPermission] Whether the command is enabled by default when the app is added to a guild * @returns {Promise} Resolves with a commands object */ editGuildCommand(guildID, commandID, command) { @@ -1444,6 +1447,7 @@ class Client extends EventEmitter { } } } + command.default_permission = command.defaultPermission; return this.requestHandler.request("PATCH", Endpoints.GUILD_COMMAND(this.application.id, guildID, commandID), true, command); }