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"
|
import { performance } from "node:perf_hooks"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
"server:ping": async (client, data) => {
|
ping: async (client, data) => {
|
||||||
const pongTime = performance.now()
|
client.emit("pong")
|
||||||
|
|
||||||
return {
|
|
||||||
ping: data.ping ?? 0,
|
|
||||||
pong: pongTime,
|
|
||||||
latency: Number(pongTime - data.ping),
|
|
||||||
latencyMs: Number(pongTime - data.ping).toFixed(2),
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"topic:subscribe": async (client, topic) => {
|
"topic:subscribe": async (client, topic) => {
|
||||||
client.subscribe(topic)
|
client.subscribe(topic)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user