From a6a120ae8b8ed08b0801d76e80a5f7a0b8cde44b Mon Sep 17 00:00:00 2001 From: Ashelyn Dawn Date: Tue, 1 Oct 2024 15:37:09 -0600 Subject: Refactor gateway and message aggregation --- src/system/types.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/system/types.rs (limited to 'src/system/types.rs') 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; +pub type UserId = Id; + +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), +} -- cgit 1.4.1