pub enum Event {
Error(ErrorPayload),
Ready(ConnectEvent),
Disconnected {
reason: Error,
},
CurrentUserUpdate(UpdateEvent),
ActivityJoin(SecretEvent),
ActivitySpectate(SecretEvent),
ActivityJoinRequest(JoinRequestEvent),
ActivityInvite(InviteEvent),
OverlayUpdate(UpdateEvent),
RelationshipUpdate(Arc<Relationship>),
}
Expand description
An event sent from Discord to notify us of some kind of state change or completed action.
{ "evt": "ACTIVITY_JOIN", "data": { "secret": "super_sekret" } }
Variants§
Error(ErrorPayload)
Fires when we’ve done something naughty and Discord is telling us to stop.
Ready(ConnectEvent)
Sent by Discord upon receipt of our Handshake
message, the user is
the current user logged in to the Discord we connected to.
Disconnected
Fired when the connection has been interrupted between us and Discord, this is a synthesized event as there are can be numerous reasons on the client side for this to happen, in addition to Discord itself being closed, etc.
CurrentUserUpdate(UpdateEvent)
Fired when any details on the current logged in user are changed.
ActivityJoin(SecretEvent)
Sent by Discord when the local user has requested to join a game, and the remote user has accepted their request.
ActivitySpectate(SecretEvent)
Sent by Discord when the local user has chosen to spectate another user’s game session.
ActivityJoinRequest(JoinRequestEvent)
Fires when a user asks to join the current user’s game.
ActivityInvite(InviteEvent)
Fires when the current user is invited by another user to their game.
OverlayUpdate(UpdateEvent)
Event fired when the overlay state changes.
RelationshipUpdate(Arc<Relationship>)
Event fired when a relationship with another user changes.