properly updated connected variable

This commit is contained in:
bingus_violet 2024-06-25 01:05:18 -05:00
parent 74f2911244
commit ae1397d84a

2
api.js
View file

@ -29,6 +29,7 @@ function socketeer() {
lanyard.on("close", () => { lanyard.on("close", () => {
console.log("Connection Closed. Attempting Reconnect in 30 seconds.") console.log("Connection Closed. Attempting Reconnect in 30 seconds.")
module.exports.lanyard = constants.fallbackLanyard module.exports.lanyard = constants.fallbackLanyard
module.exports.connected = false
setTimeout(() => { setTimeout(() => {
socketeer() socketeer()
}, 30000); }, 30000);
@ -52,6 +53,7 @@ function socketeer() {
// console.log(data.op) // console.log(data.op)
if (data.op == 1) { if (data.op == 1) {
console.log("Connected to Discord Websocket!") console.log("Connected to Discord Websocket!")
module.exports.connected = true
ping(30000) ping(30000)
lastPong = Date.now() lastPong = Date.now()
} else if (data.op == 3) { } else if (data.op == 3) {