diff options
author | Ashelyn Rose <git@ashen.earth> | 2024-10-03 03:18:26 -0600 |
---|---|---|
committer | Ashelyn Rose <git@ashen.earth> | 2024-10-03 03:18:26 -0600 |
commit | 0053ccbb31c3b87285bf38ee3eda3308c67ad707 (patch) | |
tree | 63c103173127ba691922fe4258e0ebdc6f266a6e /src/system/types.rs | |
parent | 8b716d49ed019213d91a45f094684f26fac289bd (diff) |
Refactor bot into separate client + gateway
Diffstat (limited to 'src/system/types.rs')
-rw-r--r-- | src/system/types.rs | 13 |
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), |