aboutsummaryrefslogtreecommitdiff
path: root/src/model/channel/message.rs
diff options
context:
space:
mode:
authorLeah <[email protected]>2018-03-23 13:54:12 +0100
committeralex <[email protected]>2018-03-23 13:54:12 +0100
commitfdcf44e1463e708cd8b612c183e302db9af0febd (patch)
tree1a311f26fb38522ba380881fa6e72c0c2e5c54bc /src/model/channel/message.rs
parentFix Create(Embed/Message) to be consistent (diff)
downloadserenity-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/channel/message.rs')
-rw-r--r--src/model/channel/message.rs46
1 files changed, 29 insertions, 17 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,
}
);