diff options
| author | Lakelezz <[email protected]> | 2017-12-04 13:35:14 +0100 |
|---|---|---|
| committer | alex <[email protected]> | 2017-12-04 13:35:14 +0100 |
| commit | 612e973f286ba6b711824333551b07b88df6740c (patch) | |
| tree | bc6d220a57aea14578bae23e29ca5f4cacc50f4a /src/model | |
| parent | Tune down repetition with a macro (diff) | |
| download | serenity-612e973f286ba6b711824333551b07b88df6740c.tar.xz serenity-612e973f286ba6b711824333551b07b88df6740c.zip | |
Add the `VIEW_AUDIT_LOG` permission (#229)
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/permissions.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/model/permissions.rs b/src/model/permissions.rs index 51aafe5..ef5510b 100644 --- a/src/model/permissions.rs +++ b/src/model/permissions.rs @@ -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; @@ -292,6 +294,12 @@ impl Permissions { 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. /// /// [Create Invite]: constant.CREATE_INVITE.html |