Skip to content

Commit

Permalink
fix: sending the tracks to the node
Browse files Browse the repository at this point in the history
This commit fixed an not harmful issue that would send the entire "tracks" object to the node.
  • Loading branch information
ThePedroo committed Feb 9, 2024
1 parent a3158a8 commit 6c42ad3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)'
}
})

Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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', () => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 6c42ad3

Please sign in to comment.