Skip to content

Commit

Permalink
Add the VIEW_AUDIT_LOG permission (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakelezz authored and arqunis committed Dec 4, 2017
1 parent 56b7288 commit 612e973
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 @@ -189,6 +189,8 @@ bitflags! {
/// [`Message`]: ../struct.Message.html
/// [`Reaction`]: ../struct.Reaction.html
const ADD_REACTIONS = 0b0000_0000_0000_0000_0000_0000_0100_0000;
// Allows viewing a guild's audit logs.
const VIEW_AUDIT_LOG = 0b0000_0000_0000_0000_0000_0000_1000_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.
const READ_MESSAGES = 0b0000_0000_0000_0000_0000_0100_0000_0000;
Expand Down Expand Up @@ -291,6 +293,12 @@ impl Permissions {
/// [Connect]: constant.CONNECT.html
pub fn connect(&self) -> bool { self.contains(Self::CONNECT) }

/// Shorthand for checking that the set of permissions contains the
/// [View Audit Log] permission.
///
/// [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 permissions contains the
/// [Create Invite] permission.
///
Expand Down

0 comments on commit 612e973

Please sign in to comment.