Skip to content

Commit

Permalink
Added support for the new PRIORITY_SPEAKER permission (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erk- authored and zeyla committed Aug 7, 2018
1 parent 8f128b2 commit 2179623
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/model/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
///
Expand Down

0 comments on commit 2179623

Please sign in to comment.