Fix incorrectly-implemented ping-pong
This commit is contained in:
parent
1efd9dc2a7
commit
6b1e1ea7ad
1 changed files with 3 additions and 0 deletions
|
@ -215,10 +215,13 @@ function socketeer() {
|
|||
|
||||
lanyard.addEventListener("message", async (res) => {
|
||||
var data = JSON.parse(res.data)
|
||||
// console.log(data.op)
|
||||
if (data.op == 1) {
|
||||
console.log("Connected to Discord Websocket!")
|
||||
ping(30000)
|
||||
lastPong = Date.now()
|
||||
} else if (data.op == 3) {
|
||||
lastPong = Date.now()
|
||||
} else if (data.op == 0) {
|
||||
lanyardData = data.d
|
||||
lastLanyardUpdate = Date.now()
|
||||
|
|
Loading…
Reference in a new issue