From 6c42ad3782c46d45f3f4c5631ae0efa0ed68d36c Mon Sep 17 00:00:00 2001 From: ThePedroo Date: Fri, 9 Feb 2024 01:08:03 -0300 Subject: [PATCH] fix: sending the `tracks` to the node This commit fixed an not harmful issue that would send the entire "tracks" object to the node. --- index.js | 8 +++++--- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 55590a1..28a3d64 100644 --- a/index.js +++ b/index.js @@ -67,7 +67,7 @@ function connectNodes(nodes, config) { Authorization: node.password, 'Num-Shards': config.shards, 'User-Id': config.botId, - 'Client-Name': 'FastLink/2.4.0' + 'Client-Name': 'FastLink/2.4.1 (https://github.com/PerformanC/FastLink)' } }) @@ -260,13 +260,15 @@ class Player { if (Players[this.guildId].queue.length === 0) { Players[this.guildId].queue = body.tracks.encodeds + + delete body.tracks this.makeRequest(`/sessions/${Nodes[this.node].sessionId}/players/${this.guildId}`, { body: { ...body, track: { ...body.track, - encoded: body.tracks.encodeds[0] + encoded: Players[this.guildId].queue[0] } }, method: 'PATCH' @@ -435,7 +437,7 @@ class Player { Authorization: Nodes[this.node].password, 'user-id': Config.botId, 'guild-id': this.guildId, - 'Client-Name': 'FastLink/2.4.0' + 'Client-Name': 'FastLink/2.4.1 (https://github.com/PerformanC/FastLink)' } }) .on('open', () => { diff --git a/package-lock.json b/package-lock.json index 05eff4f..7f51318 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@performanc/fastlink", - "version": "2.4.0", + "version": "2.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@performanc/fastlink", - "version": "2.4.0", + "version": "2.4.1", "license": "SEE LICENSE IN LICENSE" } } diff --git a/package.json b/package.json index ab18904..1e107df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@performanc/fastlink", - "version": "2.4.0", + "version": "2.4.1", "description": "Low-level Lavalink/NodeLink wrapper.", "main": "index.js", "type": "module",