diff options
author | Ashelyn Dawn <ashe@ashen.earth> | 2024-10-01 15:37:09 -0600 |
---|---|---|
committer | Ashelyn Dawn <ashe@ashen.earth> | 2024-10-01 15:37:09 -0600 |
commit | a6a120ae8b8ed08b0801d76e80a5f7a0b8cde44b (patch) | |
tree | 37242703c61137d1198bc373558828b9faa0732b /src/system/types.rs | |
parent | f87e9727e69e981e4acff31a779e29a35637b964 (diff) |
Refactor gateway and message aggregation
Diffstat (limited to 'src/system/types.rs')
-rw-r--r-- | src/system/types.rs | 33 |
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), +} |