diff options
| author | Leah <[email protected]> | 2018-03-23 13:54:12 +0100 |
|---|---|---|
| committer | alex <[email protected]> | 2018-03-23 13:54:12 +0100 |
| commit | fdcf44e1463e708cd8b612c183e302db9af0febd (patch) | |
| tree | 1a311f26fb38522ba380881fa6e72c0c2e5c54bc /src/model | |
| parent | Fix Create(Embed/Message) to be consistent (diff) | |
| download | serenity-fdcf44e1463e708cd8b612c183e302db9af0febd.tar.xz serenity-fdcf44e1463e708cd8b612c183e302db9af0febd.zip | |
Change the way ids and some enums are made (#295)
This makes them easier to be found by tools like rls.
Also update struct inits to use the shorthand version for `x: x`.
Diffstat (limited to 'src/model')
| -rw-r--r-- | src/model/channel/message.rs | 46 | ||||
| -rw-r--r-- | src/model/channel/mod.rs | 53 | ||||
| -rw-r--r-- | src/model/event.rs | 18 | ||||
| -rw-r--r-- | src/model/gateway.rs | 41 | ||||
| -rw-r--r-- | src/model/guild/mod.rs | 134 | ||||
| -rw-r--r-- | src/model/id.rs | 67 | ||||
| -rw-r--r-- | src/model/permissions.rs | 84 |
7 files changed, 271 insertions, 172 deletions
diff --git a/src/model/channel/message.rs b/src/model/channel/message.rs index eefb633..566107b 100644 --- a/src/model/channel/message.rs +++ b/src/model/channel/message.rs @@ -605,25 +605,37 @@ pub struct MessageReaction { pub reaction_type: ReactionType, } +/// Differentiates between regular and different types of system messages. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +pub enum MessageType { + /// A regular message. + Regular = 0, + /// An indicator that a recipient was added by the author. + GroupRecipientAddition = 1, + /// An indicator that a recipient was removed by the author. + GroupRecipientRemoval = 2, + /// An indicator that a call was started by the author. + GroupCallCreation = 3, + /// An indicator that the group name was modified by the author. + GroupNameUpdate = 4, + /// An indicator that the group icon was modified by the author. + GroupIconUpdate = 5, + /// An indicator that a message was pinned by the author. + PinsAdd = 6, + /// An indicator that a member joined the guild. + MemberJoin = 7, +} + enum_number!( - /// Differentiates between regular and different types of system messages. MessageType { - /// A regular message. - Regular = 0, - /// An indicator that a recipient was added by the author. - GroupRecipientAddition = 1, - /// An indicator that a recipient was removed by the author. - GroupRecipientRemoval = 2, - /// An indicator that a call was started by the author. - GroupCallCreation = 3, - /// An indicator that the group name was modified by the author. - GroupNameUpdate = 4, - /// An indicator that the group icon was modified by the author. - GroupIconUpdate = 5, - /// An indicator that a message was pinned by the author. - PinsAdd = 6, - /// An indicator that a member joined the guild. - MemberJoin = 7, + Regular, + GroupRecipientAddition, + GroupRecipientRemoval, + GroupCallCreation, + GroupNameUpdate, + GroupIconUpdate, + PinsAdd, + MemberJoin, } ); diff --git a/src/model/channel/mod.rs b/src/model/channel/mod.rs index eadc7bb..5487a0b 100644 --- a/src/model/channel/mod.rs +++ b/src/model/channel/mod.rs @@ -555,29 +555,38 @@ impl Display for Channel { } } +/// A representation of a type of channel. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +pub enum ChannelType { + /// An indicator that the channel is a text [`GuildChannel`]. + /// + /// [`GuildChannel`]: struct.GuildChannel.html + Text = 0, + /// An indicator that the channel is a [`PrivateChannel`]. + /// + /// [`PrivateChannel`]: struct.PrivateChannel.html + Private = 1, + /// An indicator that the channel is a voice [`GuildChannel`]. + /// + /// [`GuildChannel`]: struct.GuildChannel.html + Voice = 2, + /// An indicator that the channel is the channel of a [`Group`]. + /// + /// [`Group`]: struct.Group.html + Group = 3, + /// An indicator that the channel is the channel of a [`ChannelCategory`]. + /// + /// [`ChannelCategory`]: struct.ChannelCategory.html + Category = 4, +} + enum_number!( - /// A representation of a type of channel. ChannelType { - #[doc="An indicator that the channel is a text [`GuildChannel`]. - -[`GuildChannel`]: struct.GuildChannel.html"] - Text = 0, - #[doc="An indicator that the channel is a [`PrivateChannel`]. - -[`PrivateChannel`]: struct.PrivateChannel.html"] - Private = 1, - #[doc="An indicator that the channel is a voice [`GuildChannel`]. - -[`GuildChannel`]: struct.GuildChannel.html"] - Voice = 2, - #[doc="An indicator that the channel is the channel of a [`Group`]. - -[`Group`]: struct.Group.html"] - Group = 3, - #[doc="An indicator that the channel is the channel of a [`ChannelCategory`]. - -[`ChannelCategory`]: struct.ChannelCategory.html"] - Category = 4, + Text, + Private, + Voice, + Group, + Category, } ); @@ -633,7 +642,7 @@ impl<'de> Deserialize<'de> for PermissionOverwrite { Ok(PermissionOverwrite { allow: data.allow, deny: data.deny, - kind: kind, + kind, }) } } diff --git a/src/model/event.rs b/src/model/event.rs index cf18995..5f66dac 100644 --- a/src/model/event.rs +++ b/src/model/event.rs @@ -483,7 +483,7 @@ impl<'de> Deserialize<'de> for GuildMemberAddEvent { .map_err(DeError::custom)?; Ok(GuildMemberAddEvent { - guild_id: guild_id, + guild_id, member: Member::deserialize(Value::Object(map)) .map_err(DeError::custom)?, }) @@ -615,8 +615,8 @@ impl<'de> Deserialize<'de> for GuildMembersChunkEvent { Deserialize::deserialize(members).map_err(DeError::custom)?; Ok(GuildMembersChunkEvent { - guild_id: guild_id, - members: members, + guild_id, + members, }) } } @@ -833,7 +833,7 @@ impl CacheUpdate for PresenceUpdateEvent { guild.members.insert(self.presence.user_id, Member { deaf: false, - guild_id: guild_id, + guild_id, joined_at: None, mute: false, nick: self.presence.nick.clone(), @@ -873,9 +873,9 @@ impl<'de> Deserialize<'de> for PresenceUpdateEvent { .map_err(DeError::custom)?; Ok(Self { - guild_id: guild_id, - presence: presence, - roles: roles, + guild_id, + presence, + roles, }) } } @@ -909,7 +909,7 @@ impl<'de> Deserialize<'de> for PresencesReplaceEvent { let presences: Vec<Presence> = Deserialize::deserialize(deserializer)?; Ok(Self { - presences: presences, + presences, }) } } @@ -1141,7 +1141,7 @@ impl<'de> Deserialize<'de> for VoiceStateUpdateEvent { }; Ok(VoiceStateUpdateEvent { - guild_id: guild_id, + guild_id, voice_state: VoiceState::deserialize(Value::Object(map)) .map_err(DeError::custom)?, }) diff --git a/src/model/gateway.rs b/src/model/gateway.rs index 924f27f..e795077 100644 --- a/src/model/gateway.rs +++ b/src/model/gateway.rs @@ -144,22 +144,31 @@ impl<'de> Deserialize<'de> for Game { .and_then(|v| serde_json::from_value::<String>(v).ok()); Ok(Game { - kind: kind, - name: name, - url: url, + kind, + name, + url, }) } } + + +/// The type of activity that is being performed when playing a game. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +pub enum GameType { + /// An indicator that the user is playing a game. + Playing = 0, + /// An indicator that the user is streaming to a service. + Streaming = 1, + /// An indicator that the user is listening to something. + Listening = 2, +} + enum_number!( - /// The type of activity that is being performed when playing a game. GameType { - /// An indicator that the user is playing a game. - Playing = 0, - /// An indicator that the user is streaming to a service. - Streaming = 1, - /// An indicator that the user is listening to something. - Listening = 2, + Playing, + Streaming, + Listening, } ); @@ -255,12 +264,12 @@ impl<'de> Deserialize<'de> for Presence { .map_err(DeError::custom)?; Ok(Presence { - game: game, - last_modified: last_modified, - nick: nick, - status: status, - user: user, - user_id: user_id, + game, + last_modified, + nick, + status, + user, + user_id, }) } } diff --git a/src/model/guild/mod.rs b/src/model/guild/mod.rs index 629c496..9e4d8ef 100644 --- a/src/model/guild/mod.rs +++ b/src/model/guild/mod.rs @@ -1649,30 +1649,30 @@ impl<'de> Deserialize<'de> for Guild { .map_err(DeError::custom)?; Ok(Self { - afk_channel_id: afk_channel_id, - application_id: application_id, - afk_timeout: afk_timeout, - channels: channels, - default_message_notifications: default_message_notifications, - emojis: emojis, - explicit_content_filter: explicit_content_filter, - features: features, - icon: icon, - id: id, - joined_at: joined_at, - large: large, - member_count: member_count, - members: members, - mfa_level: mfa_level, - name: name, - owner_id: owner_id, - presences: presences, - region: region, - roles: roles, - splash: splash, - system_channel_id: system_channel_id, - verification_level: verification_level, - voice_states: voice_states, + afk_channel_id, + application_id, + afk_timeout, + channels, + default_message_notifications, + emojis, + explicit_content_filter, + features, + icon, + id, + joined_at, + large, + member_count, + members, + mfa_level, + name, + owner_id, + presences, + region, + roles, + splash, + system_channel_id, + verification_level, + voice_states, }) } } @@ -1828,13 +1828,19 @@ impl GuildStatus { } } +/// Default message notification level for a guild. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +pub enum DefaultMessageNotificationLevel { + /// Receive notifications for everything. + All = 0, + /// Receive only mentions. + Mentions = 1, +} + enum_number!( - /// Default message notification level for a guild. DefaultMessageNotificationLevel { - /// Receive notifications for everything. - All = 0, - /// Receive only mentions. - Mentions = 1, + All, + Mentions, } ); @@ -1847,15 +1853,22 @@ impl DefaultMessageNotificationLevel { } } +/// Setting used to filter explicit messages from members. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +pub enum ExplicitContentFilter { + /// Don't scan any messages. + None = 0, + /// Scan messages from members without a role. + WithoutRole = 1, + /// Scan messages sent by all members. + All = 2, +} + enum_number!( - /// Setting used to filter explicit messages from members. ExplicitContentFilter { - /// Don't scan any messages. - None = 0, - /// Scan messages from members without a role. - WithoutRole = 1, - /// Scan messages sent by all members. - All = 2, + None, + WithoutRole, + All, } ); @@ -1869,13 +1882,19 @@ impl ExplicitContentFilter { } } +/// Multi-Factor Authentication level for guild moderators. +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +pub enum MfaLevel { + /// MFA is disabled. + None = 0, + /// MFA is enabled. + Elevated = 1, +} + enum_number!( - /// Multi-Factor Authentication level for guild moderators. MfaLevel { - /// MFA is disabled. - None = 0, - /// MFA is enabled. - Elevated = 1, + None, + Elevated, } ); @@ -1936,22 +1955,31 @@ impl Region { } } -enum_number!( - #[doc="The level to set as criteria prior to a user being able to send +#[doc="The level to set as criteria prior to a user being able to send messages in a [`Guild`]. [`Guild`]: struct.Guild.html"] +#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord)] +pub enum VerificationLevel { + /// Does not require any verification. + None = 0, + /// Must have a verified email on the user's Discord account. + Low = 1, + /// Must also be a registered user on Discord for longer than 5 minutes. + Medium = 2, + /// Must also be a member of the guild for longer than 10 minutes. + High = 3, + /// Must have a verified phone on the user's Discord account. + Higher = 4, +} + +enum_number!( VerificationLevel { - /// Does not require any verification. - None = 0, - /// Must have a verified email on the user's Discord account. - Low = 1, - /// Must also be a registered user on Discord for longer than 5 minutes. - Medium = 2, - /// Must also be a member of the guild for longer than 10 minutes. - High = 3, - /// Must have a verified phone on the user's Discord account. - Higher = 4, + None, + Low, + Medium, + High, + Higher, } ); diff --git a/src/model/id.rs b/src/model/id.rs index 3d8c20c..4e2fbc3 100644 --- a/src/model/id.rs +++ b/src/model/id.rs @@ -7,13 +7,8 @@ use std::fmt::{Display, Formatter, Result as FmtResult}; use super::utils::U64Visitor; macro_rules! id_u64 { - ($(#[$attr:meta] $name:ident;)*) => { + ($($name:ident;)*) => { $( - #[$attr] - #[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] - #[allow(derive_hash_xor_eq)] - pub struct $name(pub u64); - impl $name { /// Retrieves the time that the Id was created at. pub fn created_at(&self) -> NaiveDateTime { @@ -65,25 +60,65 @@ macro_rules! id_u64 { } } +/// An identifier for an Application. +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct ApplicationId(pub u64); + +/// An identifier for a Channel +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct ChannelId(pub u64); + +/// An identifier for an Emoji +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct EmojiId(pub u64); + +/// An identifier for a Guild +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct GuildId(pub u64); + +/// An identifier for an Integration +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct IntegrationId(pub u64); + +/// An identifier for a Message +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct MessageId(pub u64); + +/// An identifier for a Role +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct RoleId(pub u64); + +/// An identifier for a User +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct UserId(pub u64); + +/// An identifier for a [`Webhook`](struct.Webhook.html). +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct WebhookId(pub u64); + +/// An identifier for an audit log entry. +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialOrd, Ord, Serialize)] +#[allow(derive_hash_xor_eq)] +pub struct AuditLogEntryId(pub u64); + id_u64! { - /// An identifier for an Application. ApplicationId; - /// An identifier for a Channel ChannelId; - /// An identifier for an Emoji EmojiId; - /// An identifier for a Guild GuildId; - /// An identifier for an Integration IntegrationId; - /// An identifier for a Message MessageId; - /// An identifier for a Role RoleId; - /// An identifier for a User UserId; - /// An identifier for a [`Webhook`](struct.Webhook.html). WebhookId; - /// An identifier for an audit log entry. AuditLogEntryId; } diff --git a/src/model/permissions.rs b/src/model/permissions.rs index dbf0b69..0076b05 100644 --- a/src/model/permissions.rs +++ b/src/model/permissions.rs @@ -145,41 +145,47 @@ pub const PRESET_VOICE: Permissions = Permissions { bits: 0b0000_0011_1111_0000_0000_0000_0000_0000, }; -bitflags! { - /// A set of permissions that can be assigned to [`User`]s and [`Role`]s via - /// [`PermissionOverwrite`]s, roles globally in a [`Guild`], and to - /// [`GuildChannel`]s. - /// - /// [`Guild`]: ../struct.Guild.html - /// [`GuildChannel`]: ../struct.GuildChannel.html - /// [`PermissionOverwrite`]: ../struct.PermissionOverwrite.html - /// [`Role`]: ../struct.Role.html - /// [`User`]: ../struct.User.html - pub struct Permissions: u64 { +/// A set of permissions that can be assigned to [`User`]s and [`Role`]s via +/// [`PermissionOverwrite`]s, roles globally in a [`Guild`], and to +/// [`GuildChannel`]s. +/// +/// [`Guild`]: ../struct.Guild.html +/// [`GuildChannel`]: ../struct.GuildChannel.html +/// [`PermissionOverwrite`]: ../struct.PermissionOverwrite.html +/// [`Role`]: ../struct.Role.html +/// [`User`]: ../struct.User.html +/// +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)] +pub struct Permissions { + bits: u64 +} + +__impl_bitflags! { + Permissions: u64 { /// Allows for the creation of [`RichInvite`]s. /// /// [`RichInvite`]: ../struct.RichInvite.html - const CREATE_INVITE = 0b0000_0000_0000_0000_0000_0000_0000_0001; + CREATE_INVITE = 0b0000_0000_0000_0000_0000_0000_0000_0001; /// Allows for the kicking of guild [member]s. /// /// [member]: ../struct.Member.html - const KICK_MEMBERS = 0b0000_0000_0000_0000_0000_0000_0000_0010; + KICK_MEMBERS = 0b0000_0000_0000_0000_0000_0000_0000_0010; /// Allows the banning of guild [member]s. /// /// [member]: ../struct.Member.html - const BAN_MEMBERS = 0b0000_0000_0000_0000_0000_0000_0000_0100; + BAN_MEMBERS = 0b0000_0000_0000_0000_0000_0000_0000_0100; /// Allows all permissions, bypassing channel [permission overwrite]s. /// /// [permission overwrite]: ../struct.PermissionOverwrite.html - const ADMINISTRATOR = 0b0000_0000_0000_0000_0000_0000_0000_1000; + ADMINISTRATOR = 0b0000_0000_0000_0000_0000_0000_0000_1000; /// Allows management and editing of guild [channel]s. /// /// [channel]: ../struct.GuildChannel.html - const MANAGE_CHANNELS = 0b0000_0000_0000_0000_0000_0000_0001_0000; + MANAGE_CHANNELS = 0b0000_0000_0000_0000_0000_0000_0001_0000; /// Allows management and editing of the [guild]. /// /// [guild]: ../struct.Guild.html - const MANAGE_GUILD = 0b0000_0000_0000_0000_0000_0000_0010_0000; + MANAGE_GUILD = 0b0000_0000_0000_0000_0000_0000_0010_0000; /// [`Member`]s with this permission can add new [`Reaction`]s to a /// [`Message`]. Members can still react using reactions already added /// to messages without this permission. @@ -187,70 +193,70 @@ bitflags! { /// [`Member`]: ../struct.Member.html /// [`Message`]: ../struct.Message.html /// [`Reaction`]: ../struct.Reaction.html - const ADD_REACTIONS = 0b0000_0000_0000_0000_0000_0000_0100_0000; + 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; + 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; + READ_MESSAGES = 0b0000_0000_0000_0000_0000_0100_0000_0000; /// Allows sending messages in a guild channel. - const SEND_MESSAGES = 0b0000_0000_0000_0000_0000_1000_0000_0000; + SEND_MESSAGES = 0b0000_0000_0000_0000_0000_1000_0000_0000; /// Allows the sending of text-to-speech messages in a channel. - const SEND_TTS_MESSAGES = 0b0000_0000_0000_0000_0001_0000_0000_0000; + SEND_TTS_MESSAGES = 0b0000_0000_0000_0000_0001_0000_0000_0000; /// Allows the deleting of other messages in a guild channel. /// /// **Note**: This does not allow the editing of other messages. - const MANAGE_MESSAGES = 0b0000_0000_0000_0000_0010_0000_0000_0000; + MANAGE_MESSAGES = 0b0000_0000_0000_0000_0010_0000_0000_0000; /// Allows links from this user - or users of this role - to be /// embedded, with potential data such as a thumbnail, description, and /// page name. - const EMBED_LINKS = 0b0000_0000_0000_0000_0100_0000_0000_0000; + EMBED_LINKS = 0b0000_0000_0000_0000_0100_0000_0000_0000; /// Allows uploading of files. - const ATTACH_FILES = 0b0000_0000_0000_0000_1000_0000_0000_0000; + ATTACH_FILES = 0b0000_0000_0000_0000_1000_0000_0000_0000; /// Allows the reading of a channel's message history. - const READ_MESSAGE_HISTORY = 0b0000_0000_0000_0001_0000_0000_0000_0000; + READ_MESSAGE_HISTORY = 0b0000_0000_0000_0001_0000_0000_0000_0000; /// Allows the usage of the `@everyone` mention, which will notify all /// users in a channel. The `@here` mention will also be available, and /// can be used to mention all non-offline users. /// /// **Note**: You probably want this to be disabled for most roles and /// users. - const MENTION_EVERYONE = 0b0000_0000_0000_0010_0000_0000_0000_0000; + MENTION_EVERYONE = 0b0000_0000_0000_0010_0000_0000_0000_0000; /// Allows the usage of custom emojis from other guilds. /// /// This does not dictate whether custom emojis in this guild can be /// used in other guilds. - const USE_EXTERNAL_EMOJIS = 0b0000_0000_0000_0100_0000_0000_0000_0000; + USE_EXTERNAL_EMOJIS = 0b0000_0000_0000_0100_0000_0000_0000_0000; /// Allows the joining of a voice channel. - const CONNECT = 0b0000_0000_0001_0000_0000_0000_0000_0000; + CONNECT = 0b0000_0000_0001_0000_0000_0000_0000_0000; /// Allows the user to speak in a voice channel. - const SPEAK = 0b0000_0000_0010_0000_0000_0000_0000_0000; + SPEAK = 0b0000_0000_0010_0000_0000_0000_0000_0000; /// Allows the muting of members in a voice channel. - const MUTE_MEMBERS = 0b0000_0000_0100_0000_0000_0000_0000_0000; + MUTE_MEMBERS = 0b0000_0000_0100_0000_0000_0000_0000_0000; /// Allows the deafening of members in a voice channel. - const DEAFEN_MEMBERS = 0b0000_0000_1000_0000_0000_0000_0000_0000; + DEAFEN_MEMBERS = 0b0000_0000_1000_0000_0000_0000_0000_0000; /// Allows the moving of members from one voice channel to another. - const MOVE_MEMBERS = 0b0000_0001_0000_0000_0000_0000_0000_0000; + MOVE_MEMBERS = 0b0000_0001_0000_0000_0000_0000_0000_0000; /// Allows the usage of voice-activity-detection in a [voice] channel. /// /// If this is disabled, then [`Member`]s must use push-to-talk. /// /// [`Member`]: ../struct.Member.html /// [voice]: ../enum.ChannelType.html#variant.Voice - const USE_VAD = 0b0000_0010_0000_0000_0000_0000_0000_0000; + USE_VAD = 0b0000_0010_0000_0000_0000_0000_0000_0000; /// Allows members to change their own nickname in the guild. - const CHANGE_NICKNAME = 0b0000_0100_0000_0000_0000_0000_0000_0000; + CHANGE_NICKNAME = 0b0000_0100_0000_0000_0000_0000_0000_0000; /// Allows members to change other members' nicknames. - const MANAGE_NICKNAMES = 0b0000_1000_0000_0000_0000_0000_0000_0000; + MANAGE_NICKNAMES = 0b0000_1000_0000_0000_0000_0000_0000_0000; /// Allows management and editing of roles below their own. - const MANAGE_ROLES = 0b0001_0000_0000_0000_0000_0000_0000_0000; + MANAGE_ROLES = 0b0001_0000_0000_0000_0000_0000_0000_0000; /// Allows management of webhooks. - const MANAGE_WEBHOOKS = 0b0010_0000_0000_0000_0000_0000_0000_0000; + MANAGE_WEBHOOKS = 0b0010_0000_0000_0000_0000_0000_0000_0000; /// Allows management of emojis created without the use of an /// [`Integration`]. /// /// [`Integration`]: ../struct.Integration.html - const MANAGE_EMOJIS = 0b0100_0000_0000_0000_0000_0000_0000_0000; + MANAGE_EMOJIS = 0b0100_0000_0000_0000_0000_0000_0000_0000; } } |