mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
hotfix
This commit is contained in:
1 parent
4a62defe1b
commit
fab2d51681
2 files changed
+10
-7
No files matched your search
+9
-6
@@ -1412,8 +1412,9 @@ export default class Player extends EventEmitter {
|
||||
return leftCleanly;
|
||||
}
|
||||
|
||||
destroy() {
|
||||
destroy(options = {}) {
|
||||
if (this._destroyed) return;
|
||||
const skipDisconnect = options?.disconnect === false;
|
||||
this._destroyed = true;
|
||||
|
||||
try {
|
||||
@@ -1445,11 +1446,13 @@ export default class Player extends EventEmitter {
|
||||
this._stopMediaPlayer().catch(() => {}).then(() => {
|
||||
if (connToDestroy) {
|
||||
try { connToDestroy.removeAllListeners?.(); } catch (_) {}
|
||||
const disconnectPromise = connToDestroy.disconnect?.();
|
||||
if (disconnectPromise instanceof Promise) {
|
||||
disconnectPromise.catch((err) => {
|
||||
logger.error("[Player] Deferred disconnect failed:", err.message);
|
||||
});
|
||||
if (!skipDisconnect) {
|
||||
const disconnectPromise = connToDestroy.disconnect?.();
|
||||
if (disconnectPromise instanceof Promise) {
|
||||
disconnectPromise.catch((err) => {
|
||||
logger.error("[Player] Deferred disconnect failed:", err.message);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user