magmastream 2.9.0-dev.43 → 2.9.0-dev.44
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
|
@@ -2441,13 +2441,6 @@ declare class Manager extends EventEmitter {
|
|
|
2441
2441
|
* @returns The player if it exists, undefined otherwise.
|
|
2442
2442
|
*/
|
|
2443
2443
|
getPlayer(guildId: string): Player | undefined;
|
|
2444
|
-
/**
|
|
2445
|
-
* @deprecated - Will be removed with v2.10.0 use {@link getPlayer} instead
|
|
2446
|
-
* Returns a player or undefined if it does not exist.
|
|
2447
|
-
* @param guildId The guild ID of the player to retrieve.
|
|
2448
|
-
* @returns The player if it exists, undefined otherwise.
|
|
2449
|
-
*/
|
|
2450
|
-
get(guildId: string): Promise<Player | undefined>;
|
|
2451
2444
|
/**
|
|
2452
2445
|
* Creates a player or returns one if it already exists.
|
|
2453
2446
|
* @param options The options to create the player with.
|
|
@@ -57,6 +57,7 @@ class JsonQueue {
|
|
|
57
57
|
* @param queue The queue.
|
|
58
58
|
*/
|
|
59
59
|
async setQueue(queue) {
|
|
60
|
+
await this.deleteFile(this.queuePath);
|
|
60
61
|
await this.writeJSON(this.queuePath, queue);
|
|
61
62
|
}
|
|
62
63
|
/**
|
|
@@ -132,6 +133,7 @@ class JsonQueue {
|
|
|
132
133
|
const tracks = Array.isArray(track) ? track : [track];
|
|
133
134
|
if (!tracks.length)
|
|
134
135
|
return;
|
|
136
|
+
await this.deleteFile(this.previousPath);
|
|
135
137
|
await this.writeJSON(this.previousPath, tracks);
|
|
136
138
|
}
|
|
137
139
|
/**
|
|
@@ -49,6 +49,7 @@ class Manager extends events_1.EventEmitter {
|
|
|
49
49
|
// Initialize structures
|
|
50
50
|
Utils_1.Structure.get("Player").init(this);
|
|
51
51
|
Utils_1.TrackUtils.init(this);
|
|
52
|
+
Utils_1.PlayerUtils.init(this);
|
|
52
53
|
if (options.trackPartial) {
|
|
53
54
|
Utils_1.TrackUtils.setTrackPartial(options.trackPartial);
|
|
54
55
|
delete options.trackPartial;
|
|
@@ -264,15 +265,6 @@ class Manager extends events_1.EventEmitter {
|
|
|
264
265
|
getPlayer(guildId) {
|
|
265
266
|
return this.players.get(guildId);
|
|
266
267
|
}
|
|
267
|
-
/**
|
|
268
|
-
* @deprecated - Will be removed with v2.10.0 use {@link getPlayer} instead
|
|
269
|
-
* Returns a player or undefined if it does not exist.
|
|
270
|
-
* @param guildId The guild ID of the player to retrieve.
|
|
271
|
-
* @returns The player if it exists, undefined otherwise.
|
|
272
|
-
*/
|
|
273
|
-
async get(guildId) {
|
|
274
|
-
return this.players.get(guildId);
|
|
275
|
-
}
|
|
276
268
|
/**
|
|
277
269
|
* Creates a player or returns one if it already exists.
|
|
278
270
|
* @param options The options to create the player with.
|
|
@@ -373,7 +365,7 @@ class Manager extends events_1.EventEmitter {
|
|
|
373
365
|
* @returns A promise that resolves to an array of TrackData objects.
|
|
374
366
|
* @throws Will throw an error if no nodes are available or if the API request fails.
|
|
375
367
|
*/
|
|
376
|
-
decodeTracks(tracks) {
|
|
368
|
+
async decodeTracks(tracks) {
|
|
377
369
|
this.emit(Enums_1.ManagerEventTypes.Debug, `[MANAGER] Decoding tracks: ${JSON.stringify(tracks)}`);
|
|
378
370
|
return new Promise(async (resolve, reject) => {
|
|
379
371
|
const node = this.nodes.first();
|