magmastream 2.9.0-dev.14 → 2.9.0-dev.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -313,8 +313,9 @@ class Manager extends events_1.EventEmitter {
|
|
|
313
313
|
}
|
|
314
314
|
if (update.user_id !== this.options.clientId)
|
|
315
315
|
return;
|
|
316
|
-
|
|
317
|
-
|
|
316
|
+
const missingSessionButHasEvent = !player.voiceState.sessionId && player.voiceState.event;
|
|
317
|
+
if (missingSessionButHasEvent) {
|
|
318
|
+
if (player.state !== Utils_1.StateTypes.Destroying && player.state !== Utils_1.StateTypes.Disconnected) {
|
|
318
319
|
await player.destroy();
|
|
319
320
|
}
|
|
320
321
|
return;
|
|
@@ -995,7 +996,7 @@ class Manager extends events_1.EventEmitter {
|
|
|
995
996
|
}
|
|
996
997
|
if (key === "data") {
|
|
997
998
|
return {
|
|
998
|
-
clientUser: value
|
|
999
|
+
clientUser: value?.Internal_BotUser ?? null,
|
|
999
1000
|
};
|
|
1000
1001
|
}
|
|
1001
1002
|
return serialize(value);
|
|
@@ -224,12 +224,22 @@ class Player {
|
|
|
224
224
|
*/
|
|
225
225
|
async destroy(disconnect = true) {
|
|
226
226
|
const oldPlayer = this ? { ...this } : null;
|
|
227
|
+
if (this.state === Utils_1.StateTypes.Destroying || this.state === Utils_1.StateTypes.Disconnected) {
|
|
228
|
+
console.debug(`[Player#destroy] Already destroying/destroyed for ${this.guildId}`);
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
227
231
|
this.state = Utils_1.StateTypes.Destroying;
|
|
228
232
|
if (disconnect) {
|
|
229
|
-
await this.disconnect()
|
|
233
|
+
await this.disconnect().catch((err) => {
|
|
234
|
+
console.warn(`[Player#destroy] Failed to disconnect player ${this.guildId}:`, err);
|
|
235
|
+
});
|
|
230
236
|
}
|
|
231
|
-
await this.node.rest.destroyPlayer(this.guildId)
|
|
237
|
+
await this.node.rest.destroyPlayer(this.guildId).catch((err) => {
|
|
238
|
+
console.warn(`[Player#destroy] REST failed to destroy player ${this.guildId}:`, err);
|
|
239
|
+
});
|
|
232
240
|
await this.queue.clear();
|
|
241
|
+
await this.queue.clearPrevious();
|
|
242
|
+
await this.queue.setCurrent(null);
|
|
233
243
|
this.manager.emit(Manager_1.ManagerEventTypes.PlayerStateUpdate, oldPlayer, null, {
|
|
234
244
|
changeType: Manager_1.PlayerStateEventTypes.PlayerDestroy,
|
|
235
245
|
});
|