feat(ApplicationCommand): add version property (#6603)

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
Shubham Parihar
2021-09-09 22:22:39 +05:30
committed by GitHub
parent 8cc3885739
commit f866512e84
2 changed files with 8 additions and 0 deletions

View File

@@ -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;
}
/**
@@ -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

1
typings/index.d.ts vendored
View File

@@ -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(