magmastream 2.8.6-dev.2 → 2.8.6-dev.3
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.
|
@@ -455,8 +455,9 @@ class Manager extends events_1.EventEmitter {
|
|
|
455
455
|
if (state.dynamicRepeat) {
|
|
456
456
|
player.setDynamicRepeat(state.dynamicRepeat, state.dynamicLoopInterval._idleTimeout);
|
|
457
457
|
}
|
|
458
|
-
if (state.isAutoplay
|
|
459
|
-
|
|
458
|
+
if (state.isAutoplay) {
|
|
459
|
+
Object.setPrototypeOf(state.data.clientUser, { constructor: { name: "User" } });
|
|
460
|
+
player.setAutoplay(true, state.data.clientUser, state.autoplayTries);
|
|
460
461
|
}
|
|
461
462
|
if (state.data) {
|
|
462
463
|
for (const [name, value] of Object.entries(state.data)) {
|
|
@@ -770,6 +771,11 @@ class Manager extends events_1.EventEmitter {
|
|
|
770
771
|
previous: [...value.previous],
|
|
771
772
|
};
|
|
772
773
|
}
|
|
774
|
+
if (key === "data") {
|
|
775
|
+
return {
|
|
776
|
+
clientUser: value.Internal_BotUser ?? null,
|
|
777
|
+
};
|
|
778
|
+
}
|
|
773
779
|
return serialize(value);
|
|
774
780
|
}));
|
|
775
781
|
}
|
|
@@ -340,14 +340,14 @@ class Player {
|
|
|
340
340
|
*/
|
|
341
341
|
setAutoplay(autoplayState, botUser, tries) {
|
|
342
342
|
if (typeof autoplayState !== "boolean") {
|
|
343
|
-
throw new
|
|
343
|
+
throw new Error("autoplayState must be a boolean.");
|
|
344
344
|
}
|
|
345
345
|
if (autoplayState) {
|
|
346
346
|
if (!botUser) {
|
|
347
|
-
throw new
|
|
347
|
+
throw new Error("botUser must be provided when enabling autoplay.");
|
|
348
348
|
}
|
|
349
349
|
if (!["ClientUser", "User"].includes(botUser.constructor.name)) {
|
|
350
|
-
throw new
|
|
350
|
+
throw new Error("botUser must be a user-object.");
|
|
351
351
|
}
|
|
352
352
|
this.autoplayTries = tries && typeof tries === "number" && tries > 0 ? tries : 3; // Default to 3 if invalid
|
|
353
353
|
this.isAutoplay = true;
|