magmastream 2.9.3-dev.11 → 2.9.3-dev.12

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
@@ -337,6 +337,10 @@ declare class JsonQueue implements IQueue {
337
337
  * The base path for the queue files.
338
338
  */
339
339
  private basePath;
340
+ /**
341
+ * Whether the queue has been destroyed.
342
+ */
343
+ private destroyed;
340
344
  /**
341
345
  * @param guildId The guild ID.
342
346
  * @param manager The manager.
@@ -363,6 +367,11 @@ declare class JsonQueue implements IQueue {
363
367
  * Removes the first track from the queue.
364
368
  */
365
369
  dequeue(): Promise<Track | undefined>;
370
+ /**
371
+ * Destroys the queue and releases all resources.
372
+ * After calling this method, the queue must not be used again.
373
+ */
374
+ destroy(): Promise<void>;
366
375
  /**
367
376
  * @returns The total duration of the queue.
368
377
  */
@@ -502,6 +511,10 @@ declare class MemoryQueue extends Array<Track> implements IQueue {
502
511
  manager: Manager;
503
512
  /** The guild ID property. */
504
513
  guildId: string;
514
+ /**
515
+ * Whether the queue has been destroyed.
516
+ */
517
+ private destroyed;
505
518
  /**
506
519
  * Constructs a new Queue.
507
520
  * @param guildId The guild ID.
@@ -513,67 +526,72 @@ declare class MemoryQueue extends Array<Track> implements IQueue {
513
526
  * @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
514
527
  * @param [offset=null] The position to add the track(s) at. If not provided, the track(s) will be added at the end of the queue.
515
528
  */
516
- add(track: Track | Track[], offset?: number): Promise<void>;
529
+ add(track: Track | Track[], offset?: number): void;
517
530
  /**
518
531
  * Adds a track to the previous tracks.
519
532
  * @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
520
533
  */
521
- addPrevious(track: Track | Track[]): Promise<void>;
534
+ addPrevious(track: Track | Track[]): void;
522
535
  /**
523
536
  * Clears the queue.
524
537
  * This will remove all tracks from the queue and emit a state update event.
525
538
  */
526
- clear(): Promise<void>;
539
+ clear(): void;
527
540
  /**
528
541
  * Clears the previous tracks.
529
542
  */
530
- clearPrevious(): Promise<void>;
543
+ clearPrevious(): void;
531
544
  /**
532
545
  * Removes the first element from the queue.
533
546
  */
534
- dequeue(): Promise<Track | undefined>;
547
+ dequeue(): Track | undefined;
548
+ /**
549
+ * Destroys the queue and releases all resources.
550
+ * After calling this method, the queue must not be used again.
551
+ */
552
+ destroy(): void;
535
553
  /**
536
554
  * The total duration of the queue in milliseconds.
537
555
  * This includes the duration of the currently playing track.
538
556
  */
539
- duration(): Promise<number>;
557
+ duration(): number;
540
558
  /**
541
559
  * Adds the specified track or tracks to the front of the queue.
542
560
  * @param track The track or tracks to add.
543
561
  */
544
- enqueueFront(track: Track | Track[]): Promise<void>;
562
+ enqueueFront(track: Track | Track[]): void;
545
563
  /**
546
564
  * @returns Whether all elements in the queue satisfy the provided testing function.
547
565
  */
548
- everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
566
+ everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): boolean;
549
567
  /**
550
568
  * @returns A new array with all elements that pass the test implemented by the provided function.
551
569
  */
552
- filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track[]>;
570
+ filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Track[];
553
571
  /**
554
572
  * @returns The first element in the queue that satisfies the provided testing function.
555
573
  */
556
- findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track | undefined>;
574
+ findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Track | undefined;
557
575
  /**
558
576
  * @returns The current track.
559
577
  */
560
- getCurrent(): Promise<Track | null>;
578
+ getCurrent(): Track | null;
561
579
  /**
562
580
  * @returns The previous tracks.
563
581
  */
564
- getPrevious(): Promise<Track[]>;
582
+ getPrevious(): Track[];
565
583
  /**
566
584
  * @returns The tracks in the queue from start to end.
567
585
  */
568
- getSlice(start?: number, end?: number): Promise<Track[]>;
586
+ getSlice(start?: number, end?: number): Track[];
569
587
  /**
570
588
  * @returns The tracks in the queue.
571
589
  */
572
- getTracks(): Promise<Track[]>;
590
+ getTracks(): Track[];
573
591
  /**
574
592
  * @returns A new array with the results of calling a provided function on every element in the queue.
575
593
  */
576
- mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): Promise<T[]>;
594
+ mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): T[];
577
595
  /**
578
596
  * Modifies the queue at the specified index.
579
597
  * @param start The index at which to start modifying the queue.
@@ -581,11 +599,11 @@ declare class MemoryQueue extends Array<Track> implements IQueue {
581
599
  * @param items The elements to add to the queue.
582
600
  * @returns The modified queue.
583
601
  */
584
- modifyAt(start: number, deleteCount?: number, ...items: Track[]): Promise<Track[]>;
602
+ modifyAt(start: number, deleteCount?: number, ...items: Track[]): Track[];
585
603
  /**
586
604
  * @returns The newest track.
587
605
  */
588
- popPrevious(): Promise<Track | null>;
606
+ popPrevious(): Track | null;
589
607
  /**
590
608
  * Removes track(s) from the queue.
591
609
  * @param startOrPosition If a single number is provided, it will be treated as the position of the track to remove.
@@ -593,45 +611,45 @@ declare class MemoryQueue extends Array<Track> implements IQueue {
593
611
  * @param end Optional, end of the range of tracks to remove.
594
612
  * @returns The removed track(s).
595
613
  */
596
- remove(position?: number): Promise<Track[]>;
597
- remove(start: number, end: number): Promise<Track[]>;
614
+ remove(position?: number): Track[];
615
+ remove(start: number, end: number): Track[];
598
616
  /**
599
617
  * Shuffles the queue to play tracks requested by each user one by one.
600
618
  */
601
- roundRobinShuffle(): Promise<void>;
619
+ roundRobinShuffle(): void;
602
620
  /**
603
621
  * @param track The track to set.
604
622
  */
605
- setCurrent(track: Track | null): Promise<void>;
623
+ setCurrent(track: Track | null): void;
606
624
  /**
607
625
  * @param tracks The tracks to set.
608
626
  */
609
- setPrevious(tracks: Track[]): Promise<void>;
627
+ setPrevious(tracks: Track[]): void;
610
628
  /**
611
629
  * Shuffles the queue.
612
630
  * This will randomize the order of the tracks in the queue and emit a state update event.
613
631
  */
614
- shuffle(): Promise<void>;
632
+ shuffle(): void;
615
633
  /**
616
634
  * The size of tracks in the queue.
617
635
  * This does not include the currently playing track.
618
636
  * @returns The size of tracks in the queue.
619
637
  */
620
- size(): Promise<number>;
638
+ size(): number;
621
639
  /**
622
640
  * @returns Whether at least one element in the queue satisfies the provided testing function.
623
641
  */
624
- someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
642
+ someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): boolean;
625
643
  /**
626
644
  * The total size of tracks in the queue including the current track.
627
645
  * This includes the current track if it is not null.
628
646
  * @returns The total size of tracks in the queue including the current track.
629
647
  */
630
- totalSize(): Promise<number>;
648
+ totalSize(): number;
631
649
  /**
632
650
  * Shuffles the queue to play tracks requested by each user one block at a time.
633
651
  */
634
- userBlockShuffle(): Promise<void>;
652
+ userBlockShuffle(): void;
635
653
  }
636
654
 
637
655
  /**
@@ -648,6 +666,10 @@ declare class RedisQueue implements IQueue {
648
666
  * The Redis instance.
649
667
  */
650
668
  private redis;
669
+ /**
670
+ * Whether the queue has been destroyed.
671
+ */
672
+ private destroyed;
651
673
  /**
652
674
  * Constructs a new RedisQueue.
653
675
  * @param guildId The guild ID.
@@ -677,6 +699,11 @@ declare class RedisQueue implements IQueue {
677
699
  * Removes the first track from the queue.
678
700
  */
679
701
  dequeue(): Promise<Track | undefined>;
702
+ /**
703
+ * Destroys the queue and releases all resources.
704
+ * After calling this method, the queue must not be used again.
705
+ */
706
+ destroy(): Promise<void>;
680
707
  /**
681
708
  * @returns The total duration of the queue in milliseconds.
682
709
  * This includes the duration of the currently playing track.
@@ -1951,33 +1978,34 @@ interface ReverbOptions {
1951
1978
  * Queue interface
1952
1979
  */
1953
1980
  interface IQueue {
1954
- getCurrent(): Promise<Track | null>;
1955
- setCurrent(track: Track | null): Promise<void>;
1956
- getPrevious(): Promise<Track[]>;
1957
- addPrevious(track: Track | Track[]): Promise<void>;
1958
- setPrevious(track: Track | Track[]): Promise<void>;
1981
+ getCurrent(): Track | Promise<Track | null>;
1982
+ setCurrent(track: Track | null): void | Promise<void>;
1983
+ getPrevious(): Track[] | Promise<Track[]>;
1984
+ addPrevious(track: Track | Track[]): void | Promise<void>;
1985
+ setPrevious(track: Track | Track[]): void | Promise<void>;
1959
1986
  /** Get newest track (index 0) */
1960
- popPrevious(): Promise<Track | null>;
1961
- clearPrevious(): Promise<void>;
1962
- size(): Promise<number>;
1963
- totalSize(): Promise<number>;
1964
- duration(): Promise<number>;
1965
- add(track: Track | Track[], offset?: number): Promise<void>;
1966
- remove(start?: number, end?: number): Promise<Track[]>;
1967
- clear(): Promise<void>;
1968
- dequeue(): Promise<Track | undefined>;
1969
- enqueueFront(track: Track | Track[]): Promise<void>;
1970
- getTracks(): Promise<Track[]>;
1971
- getSlice(start?: number, end?: number): Promise<Track[]>;
1972
- modifyAt(start: number, deleteCount?: number, ...items: Track[]): Promise<Track[]>;
1973
- shuffle(): Promise<void>;
1974
- userBlockShuffle(): Promise<void>;
1975
- roundRobinShuffle(): Promise<void>;
1976
- mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): Promise<T[]>;
1977
- filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track[]>;
1978
- findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<Track | undefined>;
1979
- someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
1980
- everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Promise<boolean>;
1987
+ popPrevious(): Track | Promise<Track | null>;
1988
+ clearPrevious(): void | Promise<void>;
1989
+ size(): number | Promise<number>;
1990
+ totalSize(): number | Promise<number>;
1991
+ duration(): number | Promise<number>;
1992
+ add(track: Track | Track[], offset?: number): void | Promise<void>;
1993
+ remove(start?: number, end?: number): Track[] | Promise<Track[]>;
1994
+ clear(): void | Promise<void>;
1995
+ dequeue(): Track | Promise<Track | undefined>;
1996
+ enqueueFront(track: Track | Track[]): void | Promise<void>;
1997
+ getTracks(): Track[] | Promise<Track[]>;
1998
+ getSlice(start?: number, end?: number): Track[] | Promise<Track[]>;
1999
+ modifyAt(start: number, deleteCount?: number, ...items: Track[]): Track[] | Promise<Track[]>;
2000
+ shuffle(): void | Promise<void>;
2001
+ userBlockShuffle(): void | Promise<void>;
2002
+ roundRobinShuffle(): void | Promise<void>;
2003
+ mapAsync<T>(callback: (track: Track, index: number, array: Track[]) => T): T[] | Promise<T[]>;
2004
+ filterAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Track[] | Promise<Track[]>;
2005
+ findAsync(callback: (track: Track, index: number, array: Track[]) => boolean): Track | Promise<Track | undefined>;
2006
+ someAsync(callback: (track: Track, index: number, array: Track[]) => boolean): boolean | Promise<boolean>;
2007
+ everyAsync(callback: (track: Track, index: number, array: Track[]) => boolean): boolean | Promise<boolean>;
2008
+ destroy(): void | Promise<void>;
1981
2009
  }
1982
2010
  /**
1983
2011
  * Sizes Enum type
@@ -17,6 +17,10 @@ class JsonQueue {
17
17
  * The base path for the queue files.
18
18
  */
19
19
  basePath;
20
+ /**
21
+ * Whether the queue has been destroyed.
22
+ */
23
+ destroyed = false;
20
24
  /**
21
25
  * @param guildId The guild ID.
22
26
  * @param manager The manager.
@@ -172,6 +176,27 @@ class JsonQueue {
172
176
  console.error(error);
173
177
  }
174
178
  }
179
+ /**
180
+ * Destroys the queue and releases all resources.
181
+ * After calling this method, the queue must not be used again.
182
+ */
183
+ async destroy() {
184
+ if (this.destroyed)
185
+ return;
186
+ this.destroyed = true;
187
+ try {
188
+ await Promise.all([this.deleteFile(this.queuePath), this.deleteFile(this.currentPath), this.deleteFile(this.previousPath)]);
189
+ }
190
+ catch (err) {
191
+ console.error(err instanceof MagmastreamError_1.MagmaStreamError
192
+ ? err
193
+ : new MagmastreamError_1.MagmaStreamError({
194
+ code: Enums_1.MagmaStreamErrorCode.QUEUE_JSON_ERROR,
195
+ message: `Failed to destroy JSONQueue for guild ${this.guildId}`,
196
+ cause: err,
197
+ }));
198
+ }
199
+ }
175
200
  /**
176
201
  * @returns The total duration of the queue.
177
202
  */
@@ -16,6 +16,10 @@ class MemoryQueue extends Array {
16
16
  manager;
17
17
  /** The guild ID property. */
18
18
  guildId;
19
+ /**
20
+ * Whether the queue has been destroyed.
21
+ */
22
+ destroyed = false;
19
23
  /**
20
24
  * Constructs a new Queue.
21
25
  * @param guildId The guild ID.
@@ -34,7 +38,7 @@ class MemoryQueue extends Array {
34
38
  * @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
35
39
  * @param [offset=null] The position to add the track(s) at. If not provided, the track(s) will be added at the end of the queue.
36
40
  */
37
- async add(track, offset) {
41
+ add(track, offset) {
38
42
  try {
39
43
  const isArray = Array.isArray(track);
40
44
  const tracks = isArray ? [...track] : [track];
@@ -122,7 +126,7 @@ class MemoryQueue extends Array {
122
126
  * Adds a track to the previous tracks.
123
127
  * @param track The track or tracks to add. Can be a single `Track` or an array of `Track`s.
124
128
  */
125
- async addPrevious(track) {
129
+ addPrevious(track) {
126
130
  try {
127
131
  const max = this.manager.options.maxPreviousTracks;
128
132
  if (Array.isArray(track)) {
@@ -154,7 +158,7 @@ class MemoryQueue extends Array {
154
158
  * Clears the queue.
155
159
  * This will remove all tracks from the queue and emit a state update event.
156
160
  */
157
- async clear() {
161
+ clear() {
158
162
  try {
159
163
  // Capture the current state of the player for event emission.
160
164
  const oldPlayer = this.manager.players.get(this.guildId) ? { ...this.manager.players.get(this.guildId) } : null;
@@ -186,20 +190,33 @@ class MemoryQueue extends Array {
186
190
  /**
187
191
  * Clears the previous tracks.
188
192
  */
189
- async clearPrevious() {
193
+ clearPrevious() {
190
194
  this.previous = [];
191
195
  }
192
196
  /**
193
197
  * Removes the first element from the queue.
194
198
  */
195
- async dequeue() {
199
+ dequeue() {
196
200
  return super.shift();
197
201
  }
202
+ /**
203
+ * Destroys the queue and releases all resources.
204
+ * After calling this method, the queue must not be used again.
205
+ */
206
+ destroy() {
207
+ if (this.destroyed)
208
+ return;
209
+ this.destroyed = true;
210
+ this.splice(0);
211
+ this.previous.length = 0;
212
+ this.current = null;
213
+ this.manager = null;
214
+ }
198
215
  /**
199
216
  * The total duration of the queue in milliseconds.
200
217
  * This includes the duration of the currently playing track.
201
218
  */
202
- async duration() {
219
+ duration() {
203
220
  const current = this.current?.duration ?? 0;
204
221
  return this.reduce((acc, cur) => acc + (cur.duration || 0), current);
205
222
  }
@@ -207,7 +224,7 @@ class MemoryQueue extends Array {
207
224
  * Adds the specified track or tracks to the front of the queue.
208
225
  * @param track The track or tracks to add.
209
226
  */
210
- async enqueueFront(track) {
227
+ enqueueFront(track) {
211
228
  if (Array.isArray(track)) {
212
229
  this.unshift(...track);
213
230
  }
@@ -218,49 +235,49 @@ class MemoryQueue extends Array {
218
235
  /**
219
236
  * @returns Whether all elements in the queue satisfy the provided testing function.
220
237
  */
221
- async everyAsync(callback) {
238
+ everyAsync(callback) {
222
239
  return this.every(callback);
223
240
  }
224
241
  /**
225
242
  * @returns A new array with all elements that pass the test implemented by the provided function.
226
243
  */
227
- async filterAsync(callback) {
244
+ filterAsync(callback) {
228
245
  return this.filter(callback);
229
246
  }
230
247
  /**
231
248
  * @returns The first element in the queue that satisfies the provided testing function.
232
249
  */
233
- async findAsync(callback) {
250
+ findAsync(callback) {
234
251
  return this.find(callback);
235
252
  }
236
253
  /**
237
254
  * @returns The current track.
238
255
  */
239
- async getCurrent() {
256
+ getCurrent() {
240
257
  return this.current;
241
258
  }
242
259
  /**
243
260
  * @returns The previous tracks.
244
261
  */
245
- async getPrevious() {
262
+ getPrevious() {
246
263
  return [...this.previous];
247
264
  }
248
265
  /**
249
266
  * @returns The tracks in the queue from start to end.
250
267
  */
251
- async getSlice(start, end) {
268
+ getSlice(start, end) {
252
269
  return this.slice(start, end); // Native sync method, still wrapped in a Promise
253
270
  }
254
271
  /**
255
272
  * @returns The tracks in the queue.
256
273
  */
257
- async getTracks() {
274
+ getTracks() {
258
275
  return [...this]; // clone to avoid direct mutation
259
276
  }
260
277
  /**
261
278
  * @returns A new array with the results of calling a provided function on every element in the queue.
262
279
  */
263
- async mapAsync(callback) {
280
+ mapAsync(callback) {
264
281
  return this.map(callback);
265
282
  }
266
283
  /**
@@ -270,16 +287,16 @@ class MemoryQueue extends Array {
270
287
  * @param items The elements to add to the queue.
271
288
  * @returns The modified queue.
272
289
  */
273
- async modifyAt(start, deleteCount = 0, ...items) {
290
+ modifyAt(start, deleteCount = 0, ...items) {
274
291
  return super.splice(start, deleteCount, ...items);
275
292
  }
276
293
  /**
277
294
  * @returns The newest track.
278
295
  */
279
- async popPrevious() {
296
+ popPrevious() {
280
297
  return this.previous.pop() || null; // get newest track
281
298
  }
282
- async remove(startOrPosition = 0, end) {
299
+ remove(startOrPosition = 0, end) {
283
300
  try {
284
301
  const oldPlayer = this.manager.players.get(this.guildId) ? { ...this.manager.players.get(this.guildId) } : null;
285
302
  if (typeof end !== "undefined") {
@@ -331,7 +348,7 @@ class MemoryQueue extends Array {
331
348
  /**
332
349
  * Shuffles the queue to play tracks requested by each user one by one.
333
350
  */
334
- async roundRobinShuffle() {
351
+ roundRobinShuffle() {
335
352
  try {
336
353
  // Capture the current state of the player for event emission.
337
354
  const oldPlayer = this.manager.players.get(this.guildId) ? { ...this.manager.players.get(this.guildId) } : null;
@@ -394,20 +411,20 @@ class MemoryQueue extends Array {
394
411
  /**
395
412
  * @param track The track to set.
396
413
  */
397
- async setCurrent(track) {
414
+ setCurrent(track) {
398
415
  this.current = track;
399
416
  }
400
417
  /**
401
418
  * @param tracks The tracks to set.
402
419
  */
403
- async setPrevious(tracks) {
420
+ setPrevious(tracks) {
404
421
  this.previous = [...tracks];
405
422
  }
406
423
  /**
407
424
  * Shuffles the queue.
408
425
  * This will randomize the order of the tracks in the queue and emit a state update event.
409
426
  */
410
- async shuffle() {
427
+ shuffle() {
411
428
  try {
412
429
  // Capture the current state of the player for event emission.
413
430
  const oldPlayer = this.manager.players.get(this.guildId) ? { ...this.manager.players.get(this.guildId) } : null;
@@ -443,13 +460,13 @@ class MemoryQueue extends Array {
443
460
  * This does not include the currently playing track.
444
461
  * @returns The size of tracks in the queue.
445
462
  */
446
- async size() {
463
+ size() {
447
464
  return this.length;
448
465
  }
449
466
  /**
450
467
  * @returns Whether at least one element in the queue satisfies the provided testing function.
451
468
  */
452
- async someAsync(callback) {
469
+ someAsync(callback) {
453
470
  return this.some(callback);
454
471
  }
455
472
  /**
@@ -457,13 +474,13 @@ class MemoryQueue extends Array {
457
474
  * This includes the current track if it is not null.
458
475
  * @returns The total size of tracks in the queue including the current track.
459
476
  */
460
- async totalSize() {
477
+ totalSize() {
461
478
  return this.length + (this.current ? 1 : 0);
462
479
  }
463
480
  /**
464
481
  * Shuffles the queue to play tracks requested by each user one block at a time.
465
482
  */
466
- async userBlockShuffle() {
483
+ userBlockShuffle() {
467
484
  try {
468
485
  // Capture the current state of the player for event emission.
469
486
  const oldPlayer = this.manager.players.get(this.guildId) ? { ...this.manager.players.get(this.guildId) } : null;
@@ -18,6 +18,10 @@ class RedisQueue {
18
18
  * The Redis instance.
19
19
  */
20
20
  redis;
21
+ /**
22
+ * Whether the queue has been destroyed.
23
+ */
24
+ destroyed = false;
21
25
  /**
22
26
  * Constructs a new RedisQueue.
23
27
  * @param guildId The guild ID.
@@ -222,6 +226,28 @@ class RedisQueue {
222
226
  console.error(error);
223
227
  }
224
228
  }
229
+ /**
230
+ * Destroys the queue and releases all resources.
231
+ * After calling this method, the queue must not be used again.
232
+ */
233
+ async destroy() {
234
+ if (this.destroyed)
235
+ return;
236
+ this.destroyed = true;
237
+ try {
238
+ await this.redis.del(this.queueKey, this.previousKey, this.currentKey);
239
+ }
240
+ catch (err) {
241
+ const error = err instanceof MagmastreamError_1.MagmaStreamError
242
+ ? err
243
+ : new MagmastreamError_1.MagmaStreamError({
244
+ code: Enums_1.MagmaStreamErrorCode.QUEUE_REDIS_ERROR,
245
+ message: `Failed to destroy RedisQueue for guild ${this.guildId}: ${err.message}`,
246
+ cause: err,
247
+ });
248
+ console.error(error);
249
+ }
250
+ }
225
251
  /**
226
252
  * @returns The total duration of the queue in milliseconds.
227
253
  * This includes the duration of the currently playing track.
@@ -273,9 +273,7 @@ class Player {
273
273
  this.voiceReceiverWsClient.close();
274
274
  this.voiceReceiverWsClient = null;
275
275
  }
276
- await this.queue.clear();
277
- await this.queue.clearPrevious();
278
- await this.queue.setCurrent(null);
276
+ await this.queue.destroy();
279
277
  if (disconnect) {
280
278
  await this.disconnect().catch(() => { });
281
279
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "magmastream",
3
- "version": "2.9.3-dev.11",
3
+ "version": "2.9.3-dev.12",
4
4
  "description": "A user-friendly Lavalink client designed for NodeJS.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "lint": "eslint \"src/**/*.{ts,js}\"",
16
16
  "lint:fix": "eslint --fix \"src/**/*.{ts,js}\"",
17
17
  "ci": "run-s format:check lint build types",
18
- "release:dev": "npm run format && npm run lint:fix && npm run ci && npm version prerelease --preid=dev && npm publish --tag dev"
18
+ "release:dev": "npm run format && npm run lint:fix && npm run ci && npm version prerelease --preid=dev && git push && npm publish --tag dev"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@favware/rollup-type-bundler": "^4.0.0",