Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new use external apps guild permission #2950

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading