File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
LavalinkServer/src/main/java/lavalink/server/io Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -251,14 +251,16 @@ This event includes:
251251* Unix timestamp in milliseconds.
252252* Track position in milliseconds. Omitted if not playing anything.
253253* ` connected ` is true when connected to the voice gateway.
254+ * ` ping ` represents the number of milliseconds between heartbeat and ack. Could be ` -1 ` if not connected.
254255``` json
255256{
256257 "op" : " playerUpdate" ,
257258 "guildId" : " ..." ,
258259 "state" : {
259260 "time" : 1500467109 ,
260261 "position" : 60000 ,
261- "connected" : true
262+ "connected" : true ,
263+ "ping" : 0
262264 }
263265}
264266```
Original file line number Diff line number Diff line change @@ -61,8 +61,9 @@ class SocketServer(
6161 val json = JSONObject ()
6262
6363 val state = player.state
64- val connected = socketContext.getMediaConnection(player).gatewayConnection?.isOpen == true
65- state.put(" connected" , connected)
64+ val connection = socketContext.getMediaConnection(player).gatewayConnection
65+ state.put(" connected" , connection?.isOpen == true )
66+ state.put(" ping" , connection?.ping ? : - 1 )
6667
6768 json.put(" op" , " playerUpdate" )
6869 json.put(" guildId" , player.guildId.toString())
You can’t perform that action at this time.
0 commit comments