mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 02:24:17 +00:00
renamed ping
This commit is contained in:
parent
2fb2046ecc
commit
81da24dc4e
@ -1,15 +1,8 @@
|
||||
import { performance } from "node:perf_hooks"
|
||||
|
||||
export default {
|
||||
"server:ping": async (client, data) => {
|
||||
const pongTime = performance.now()
|
||||
|
||||
return {
|
||||
ping: data.ping ?? 0,
|
||||
pong: pongTime,
|
||||
latency: Number(pongTime - data.ping),
|
||||
latencyMs: Number(pongTime - data.ping).toFixed(2),
|
||||
}
|
||||
ping: async (client, data) => {
|
||||
client.emit("pong")
|
||||
},
|
||||
"topic:subscribe": async (client, topic) => {
|
||||
client.subscribe(topic)
|
||||
|
Loading…
x
Reference in New Issue
Block a user