Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
default_permission -> defaultPermission (abalabahaha#1325)
Browse files Browse the repository at this point in the history
  • Loading branch information
DonovanDMC committed Jan 17, 2022
1 parent b9fabe3 commit 791be08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 8 additions & 4 deletions lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ class Client extends EventEmitter {
* @arg {String} [command.description] The command description (Slash Commands Only)
* @arg {Array<Object>} [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<Object>} Resolves with a commands object
*/
createCommand(command) {
Expand All @@ -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);
}

Expand Down Expand Up @@ -622,7 +623,7 @@ class Client extends EventEmitter {
* @arg {String} [command.description] The command description (Slash Commands Only)
* @arg {Array<Object>} [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<Object>} Resolves with a commands object
*/
createGuildCommand(guildID, command) {
Expand All @@ -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);
}

Expand Down Expand Up @@ -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<Object>} [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<Object>} Resolves with a commands object
*/
editCommand(commandID, command) {
Expand All @@ -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);
}

Expand Down Expand Up @@ -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<Object>} [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<Object>} Resolves with a commands object
*/
editGuildCommand(guildID, commandID, command) {
Expand All @@ -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);
}

Expand Down

0 comments on commit 791be08

Please sign in to comment.