Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gateway/sharding/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ impl Shard {
}) => self
.handle_gateway_dispatch(seq, data, &original_str)
.map(|e| Some(ShardAction::Dispatch(e))),
Ok(GatewayEvent::Heartbeat(..)) => {
Ok(GatewayEvent::Heartbeat) => {
info!("[{:?}] Received shard heartbeat", self.shard_info);

Ok(Some(ShardAction::Heartbeat))
Expand Down
8 changes: 2 additions & 6 deletions src/model/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ pub enum GatewayEvent {
// Used for debugging, if the data cannot be deserialised.
original_str: FixedString,
},
Heartbeat(#[deprecated = "always 0 because it is never provided by the gateway"] u64),
Heartbeat,
Reconnect,
/// Whether the session can be resumed.
InvalidateSession(bool),
Expand All @@ -959,11 +959,7 @@ impl<'de> Deserialize<'de> for GatewayEvent {
data: map,
}
},
Opcode::Heartbeat => {
// Placeholder value. Discord expects the last Dispatch
// sequence number and doesn't send it with the heartbeat.
Self::Heartbeat(0)
},
Opcode::Heartbeat => Self::Heartbeat,
Opcode::InvalidSession => Self::InvalidateSession(remove_from_map(&mut map, "d")?),
Opcode::Hello => {
#[derive(Deserialize)]
Expand Down