summary refs log tree commit diff
path: root/src/system/types.rs
blob: 862ddd19b4b21ce5c362826398d5a174dac8bd13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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),
}