summary refs log tree commit diff
path: root/src/system/types.rs
diff options
context:
space:
mode:
authorAshelyn Dawn <ashe@ashen.earth>2024-10-01 15:37:09 -0600
committerAshelyn Dawn <ashe@ashen.earth>2024-10-01 15:37:09 -0600
commita6a120ae8b8ed08b0801d76e80a5f7a0b8cde44b (patch)
tree37242703c61137d1198bc373558828b9faa0732b /src/system/types.rs
parentf87e9727e69e981e4acff31a779e29a35637b964 (diff)
Refactor gateway and message aggregation
Diffstat (limited to 'src/system/types.rs')
-rw-r--r--src/system/types.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/system/types.rs b/src/system/types.rs
new file mode 100644
index 0000000..862ddd1
--- /dev/null
+++ b/src/system/types.rs
@@ -0,0 +1,33 @@
+use twilight_model::channel::Message;
+use twilight_model::id::marker::{MessageMarker, UserMarker};
+use twilight_model::id::Id;
+use twilight_model::util::Timestamp;
+
+pub type MemberId = usize;
+pub type MessageId = Id<MessageMarker>;
+pub type UserId = Id<UserMarker>;
+
+pub type Status = twilight_model::gateway::presence::Status;
+
+pub type MessageEvent = (Timestamp, Message);
+pub type ReactionEvent = (Timestamp, ());
+pub type CommandEvent = (Timestamp, ());
+
+pub enum SystemEvent {
+    // Process of operation
+    GatewayConnected(MemberId),
+    GatewayError(MemberId, String),
+    GatewayClosed(MemberId),
+    AllGatewaysConnected,
+
+    // User event handling
+    NewMessage(MessageEvent),
+    EditedMessage(MessageEvent),
+    NewReaction(ReactionEvent),
+
+    // Command handling
+    NewCommand(CommandEvent),
+
+    // Autoproxy
+    AutoproxyTimeout(Timestamp),
+}