diff --git a/src/gateway/shard.rs b/src/gateway/shard.rs index 75dc14749ed..a890029f10a 100644 --- a/src/gateway/shard.rs +++ b/src/gateway/shard.rs @@ -652,11 +652,13 @@ impl Shard { // Shamelessly stolen from brayzure's commit in eris: // pub fn latency(&self) -> Option { - if let (Some(received), Some(sent)) = self.heartbeat_instants { - Some(sent - received) - } else { - None + if let (Some(sent), Some(received)) = self.heartbeat_instants { + if received > sent { + return Some(received - sent); + } } + + None } #[cfg(feature = "voice")]