aqualink 1.7.0-beta1 → 1.7.0-beta3

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.
@@ -243,9 +243,15 @@ class Node {
243
243
  #reconnect() {
244
244
  if (this.infiniteReconnects) {
245
245
  this.aqua.emit("nodeReconnect", this, console.log("Experimental infinite reconnects enabled, will be trying non-stop..."));
246
- this.connect();
246
+ setTimeout(() => {
247
+ this.connect();
248
+ }, 10000);
247
249
  return;
248
250
  }
251
+
252
+ if (this.connected) {
253
+ clearTimeout(this.reconnectTimeoutId);
254
+ }
249
255
  if (++this.#reconnectAttempted >= this.reconnectTries) {
250
256
  this.aqua.emit("nodeError", this, new Error(`Max reconnection attempts reached (${this.reconnectTries})`));
251
257
  clearTimeout(this.reconnectTimeoutId);
@@ -294,4 +300,4 @@ class Node {
294
300
  }
295
301
  }
296
302
 
297
- module.exports = { Node };
303
+ module.exports = { Node };
@@ -49,6 +49,10 @@ class Player extends EventEmitter {
49
49
  return this.previousTracks.length ? this.previousTracks[0] : null;
50
50
  }
51
51
 
52
+ get currenttrack() {
53
+ return this.current;
54
+ }
55
+
52
56
  addToPreviousTrack(track) {
53
57
  if (this.previousTracks.length >= 50) {
54
58
  this.previousTracks.pop();
@@ -102,10 +106,13 @@ class Player extends EventEmitter {
102
106
  }
103
107
 
104
108
  seek(position) {
105
- if (position < 0) throw new Error("Seek position cannot be negative.");
106
- if (!this.playing) return this;
107
- this.position = position;
108
- this.updatePlayer({ position });
109
+ if (!this.playing) return this;
110
+ const newPosition = this.position + position;
111
+ if (newPosition < 0) {
112
+ throw new Error("Seek position cannot be negative.");
113
+ }
114
+ this.position = newPosition;
115
+ this.updatePlayer({ position: this.position });
109
116
  return this;
110
117
  }
111
118
 
@@ -220,7 +227,6 @@ class Player extends EventEmitter {
220
227
  try {
221
228
  await this.nowPlayingMessage.delete();
222
229
  } catch (error) {
223
- // Consider logging specific errors
224
230
  } finally {
225
231
  this.nowPlayingMessage = null;
226
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aqualink",
3
- "version": "1.7.0-beta1",
3
+ "version": "1.7.0-beta3",
4
4
  "description": "An Lavalink wrapper, focused in speed, performance, and features, Based in Riffy!",
5
5
  "main": "build/index.js",
6
6
  "scripts": {