magmastream 2.9.3-dev.3 → 2.9.3-dev.5
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.
package/dist/index.d.ts
CHANGED
|
@@ -170,7 +170,9 @@ declare enum TrackPartial {
|
|
|
170
170
|
/** The plugin info of the track */
|
|
171
171
|
PluginInfo = "pluginInfo",
|
|
172
172
|
/** The custom data of the track */
|
|
173
|
-
CustomData = "customData"
|
|
173
|
+
CustomData = "customData",
|
|
174
|
+
/** Whether the track got autoplayed */
|
|
175
|
+
IsAutoPlay = "isAutoplay"
|
|
174
176
|
}
|
|
175
177
|
/**
|
|
176
178
|
* Manager Event Types Enum
|
|
@@ -1189,7 +1191,7 @@ interface Track {
|
|
|
1189
1191
|
pluginInfo: TrackPluginInfo;
|
|
1190
1192
|
/** Add your own data to the track. */
|
|
1191
1193
|
customData: Record<string, unknown>;
|
|
1192
|
-
/** If the track
|
|
1194
|
+
/** If the track got added by autoplay. */
|
|
1193
1195
|
readonly isAutoplay: boolean;
|
|
1194
1196
|
}
|
|
1195
1197
|
/**
|
package/dist/structures/Enums.js
CHANGED
|
@@ -163,6 +163,8 @@ var TrackPartial;
|
|
|
163
163
|
TrackPartial["PluginInfo"] = "pluginInfo";
|
|
164
164
|
/** The custom data of the track */
|
|
165
165
|
TrackPartial["CustomData"] = "customData";
|
|
166
|
+
/** Whether the track got autoplayed */
|
|
167
|
+
TrackPartial["IsAutoPlay"] = "isAutoplay";
|
|
166
168
|
})(TrackPartial || (exports.TrackPartial = TrackPartial = {}));
|
|
167
169
|
/**
|
|
168
170
|
* Manager Event Types Enum
|
|
@@ -260,6 +260,9 @@ class Player {
|
|
|
260
260
|
*/
|
|
261
261
|
async destroy(disconnect = true) {
|
|
262
262
|
this.state = Enums_1.StateTypes.Destroying;
|
|
263
|
+
await this.queue.clear();
|
|
264
|
+
await this.queue.clearPrevious();
|
|
265
|
+
await this.queue.setCurrent(null);
|
|
263
266
|
if (disconnect) {
|
|
264
267
|
await this.disconnect().catch((err) => {
|
|
265
268
|
console.warn(`[Player#destroy] Failed to disconnect player ${this.guildId}:`, err);
|
|
@@ -268,9 +271,6 @@ class Player {
|
|
|
268
271
|
await this.node.rest.destroyPlayer(this.guildId).catch((err) => {
|
|
269
272
|
console.warn(`[Player#destroy] REST failed to destroy player ${this.guildId}:`, err);
|
|
270
273
|
});
|
|
271
|
-
await this.queue.clear();
|
|
272
|
-
await this.queue.clearPrevious();
|
|
273
|
-
await this.queue.setCurrent(null);
|
|
274
274
|
this.manager.emit(Enums_1.ManagerEventTypes.PlayerDestroy, this);
|
|
275
275
|
const deleted = this.manager.players.delete(this.guildId);
|
|
276
276
|
if (this.manager.options.stateStorage.deleteInactivePlayers)
|
package/dist/structures/Utils.js
CHANGED
|
@@ -39,19 +39,12 @@ class TrackUtils {
|
|
|
39
39
|
const defaultProperties = [
|
|
40
40
|
Enums_1.TrackPartial.Track,
|
|
41
41
|
Enums_1.TrackPartial.Title,
|
|
42
|
-
Enums_1.TrackPartial.Identifier,
|
|
43
42
|
Enums_1.TrackPartial.Author,
|
|
44
43
|
Enums_1.TrackPartial.Duration,
|
|
45
|
-
Enums_1.TrackPartial.Isrc,
|
|
46
|
-
Enums_1.TrackPartial.IsSeekable,
|
|
47
|
-
Enums_1.TrackPartial.IsStream,
|
|
48
44
|
Enums_1.TrackPartial.Uri,
|
|
49
|
-
Enums_1.TrackPartial.ArtworkUrl,
|
|
50
45
|
Enums_1.TrackPartial.SourceName,
|
|
51
|
-
Enums_1.TrackPartial.
|
|
46
|
+
Enums_1.TrackPartial.ArtworkUrl,
|
|
52
47
|
Enums_1.TrackPartial.Requester,
|
|
53
|
-
Enums_1.TrackPartial.PluginInfo,
|
|
54
|
-
Enums_1.TrackPartial.CustomData,
|
|
55
48
|
];
|
|
56
49
|
/** The array of property names that will be removed from the Track class */
|
|
57
50
|
this.trackPartial = Array.from(new Set([...defaultProperties, ...partial]));
|