Skip to content

Commit

Permalink
feat(ApplicationCommand): add version property (#6603)
Browse files Browse the repository at this point in the history
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
  • Loading branch information
iShibi and kyranet committed Sep 9, 2021
1 parent 8cc3885 commit f866512
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/structures/ApplicationCommand.js
Expand Up @@ -77,6 +77,12 @@ class ApplicationCommand extends Base {
* @type {boolean}
*/
this.defaultPermission = data.default_permission;

/**
* Autoincrementing version identifier updated during substantial record changes
* @type {Snowflake}
*/
this.version = data.version;
}

/**
Expand Down Expand Up @@ -174,6 +180,7 @@ class ApplicationCommand extends Base {
if (
command.name !== this.name ||
('description' in command && command.description !== this.description) ||
('version' in command && command.version !== this.version) ||
(commandType && commandType !== this.type) ||
// Future proof for options being nullable
// TODO: remove ?? 0 on each when nullable
Expand Down
1 change: 1 addition & 0 deletions typings/index.d.ts
Expand Up @@ -218,6 +218,7 @@ export class ApplicationCommand<PermissionsFetchType = {}> extends Base {
Snowflake
>;
public type: ApplicationCommandType;
public version: Snowflake;
public delete(): Promise<ApplicationCommand<PermissionsFetchType>>;
public edit(data: ApplicationCommandData): Promise<ApplicationCommand<PermissionsFetchType>>;
public equals(
Expand Down

0 comments on commit f866512

Please sign in to comment.