lavalink-client 1.2.1 → 1.2.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.
@@ -653,6 +653,7 @@ class LavalinkNode {
653
653
  }
654
654
  async trackStuck(player, track, payload) {
655
655
  this.NodeManager.LavalinkManager.emit("trackStuck", player, track, payload);
656
+ return; // trackEnd get's executed too
656
657
  // If there are no songs in the queue
657
658
  if (!player.queue.tracks.length && (player.repeatMode === "off" || player.get("internal_stopPlaying")))
658
659
  return this.queueEnd(player, track, payload);
@@ -666,6 +667,7 @@ class LavalinkNode {
666
667
  }
667
668
  async trackError(player, track, payload) {
668
669
  this.NodeManager.LavalinkManager.emit("trackError", player, track, payload);
670
+ return; // trackEnd get's executed too
669
671
  // If there are no songs in the queue
670
672
  if (!player.queue.tracks.length && (player.repeatMode === "off" || player.get("internal_stopPlaying")))
671
673
  return this.queueEnd(player, track, payload);
@@ -712,10 +714,10 @@ class LavalinkNode {
712
714
  if (segments.some(v => !exports.validSponsorBlocks.includes(v.toLowerCase())))
713
715
  throw new SyntaxError(`You provided a sponsorblock which isn't valid, valid ones are: ${exports.validSponsorBlocks.map(v => `'${v}'`).join(", ")}`);
714
716
  // do the request
715
- await this.request(`/sessions/${this.sessionId}/players/${player.guildId}/sponsorblock/categories`, (request) => {
716
- request.method = "PUT";
717
- request.body = JSON.stringify(segments.map(v => v.toLowerCase()));
718
- return request;
717
+ await this.request(`/sessions/${this.sessionId}/players/${player.guildId}/sponsorblock/categories`, (r) => {
718
+ r.method = "PUT";
719
+ r.headers = { Authorization: this.options.authorization, 'Content-Type': 'application/json' };
720
+ r.body = JSON.stringify(segments.map(v => v.toLowerCase()));
719
721
  });
720
722
  return;
721
723
  }
@@ -724,9 +726,8 @@ class LavalinkNode {
724
726
  if (!this.info.plugins.find(v => v.name === "sponsorblock-plugin"))
725
727
  throw new RangeError(`there is no sponsorblock-plugin available in the lavalink node: ${this.id}`);
726
728
  // do the request
727
- await this.request(`/sessions/${this.sessionId}/players/${player.guildId}/sponsorblock/categories`, (request) => {
728
- request.method = "DELETE";
729
- return request;
729
+ await this.request(`/sessions/${this.sessionId}/players/${player.guildId}/sponsorblock/categories`, (r) => {
730
+ r.method = "DELETE";
730
731
  });
731
732
  return;
732
733
  }
@@ -649,6 +649,7 @@ export class LavalinkNode {
649
649
  }
650
650
  async trackStuck(player, track, payload) {
651
651
  this.NodeManager.LavalinkManager.emit("trackStuck", player, track, payload);
652
+ return; // trackEnd get's executed too
652
653
  // If there are no songs in the queue
653
654
  if (!player.queue.tracks.length && (player.repeatMode === "off" || player.get("internal_stopPlaying")))
654
655
  return this.queueEnd(player, track, payload);
@@ -662,6 +663,7 @@ export class LavalinkNode {
662
663
  }
663
664
  async trackError(player, track, payload) {
664
665
  this.NodeManager.LavalinkManager.emit("trackError", player, track, payload);
666
+ return; // trackEnd get's executed too
665
667
  // If there are no songs in the queue
666
668
  if (!player.queue.tracks.length && (player.repeatMode === "off" || player.get("internal_stopPlaying")))
667
669
  return this.queueEnd(player, track, payload);
@@ -708,10 +710,10 @@ export class LavalinkNode {
708
710
  if (segments.some(v => !validSponsorBlocks.includes(v.toLowerCase())))
709
711
  throw new SyntaxError(`You provided a sponsorblock which isn't valid, valid ones are: ${validSponsorBlocks.map(v => `'${v}'`).join(", ")}`);
710
712
  // do the request
711
- await this.request(`/sessions/${this.sessionId}/players/${player.guildId}/sponsorblock/categories`, (request) => {
712
- request.method = "PUT";
713
- request.body = JSON.stringify(segments.map(v => v.toLowerCase()));
714
- return request;
713
+ await this.request(`/sessions/${this.sessionId}/players/${player.guildId}/sponsorblock/categories`, (r) => {
714
+ r.method = "PUT";
715
+ r.headers = { Authorization: this.options.authorization, 'Content-Type': 'application/json' };
716
+ r.body = JSON.stringify(segments.map(v => v.toLowerCase()));
715
717
  });
716
718
  return;
717
719
  }
@@ -720,9 +722,8 @@ export class LavalinkNode {
720
722
  if (!this.info.plugins.find(v => v.name === "sponsorblock-plugin"))
721
723
  throw new RangeError(`there is no sponsorblock-plugin available in the lavalink node: ${this.id}`);
722
724
  // do the request
723
- await this.request(`/sessions/${this.sessionId}/players/${player.guildId}/sponsorblock/categories`, (request) => {
724
- request.method = "DELETE";
725
- return request;
725
+ await this.request(`/sessions/${this.sessionId}/players/${player.guildId}/sponsorblock/categories`, (r) => {
726
+ r.method = "DELETE";
726
727
  });
727
728
  return;
728
729
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lavalink-client",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Easy, flexible and feature-rich lavalink@v4 Client. Both for Beginners and Proficients.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",