mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(ApplicationCommand): add version property (#6603)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
This commit is contained in:
@@ -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
1
typings/index.d.ts
vendored
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user