reconnect lul
This commit is contained in:
parent
4247b8e82d
commit
0211ab428f
@ -90,11 +90,23 @@ export default class slack extends EventEmitter {
|
||||
this.emit("data", [ "error", err ]);
|
||||
}
|
||||
})
|
||||
.on("end", () => this.emit("data", [ "debug", "stream ended" ]))
|
||||
.on("error", err => this.emit("data", [ "error", err ]));
|
||||
.on("end", () => {
|
||||
this.emit("data", [ "debug", "stream ended" ]);
|
||||
this.reconnect();
|
||||
})
|
||||
.on("error", err => {
|
||||
this.emit("data", [ "error", err ]);
|
||||
this.reconnect();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
reconnect() {
|
||||
this.server.wss.url = null;
|
||||
this.server.wss.socket = null;
|
||||
this.connect();
|
||||
}
|
||||
|
||||
async getChannel(channelId) {
|
||||
if(this.server.channel.has(channelId))
|
||||
return this.server.channel.get(channelId);
|
||||
|
Loading…
Reference in New Issue
Block a user