summary refs log tree commit diff
path: root/src/system/types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/system/types.rs')
-rw-r--r--src/system/types.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/system/types.rs b/src/system/types.rs
index e8d14a6..41cb10d 100644
--- a/src/system/types.rs
+++ b/src/system/types.rs
@@ -1,4 +1,5 @@
-use twilight_model::channel::Message;
+pub use twilight_model::channel::Message as TwiMessage;
+use twilight_model::gateway::payload::incoming::MessageUpdate as PartialMessage;
 use twilight_model::id::marker::{ChannelMarker, MessageMarker, UserMarker};
 use twilight_model::id::Id;
 use twilight_model::util::Timestamp;
@@ -7,9 +8,16 @@ pub type MemberId = usize;
 pub type MessageId = Id<MessageMarker>;
 pub type ChannelId = Id<ChannelMarker>;
 pub type UserId = Id<UserMarker>;
+pub type FullMessage = TwiMessage;
 
 pub type Status = twilight_model::gateway::presence::Status;
 
+#[derive(Clone)]
+pub enum Message {
+    Complete(FullMessage),
+    Partial(PartialMessage, MemberId),
+}
+
 pub type MessageEvent = (Timestamp, Message);
 pub type ReactionEvent = (Timestamp, ());
 pub type CommandEvent = (Timestamp, ());
@@ -20,9 +28,10 @@ pub enum SystemEvent {
     GatewayError(MemberId, String),
     GatewayClosed(MemberId),
     AllGatewaysConnected,
+    RefetchMessage(MemberId, MessageId, ChannelId),
 
     // User event handling
-    NewMessage(MessageEvent),
+    NewMessage(Timestamp, FullMessage),
     EditedMessage(MessageEvent),
     NewReaction(ReactionEvent),