onyxcord 3.2.2 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/onyxcord/core/bot/runtime.rb +4 -0
- data/lib/onyxcord/core/version.rb +1 -1
- data/lib/onyxcord/gateway/client.rb +3 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 23d795e8a2baf1f58d15267e7b1b32814719aec6d8922397821fb9399798028b
|
|
4
|
+
data.tar.gz: 1a10c95ab6f32f4d61899d2c0563bcbcb3ad4acd790051edaa18ed68a827d02c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 26109c5e32a6349fdc4ff92950b8d4010b1e8e6347338e96fd4c45ca22f35df7367177bbaa1fef6d35b6d3ca4fc066f17e5ca8909d8ec360f23690d34fd96388
|
|
7
|
+
data.tar.gz: 7b97e9f9e33a938332d49139270f5e1d8fc21a27627544c81053ab5cc5b2c408249ea5c97d62ee5216ce65e79a02c8a1abe1d84f5f002dd8bb16714b93e9f7e3
|
|
@@ -17,7 +17,7 @@ module OnyxCord
|
|
|
17
17
|
FATAL_CLOSE_CODES = [4003, 4004, 4011, 4014].freeze
|
|
18
18
|
|
|
19
19
|
attr_accessor :check_heartbeat_acks
|
|
20
|
-
attr_reader :intents
|
|
20
|
+
attr_reader :intents, :latency
|
|
21
21
|
|
|
22
22
|
def initialize(bot, token, shard_key = nil, compress_mode = :stream, intents = ALL_INTENTS)
|
|
23
23
|
@token = token
|
|
@@ -108,6 +108,7 @@ module OnyxCord
|
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
def send_heartbeat(sequence)
|
|
111
|
+
@last_heartbeat_sent_at = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
111
112
|
send_packet(Internal::Gateway::Opcodes::HEARTBEAT, sequence)
|
|
112
113
|
end
|
|
113
114
|
|
|
@@ -402,6 +403,7 @@ module OnyxCord
|
|
|
402
403
|
LOGGER.debug("Heartbeat ACK: #{packet.inspect}")
|
|
403
404
|
return unless @check_heartbeat_acks
|
|
404
405
|
|
|
406
|
+
@latency = Process.clock_gettime(Process::CLOCK_MONOTONIC) - @last_heartbeat_sent_at if @last_heartbeat_sent_at
|
|
405
407
|
@last_heartbeat_acked = true
|
|
406
408
|
@missed_heartbeat_acks = 0
|
|
407
409
|
end
|