mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -05:00
hotfix
This commit is contained in:
1 parent
4a62defe1b
commit
fab2d51681
2 files changed
+5
-2
No files matched your search
@@ -1280,7 +1280,7 @@ export class GatewayHandler {
|
|||||||
player._lastDisconnectReason = "gateway";
|
player._lastDisconnectReason = "gateway";
|
||||||
player._lastDisconnectTime = Date.now();
|
player._lastDisconnectTime = Date.now();
|
||||||
remix.players.playerMap.delete(cleanOld);
|
remix.players.playerMap.delete(cleanOld);
|
||||||
try { player.destroy(); } catch (_) {}
|
try { player.destroy({ disconnect: false }); } catch (_) {}
|
||||||
this.recoveryManager.scheduleSpawn(guildId, cleanOld, this.T.rejoin247Delay, "gateway-disconnect");
|
this.recoveryManager.scheduleSpawn(guildId, cleanOld, this.T.rejoin247Delay, "gateway-disconnect");
|
||||||
} else {
|
} else {
|
||||||
this.recoveryManager.scheduleSpawn(guildId, cleanOld, this.T.rejoin247Delay, "gateway-disconnect");
|
this.recoveryManager.scheduleSpawn(guildId, cleanOld, this.T.rejoin247Delay, "gateway-disconnect");
|
||||||
|
|||||||
+4
-1
@@ -1412,8 +1412,9 @@ export default class Player extends EventEmitter {
|
|||||||
return leftCleanly;
|
return leftCleanly;
|
||||||
}
|
}
|
||||||
|
|
||||||
destroy() {
|
destroy(options = {}) {
|
||||||
if (this._destroyed) return;
|
if (this._destroyed) return;
|
||||||
|
const skipDisconnect = options?.disconnect === false;
|
||||||
this._destroyed = true;
|
this._destroyed = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -1445,6 +1446,7 @@ export default class Player extends EventEmitter {
|
|||||||
this._stopMediaPlayer().catch(() => {}).then(() => {
|
this._stopMediaPlayer().catch(() => {}).then(() => {
|
||||||
if (connToDestroy) {
|
if (connToDestroy) {
|
||||||
try { connToDestroy.removeAllListeners?.(); } catch (_) {}
|
try { connToDestroy.removeAllListeners?.(); } catch (_) {}
|
||||||
|
if (!skipDisconnect) {
|
||||||
const disconnectPromise = connToDestroy.disconnect?.();
|
const disconnectPromise = connToDestroy.disconnect?.();
|
||||||
if (disconnectPromise instanceof Promise) {
|
if (disconnectPromise instanceof Promise) {
|
||||||
disconnectPromise.catch((err) => {
|
disconnectPromise.catch((err) => {
|
||||||
@@ -1452,6 +1454,7 @@ export default class Player extends EventEmitter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("[Player] destroy error:", e.message);
|
logger.error("[Player] destroy error:", e.message);
|
||||||
|
|||||||
Reference in new issue
Block a user