mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 04:53:30 +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}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
this.defaultPermission = data.default_permission;
|
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 (
|
if (
|
||||||
command.name !== this.name ||
|
command.name !== this.name ||
|
||||||
('description' in command && command.description !== this.description) ||
|
('description' in command && command.description !== this.description) ||
|
||||||
|
('version' in command && command.version !== this.version) ||
|
||||||
(commandType && commandType !== this.type) ||
|
(commandType && commandType !== this.type) ||
|
||||||
// Future proof for options being nullable
|
// Future proof for options being nullable
|
||||||
// TODO: remove ?? 0 on each when 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
|
Snowflake
|
||||||
>;
|
>;
|
||||||
public type: ApplicationCommandType;
|
public type: ApplicationCommandType;
|
||||||
|
public version: Snowflake;
|
||||||
public delete(): Promise<ApplicationCommand<PermissionsFetchType>>;
|
public delete(): Promise<ApplicationCommand<PermissionsFetchType>>;
|
||||||
public edit(data: ApplicationCommandData): Promise<ApplicationCommand<PermissionsFetchType>>;
|
public edit(data: ApplicationCommandData): Promise<ApplicationCommand<PermissionsFetchType>>;
|
||||||
public equals(
|
public equals(
|
||||||
|
|||||||
Reference in New Issue
Block a user