properly updated connected variable
This commit is contained in:
parent
74f2911244
commit
ae1397d84a
1 changed files with 2 additions and 0 deletions
2
api.js
2
api.js
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue