aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorErk- <[email protected]>2018-08-07 16:38:50 +0200
committerzeyla <[email protected]>2018-08-07 07:38:50 -0700
commit2179623ebf12f7d8e16cc87e193ecd4de0f7b1fe (patch)
tree201dd8cacc6d56a6f50530daf5efbeb35c155c50 /src/model
parentFix default command upon shortcut prefix and passing sub-commands to default-... (diff)
downloadserenity-2179623ebf12f7d8e16cc87e193ecd4de0f7b1fe.tar.xz
serenity-2179623ebf12f7d8e16cc87e193ecd4de0f7b1fe.zip
Added support for the new PRIORITY_SPEAKER permission (#360)
Diffstat (limited to 'src/model')
-rw-r--r--src/model/permissions.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/model/permissions.rs b/src/model/permissions.rs
index 0076b05..dd95c40 100644
--- a/src/model/permissions.rs
+++ b/src/model/permissions.rs
@@ -196,6 +196,8 @@ __impl_bitflags! {
ADD_REACTIONS = 0b0000_0000_0000_0000_0000_0000_0100_0000;
// Allows viewing a guild's audit logs.
VIEW_AUDIT_LOG = 0b0000_0000_0000_0000_0000_0000_1000_0000;
+ /// Allows the use of priority speaking in voice channels.
+ PRIORITY_SPEAKER = 0b0000_0000_0000_0000_0000_0001_0000_0000;
/// Allows reading messages in a guild channel. If a user does not have
/// this permission, then they will not be able to see the channel.
READ_MESSAGES = 0b0000_0000_0000_0000_0000_0100_0000_0000;
@@ -304,6 +306,12 @@ impl Permissions {
/// [View Audit Log]: constant.VIEW_AUDIT_LOG.html
pub fn view_audit_log(&self) -> bool { self.contains(Self::VIEW_AUDIT_LOG) }
+ /// Shorthand for checking that the set of permission contains the
+ /// [Priority Speaker] permission.
+ ///
+ /// [Priority Speaker]: #associatedconstant.PRIORITY_SPEAKER
+ pub fn priority_speaker(&self) -> bool { self.contains(Self::PRIORITY_SPEAKER) }
+
/// Shorthand for checking that the set of permissions contains the
/// [Create Invite] permission.
///