Skip to content

Commit

Permalink
Add ApplicationCommand::version field (#1490)
Browse files Browse the repository at this point in the history
This commit adds support for the `ApplicationCommand::version` field, as per discord/discord-api-docs#3524.
  • Loading branch information
HarmoGlace committed Sep 5, 2021
1 parent 93d6ab8 commit c85d44a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/model/id.rs
Expand Up @@ -154,6 +154,10 @@ pub struct CommandId(pub u64);
#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)]
pub struct CommandPermissionId(pub u64);

/// An identifier for a slash command version Id.
#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)]
pub struct CommandVersionId(pub u64);

/// An identifier for a slash command target Id. Can contain
/// a [`UserId`] or [`MessageId`].
#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Serialize)]
Expand All @@ -180,6 +184,7 @@ id_u64! {
InteractionId;
CommandId;
CommandPermissionId;
CommandVersionId;
TargetId;
StageInstanceId;
}
2 changes: 2 additions & 0 deletions src/model/interactions/application_command.rs
Expand Up @@ -687,6 +687,8 @@ pub struct ApplicationCommand {
/// the application is added to a guild.
#[serde(default = "self::default_permission_value")]
pub default_permission: bool,
/// An autoincremented version identifier updated during substantial record changes.
pub version: CommandVersionId,
}

impl ApplicationCommand {
Expand Down

0 comments on commit c85d44a

Please sign in to comment.