Skip to content

Commit

Permalink
Add USE_EXTERNAL_APPS permission (#2950)
Browse files Browse the repository at this point in the history
This adds Discord's new permission `USE_EXTERNAL_APPS` at bit 50.
  • Loading branch information
HiccupEnthusiast committed Sep 13, 2024
1 parent 3fb1f37 commit d3665b7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/model/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ bitflags::bitflags! {
const SET_VOICE_CHANNEL_STATUS = 1 << 48;
/// Allows attaching polls to message sends.
const SEND_POLLS = 1 << 49;
/// Allows user-installed apps to send public responses.
const USE_EXTERNAL_APPS = 1 << 50;
}
}

Expand Down Expand Up @@ -810,6 +812,14 @@ impl Permissions {
pub const fn send_polls(self) -> bool {
self.contains(Self::SEND_POLLS)
}
/// Shorthand for checking that the set of permissions contains the [Use External Apps]
/// permission.
///
/// [Use External Apps]: Self::USE_EXTERNAL_APPS
#[must_use]
pub const fn use_external_apps(self) -> bool {
self.contains(Self::USE_EXTERNAL_APPS)
}
}

// Manual impl needed because Permissions are usually sent as a stringified integer,
Expand Down

0 comments on commit d3665b7

Please sign in to comment.