Skip to content

Commit 6c42ad3

Browse files
committed
fix: sending the tracks to the node
This commit fixed an not harmful issue that would send the entire "tracks" object to the node.
1 parent a3158a8 commit 6c42ad3

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function connectNodes(nodes, config) {
6767
Authorization: node.password,
6868
'Num-Shards': config.shards,
6969
'User-Id': config.botId,
70-
'Client-Name': 'FastLink/2.4.0'
70+
'Client-Name': 'FastLink/2.4.1 (https://github.com/PerformanC/FastLink)'
7171
}
7272
})
7373

@@ -260,13 +260,15 @@ class Player {
260260

261261
if (Players[this.guildId].queue.length === 0) {
262262
Players[this.guildId].queue = body.tracks.encodeds
263+
264+
delete body.tracks
263265

264266
this.makeRequest(`/sessions/${Nodes[this.node].sessionId}/players/${this.guildId}`, {
265267
body: {
266268
...body,
267269
track: {
268270
...body.track,
269-
encoded: body.tracks.encodeds[0]
271+
encoded: Players[this.guildId].queue[0]
270272
}
271273
},
272274
method: 'PATCH'
@@ -435,7 +437,7 @@ class Player {
435437
Authorization: Nodes[this.node].password,
436438
'user-id': Config.botId,
437439
'guild-id': this.guildId,
438-
'Client-Name': 'FastLink/2.4.0'
440+
'Client-Name': 'FastLink/2.4.1 (https://github.com/PerformanC/FastLink)'
439441
}
440442
})
441443
.on('open', () => {

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@performanc/fastlink",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"description": "Low-level Lavalink/NodeLink wrapper.",
55
"main": "index.js",
66
"type": "module",

0 commit comments

Comments
 (0)