muthera 1.0.12 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muthera",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "A simple Lavalink wrapper for Discord music bot. Forked from Niizuki.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -27,7 +27,9 @@ class Connection {
27
27
  this.region = endpoint.split(".").shift()?.replace(/[0-9]/g, "") || null;
28
28
 
29
29
  setTimeout(() => {
30
- this.player.pause(false)
30
+ if (this.player.current) {
31
+ this.player.pause(false);
32
+ }
31
33
  }, 5000);
32
34
 
33
35
  this.updatePlayerVoiceData();
@@ -572,9 +572,9 @@ class Player extends EventEmitter {
572
572
  }
573
573
 
574
574
  trackEnd(player, track, payload) {
575
- // If the track ended due to an error (loadFailed), trackError() already
575
+ // If the track ended due to an error (loadFailed, LOAD_FAILED), trackError() already
576
576
  // handled advancing the queue / emitting queueEnd. Skip to avoid double handling.
577
- if (payload.reason === "loadFailed") return;
577
+ if (payload.reason === "loadFailed" || payload.reason === "LOAD_FAILED" || track.isErrored || payload.reason === "cleanup") return;
578
578
 
579
579
  this.previous = track;
580
580
  if (this.loop === "track") {
@@ -599,6 +599,7 @@ class Player extends EventEmitter {
599
599
  }
600
600
 
601
601
  async trackError(player, track, payload) {
602
+ track.isErrored = true;
602
603
  this.muthera.emit("trackError", player, track, payload);
603
604
  this.playing = false;
604
605
  this.previous = track;
@@ -610,6 +611,7 @@ class Player extends EventEmitter {
610
611
  }
611
612
 
612
613
  async trackStuck(player, track, payload) {
614
+ track.isErrored = true;
613
615
  this.muthera.emit("trackStuck", player, track, payload);
614
616
  this.playing = false;
615
617
  this.previous = track;