Enum twilight_model::gateway::OpCode
source · #[non_exhaustive]
#[repr(u8)]
pub enum OpCode {
Dispatch,
Heartbeat,
Identify,
PresenceUpdate,
VoiceStateUpdate,
Resume,
Reconnect,
RequestGuildMembers,
InvalidSession,
Hello,
HeartbeatAck,
}
Expand description
Gateway event opcodes.
The documentation is written from a client’s perspective.
PresenceUpdate
, RequestGuildMembers
, and VoiceStateUpdate
are
not requiried for establishing or maintaining a gateway connection.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Dispatch
DispatchEvent
and sequence number.
Will only be received after establishing or resuming a session.
Heartbeat
Periodically sent to maintain the connection and may be received to immediately request one.
Identify
Start a new session.
PresenceUpdate
Request to update the client’s presence.
VoiceStateUpdate
Request to join, leave or move between voice channels.
Resume
Resume a previously disconnected session, skipping over Identify
.
Reconnect
Indicates that a reconnect is required.
RequestGuildMembers
Request a list of members for a guild.
InvalidSession
Received when the session is invalidated.
Hello
Received after connecting, contains the heartbeat interval.
HeartbeatAck
Received in response to sending a Heartbeat
.