Some Problems Migrating to v5

Hey all, sorry this is probably a very stupid post, I haven’t touched this in over a year and I learned about Lavalink v4 and Lavaclient v5 being released After getting errors with searches returning 400 errors and whatnot, I decided to migrate my discord bot from Lavalink v3 and Lavaclient v4. I’ve come into many problems with this migration but I had a few I wasn’t sure about and I didn’t find any documentation for migrating. From what I can tell, @lavaclient/queue, @lavaclient/types, and @lavaclient/spotify are all deprecated and don’t work anymore? Are there any alternatives yet for these I can begin to implement into Lavaclient? My main errors now lie with these packages no longer working I don’t have much Java experience as someone mentioned Lavalink plug-ins to me, but I’d be terrible at those I was also told possibly about LavaSrc, but I’m not sure how I’d go at implementing that client side too. Again thank you! Sorry if this seems like a horribly stupid question, it’s been a while since I’ve touched JS
50 Replies
viztea
viztea4mo ago
hi
From what I can tell, @lavaclient/queue, @lavaclient/types, [...] are all deprecated and don’t work anymore?
The queue plugin is being rewritten since it kinda sucks, there's a port at @lavaclient/plugin-queue types has been rewritten to support runtime validation at lavalink-protocol
and @lavaclient/spotify...
As you've already mentioned, LavaSrc exists. I still believe client-side fetching is better all around but LavaSrc will be faster.
but I’m not sure how I’d go at implementing that client side too.
You just call the load tracks endpoint like any other query
JackW25
JackW254mo ago
Ah okay thank you! So (again sorry for my stupidity), besides these changes there isn’t really any other major or breaking changes I should have to worry about, besides just updating to accommodate for these?
viztea
viztea4mo ago
depends on what you mean v5 is an entire rewrite check the pinned messages in the project discussion thread
JackW25
JackW254mo ago
I've been fairly busy lately, in a new career and all over the place but I recently took over this project from a friend. It's been a while since I've touched lavaclient or much NodeJS for that matter, so I'm getting stuck quite easily haha. Sorry for my ignorance I checked out the pinned thread which seems like most the information I'll need once I figure out how to talk with Lavalink now. So most of what I'm needing to figure out is how to update the rest of my code, how to find existing players, create a player, pass track data, etc. etc. One of the issues I've had troubles with specifically is dealing with players. Especially in regards to starting a queue and whatnot. Simply doing:
player.queue.add(tracks, {
requester: interaction.user.id
});
player.queue.add(tracks, {
requester: interaction.user.id
});
Won't work, so I'm having some difficulties trying to figure out the new system for players, queue, etc.
viztea
viztea4mo ago
player.queue.start starts the queue
JackW25
JackW254mo ago
Ah okay thank you, so there shouldn’t be much difference with controlling the players and queue?
viztea
viztea4mo ago
no not really
JackW25
JackW254mo ago
Alright that should help thank you! This is all quite new for me again as the last time I worked with lavaclient must’ve been over a year ago. By change is there any form of docs or whatnot for the player, queue, etc., I can refer to? Just getting caught on little things like players.get(GuildId) and whatnot. Thank you again!
viztea
viztea4mo ago
check the latest message in the pinned thread
JackW25
JackW254mo ago
Ah thank you very much I’ll take a look at these! Sorry again for my ignorance when it comes to this all
viztea
viztea4mo ago
it’s fine
JackW25
JackW254mo ago
Yeah I'm having tons of issues when trying to start queue and player and whatnot. Player will join the voice channel but stop there; not actually play the track. trackStart isn't at all being triggered, etc. Esp having difficulties with things like:
player.queue.add(tracks, {
requester: interaction.user.id
});
player.queue.add(tracks, {
requester: interaction.user.id
});
Which should in theory be a pretty easy task, just loading an array tracks populated with const track = results.data[0];, etc. Just given the serious issues I have with the time to do this, I'll probably have to find a new client or wait until there's more docs on this, I'm having trouble with all these simple functions even mentioned in those docs. Hopefully coming back to this in a bit should make it easier if either more is available on it or I can get the time to figure this out on my own
viztea
viztea4mo ago
I can't really do much without your code tbh https://github.com/lavaclient/lavaclient/tree/master/packages/test take a look at that, it's more of a testing playground than an example though although I haven't updated it yet, the djs v13 example may be helpful since it gives you an idea on how you should use the queue also W apple music user Could you send your lavalink logs too it may be more simple than something like misusing the library should've started at that tbf 🙃
JackW25
JackW254mo ago
Ah thank you I'll take a look at those As for my code, I'm happy to provide it, so far just working at the basics before adding in everything:
// index.js
const { getTranslations } = require('./utils/langUtil');
const { LavalinkAPIClient } = require('lavalink-api-client');
const { lava_host, lava_pass, userID } = require('./config.json');
const { Client, GatewayIntentBits, GatewayDispatchEvents } = require('discord.js');
const { Node } = require('lavaclient');

const client = new Client({
intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates ],
});

const lavaclient = new Node({
info: {
auth: lava_pass,
host: lava_host,
port: 2333
},
rest: {

},
ws: {
reconnecting: {
tries: Infinity

},
},
discord: {
sendGatewayCommand: (id, data) => client.guilds.cache.get(id)?.shard?.send(data),
userId: userID
},
});

module.exports = lavaclient;

client.ws.on(GatewayDispatchEvents.VoiceStateUpdate, (u) => lavaclient.players.handleVoiceUpdate(u));
client.ws.on(GatewayDispatchEvents.VoiceServerUpdate, (u) => lavaclient.players.handleVoiceUpdate(u));

// play.js
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const { getTranslations } = require('./utils/langUtil');
const { QueueTrackMessageIdsMap } = require('./utils/sharedData');

let query = interaction.options.get('query').value;
const player = lavaclient.players.resolve(interaction.guildId);

const results = await lavaclient.api.loadTracks(`ytsearch:${query}`);

if(results.loadType === "search") {
const track = results.data[0];
const tracks = [track];

if (!player) {
const player = lavaclient.createPlayer(interaction.guildId);
player.channel = interaction.channel;
console.log(interaction.channel.id);
await player.voice.connect(voiceChannel.id);
}

console.log(`Track: ${track.info.uri} / Track.name: ${track.info.title}`);
if (!QueueTrackMessageIdsMap.has(interaction.guildId)) {
QueueTrackMessageIdsMap.set(interaction.guildId, []);
}
QueueTrackMessageIdsMap.get(interaction.guildId).push(queueMessage.id);

player.queue.add(tracks, {
requester: interaction.user.id
});

await player.setVolume(50);
await player.queue.start();
console.log('Playing track');

player.queue.on('trackStart', async (queue, { title, uri, length, isSeekable, requester }) => {
// Send a message to user - bericht naar gebruiker
});

}
// index.js
const { getTranslations } = require('./utils/langUtil');
const { LavalinkAPIClient } = require('lavalink-api-client');
const { lava_host, lava_pass, userID } = require('./config.json');
const { Client, GatewayIntentBits, GatewayDispatchEvents } = require('discord.js');
const { Node } = require('lavaclient');

const client = new Client({
intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildVoiceStates ],
});

const lavaclient = new Node({
info: {
auth: lava_pass,
host: lava_host,
port: 2333
},
rest: {

},
ws: {
reconnecting: {
tries: Infinity

},
},
discord: {
sendGatewayCommand: (id, data) => client.guilds.cache.get(id)?.shard?.send(data),
userId: userID
},
});

module.exports = lavaclient;

client.ws.on(GatewayDispatchEvents.VoiceStateUpdate, (u) => lavaclient.players.handleVoiceUpdate(u));
client.ws.on(GatewayDispatchEvents.VoiceServerUpdate, (u) => lavaclient.players.handleVoiceUpdate(u));

// play.js
const { SlashCommandBuilder, EmbedBuilder } = require('discord.js');
const { getTranslations } = require('./utils/langUtil');
const { QueueTrackMessageIdsMap } = require('./utils/sharedData');

let query = interaction.options.get('query').value;
const player = lavaclient.players.resolve(interaction.guildId);

const results = await lavaclient.api.loadTracks(`ytsearch:${query}`);

if(results.loadType === "search") {
const track = results.data[0];
const tracks = [track];

if (!player) {
const player = lavaclient.createPlayer(interaction.guildId);
player.channel = interaction.channel;
console.log(interaction.channel.id);
await player.voice.connect(voiceChannel.id);
}

console.log(`Track: ${track.info.uri} / Track.name: ${track.info.title}`);
if (!QueueTrackMessageIdsMap.has(interaction.guildId)) {
QueueTrackMessageIdsMap.set(interaction.guildId, []);
}
QueueTrackMessageIdsMap.get(interaction.guildId).push(queueMessage.id);

player.queue.add(tracks, {
requester: interaction.user.id
});

await player.setVolume(50);
await player.queue.start();
console.log('Playing track');

player.queue.on('trackStart', async (queue, { title, uri, length, isSeekable, requester }) => {
// Send a message to user - bericht naar gebruiker
});

}
Lavalink Logs Show:
2024-04-05T22:45:54.258-07:00 INFO 8408 --- [ XNIO-1 task-2] lavalink.server.io.SocketServer : Connection successfully established from lavalink-ws-client v1.0.0
2024-04-05T22:45:54.550-07:00 INFO 8408 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/kp96zisfbylyli9l, client=192.168.1.98, payload={"resuming":true,"timeout":60000}
2024-04-05T22:46:09.045-07:00 INFO 8408 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "ytsearch:comfortably numb"
2024-04-05T22:46:09.606-07:00 INFO 8408 --- [ XNIO-1 task-2] lavalink.server.player.AudioLoader : Loaded playlist Search results for: comfortably numb
2024-04-05T22:46:09.668-07:00 INFO 8408 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/loadtracks?identifier=ytsearch%3Acomfortably+numb, client=192.168.1.98
2024-04-05T22:46:09.996-07:00 INFO 8408 --- [ XNIO-1 I/O-1] lavalink.server.io.SocketServer : Connection closed from /192.168.1.98:52673 with status CloseStatus[code=1006, reason=]
2024-04-05T22:45:54.258-07:00 INFO 8408 --- [ XNIO-1 task-2] lavalink.server.io.SocketServer : Connection successfully established from lavalink-ws-client v1.0.0
2024-04-05T22:45:54.550-07:00 INFO 8408 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/kp96zisfbylyli9l, client=192.168.1.98, payload={"resuming":true,"timeout":60000}
2024-04-05T22:46:09.045-07:00 INFO 8408 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "ytsearch:comfortably numb"
2024-04-05T22:46:09.606-07:00 INFO 8408 --- [ XNIO-1 task-2] lavalink.server.player.AudioLoader : Loaded playlist Search results for: comfortably numb
2024-04-05T22:46:09.668-07:00 INFO 8408 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/loadtracks?identifier=ytsearch%3Acomfortably+numb, client=192.168.1.98
2024-04-05T22:46:09.996-07:00 INFO 8408 --- [ XNIO-1 I/O-1] lavalink.server.io.SocketServer : Connection closed from /192.168.1.98:52673 with status CloseStatus[code=1006, reason=]
It's very likely I missed something, I'm not very thorough with these so I'd suspect its user error haha, also appreciate the Apple Music its great haha
viztea
viztea4mo ago
had to backtrack. these logs don't show the full process of connecting, loading track, creating a player, and updating it
JackW25
JackW254mo ago
This same bot account has been used with Lavalink v3 and Lavaclient v4 for a while before this, only thing that triggered the update was Lavaplayer giving 400 errors when returning search results from YouTube, so I figured the best fix would be upgrading
viztea
viztea4mo ago
did you disconnect after running the play command and stuff ahahahahaha i see i should really fix this LMFAO lavaclient#createPlayer is an internal method, it should only be overridden from the user, not called. use lavaclient#players#create instead
JackW25
JackW254mo ago
Took a SC of the Lavalink logs, might show a bit more here haha
No description
JackW25
JackW254mo ago
ah I'll try out that might be the issue
viztea
viztea4mo ago
createPlayer is just new Player(guildId, this) it doesn't register the player
JackW25
JackW254mo ago
Ah I see, replacing that line with
js
const player = lavaclient.players.create(interaction.guildId);
js
const player = lavaclient.players.create(interaction.guildId);
viztea
viztea4mo ago
yup
JackW25
JackW254mo ago
still seems to not want to play anything through voice, lavalink logs are all showing similar as to what they were before:
2024-04-05T22:55:46.746-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.HandshakeInterceptorImpl : Incoming connection from /192.168.1.98:53414
2024-04-05T22:55:46.746-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/websocket, client=192.168.1.98
2024-04-05T22:55:46.762-07:00 INFO 13028 --- [ XNIO-1 task-2] lavalink.server.io.SocketServer : Connection successfully established from lavalink-ws-client v1.0.0
2024-04-05T22:55:46.793-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/2inaqntiw937i3b1, client=192.168.1.98, payload={"resuming":true,"timeout":60000}
2024-04-05T22:55:54.686-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "ytsearch:comfortably numb"
2024-04-05T22:55:55.074-07:00 INFO 13028 --- [ XNIO-1 task-2] lavalink.server.player.AudioLoader : Loaded playlist Search results for: comfortably numb
2024-04-05T22:55:55.090-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/loadtracks?identifier=ytsearch%3Acomfortably+numb, client=192.168.1.98
2024-04-05T22:55:55.324-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/2inaqntiw937i3b1/players/889662048517124137?noReplace=false, client=192.168.1.98, payload={"volume":50}
2024-04-05T22:55:55.356-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/2inaqntiw937i3b1/players/889662048517124137?noReplace=false, client=192.168.1.98, payload={"track":{"encoded":"QAAArAMAEENvbWZvcnRhYmx5IE51bWIAClBpbmsgRmxveWQAAAAAAAXYGAALeC14VHR0aW1jTmsAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj14LXhUdHRpbWNOawEANGh0dHBzOi8vaS55dGltZy5jb20vdmkveC14VHR0aW1jTmsvbWF4cmVzZGVmYXVsdC5qcGcAAAd5b3V0dWJlAAAAAAAAAAA=","userData":{}}}
2024-04-05T22:55:46.746-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.HandshakeInterceptorImpl : Incoming connection from /192.168.1.98:53414
2024-04-05T22:55:46.746-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/websocket, client=192.168.1.98
2024-04-05T22:55:46.762-07:00 INFO 13028 --- [ XNIO-1 task-2] lavalink.server.io.SocketServer : Connection successfully established from lavalink-ws-client v1.0.0
2024-04-05T22:55:46.793-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/2inaqntiw937i3b1, client=192.168.1.98, payload={"resuming":true,"timeout":60000}
2024-04-05T22:55:54.686-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "ytsearch:comfortably numb"
2024-04-05T22:55:55.074-07:00 INFO 13028 --- [ XNIO-1 task-2] lavalink.server.player.AudioLoader : Loaded playlist Search results for: comfortably numb
2024-04-05T22:55:55.090-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/loadtracks?identifier=ytsearch%3Acomfortably+numb, client=192.168.1.98
2024-04-05T22:55:55.324-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/2inaqntiw937i3b1/players/889662048517124137?noReplace=false, client=192.168.1.98, payload={"volume":50}
2024-04-05T22:55:55.356-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/2inaqntiw937i3b1/players/889662048517124137?noReplace=false, client=192.168.1.98, payload={"track":{"encoded":"QAAArAMAEENvbWZvcnRhYmx5IE51bWIAClBpbmsgRmxveWQAAAAAAAXYGAALeC14VHR0aW1jTmsAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj14LXhUdHRpbWNOawEANGh0dHBzOi8vaS55dGltZy5jb20vdmkveC14VHR0aW1jTmsvbWF4cmVzZGVmYXVsdC5qcGcAAAd5b3V0dWJlAAAAAAAAAAA=","userData":{}}}
Although from before, it seems loading anything player.queue was undefined, like player.queue.start or player.queue.on, so I probably had an issue with how queue was defined from there, that was causing the immediate disconnect haha Thank you again for all this help I'm a total idiot when it comes to this stuff LMAO
viztea
viztea4mo ago
you need require("@lavaclient/plugin-queue/register") at the top of your index.js I'm not helping much either tbh
JackW25
JackW254mo ago
Ah I see, got the queue stuff working thank you! Despite doing that although and trying:
player.queue.add(tracks, {
requester: interaction.user.id
});

await player.setVolume(50);
await player.queue.start();
console.log('Playing track');
player.queue.add(tracks, {
requester: interaction.user.id
});

await player.setVolume(50);
await player.queue.start();
console.log('Playing track');
It still does not play the track, trackStart also doesn't seem to trigger Knowing me, prob my bad code haha
viztea
viztea4mo ago
lavalink logs
viztea
viztea4mo ago
GitHub
lavaclient/packages/test/src/index.ts at master · lavaclient/lavacl...
A simple, easy-to-use, and flexible lavalink client for node.js - lavaclient/lavaclient
viztea
viztea4mo ago
node.on("debug", event => ...);

node.on("request", event => {
const msg: unknown[] = [
"[rest]",
event.prepared.request.method,
event.prepared.url.pathname,
];

...
});
node.on("debug", event => ...);

node.on("request", event => {
const msg: unknown[] = [
"[rest]",
event.prepared.request.method,
event.prepared.url.pathname,
];

...
});
JackW25
JackW254mo ago
lavalink:
2024-04-05T23:07:40.590-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.HandshakeInterceptorImpl : Incoming connection from /192.168.1.98:54379
2024-04-05T23:07:40.606-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/websocket, client=192.168.1.98
2024-04-05T23:07:40.606-07:00 INFO 13028 --- [ XNIO-1 task-2] lavalink.server.io.SocketServer : Connection successfully established from lavalink-ws-client v1.0.0
2024-04-05T23:07:40.637-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/vvh67j4hyvzv60h4, client=192.168.1.98, payload={"resuming":true,"timeout":60000}
2024-04-05T23:07:45.496-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "ytsearch:list of people"
2024-04-05T23:07:45.856-07:00 INFO 13028 --- [ XNIO-1 task-2] lavalink.server.player.AudioLoader : Loaded playlist Search results for: list of people
2024-04-05T23:07:45.871-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/loadtracks?identifier=ytsearch%3Alist+of+people, client=192.168.1.98
2024-04-05T23:07:46.106-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/vvh67j4hyvzv60h4/players/889662048517124137?noReplace=false, client=192.168.1.98, payload={"volume":50}
2024-04-05T23:07:46.137-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/vvh67j4hyvzv60h4/players/889662048517124137?noReplace=false, client=192.168.1.98, payload={"track":{"encoded":"QAAA5AMAR1RhbWUgSW1wYWxhIC0gTGlzdCBvZiBQZW9wbGUgKFRvIFRyeSBhbmQgRm9yZ2V0IEFib3V0KSAoT2ZmaWNpYWwgQXVkaW8pAAtUYW1lIEltcGFsYQAAAAAABE2QAAtSd2FZZmxIQUlHUQABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PVJ3YVlmbEhBSUdRAQA0aHR0cHM6Ly9pLnl0aW1nLmNvbS92aS9Sd2FZZmxIQUlHUS9tYXhyZXNkZWZhdWx0LmpwZwAAB3lvdXR1YmUAAAAAAAAAAA=="}}
2024-04-05T23:07:40.590-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.HandshakeInterceptorImpl : Incoming connection from /192.168.1.98:54379
2024-04-05T23:07:40.606-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/websocket, client=192.168.1.98
2024-04-05T23:07:40.606-07:00 INFO 13028 --- [ XNIO-1 task-2] lavalink.server.io.SocketServer : Connection successfully established from lavalink-ws-client v1.0.0
2024-04-05T23:07:40.637-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/vvh67j4hyvzv60h4, client=192.168.1.98, payload={"resuming":true,"timeout":60000}
2024-04-05T23:07:45.496-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.player.AudioLoaderRestHandler : Got request to load for identifier "ytsearch:list of people"
2024-04-05T23:07:45.856-07:00 INFO 13028 --- [ XNIO-1 task-2] lavalink.server.player.AudioLoader : Loaded playlist Search results for: list of people
2024-04-05T23:07:45.871-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : GET /v4/loadtracks?identifier=ytsearch%3Alist+of+people, client=192.168.1.98
2024-04-05T23:07:46.106-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/vvh67j4hyvzv60h4/players/889662048517124137?noReplace=false, client=192.168.1.98, payload={"volume":50}
2024-04-05T23:07:46.137-07:00 INFO 13028 --- [ XNIO-1 task-2] l.server.io.RequestLoggingFilter : PATCH /v4/sessions/vvh67j4hyvzv60h4/players/889662048517124137?noReplace=false, client=192.168.1.98, payload={"track":{"encoded":"QAAA5AMAR1RhbWUgSW1wYWxhIC0gTGlzdCBvZiBQZW9wbGUgKFRvIFRyeSBhbmQgRm9yZ2V0IEFib3V0KSAoT2ZmaWNpYWwgQXVkaW8pAAtUYW1lIEltcGFsYQAAAAAABE2QAAtSd2FZZmxIQUlHUQABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PVJ3YVlmbEhBSUdRAQA0aHR0cHM6Ly9pLnl0aW1nLmNvbS92aS9Sd2FZZmxIQUlHUS9tYXhyZXNkZWZhdWx0LmpwZwAAB3lvdXR1YmUAAAAAAAAAAA=="}}
ah thank you I'll add that rn Put that in but still doesn't seem to change any of the logs
viztea
viztea4mo ago
it's not supposed to, i just want to see the results
JackW25
JackW254mo ago
Ah I see my bad. Testing it and nothing seems different at least in terms of behaviour, etc.
viztea
viztea4mo ago
btw player.queue doesn't have a track start event player does nvm im a fucking liar LMFAO wtf is your issue lmfao
JackW25
JackW254mo ago
I'm honestly not sure lmao Right now player seems to connect and track data loads fine, but the bot wont play anything, just sits in call
viztea
viztea4mo ago
it's because your code isn't submitting voice updates show me your bot logs
JackW25
JackW254mo ago
Bot logs are here, kinda went nuts earlier and logged all the track data to see if there was any issue there so its a bit overkill LMAO
Started refreshing application (/) commands.
Status posted on port 3000
Successfully reloaded application (/) commands.
Ready!
Connected to LavaLink
track.info.uri: https://www.youtube.com/watch?v=hjpF8ukSrvk
track.info.title: Wish You Were Here
Tracks: [object Object]
Playing track
Started refreshing application (/) commands.
Status posted on port 3000
Successfully reloaded application (/) commands.
Ready!
Connected to LavaLink
track.info.uri: https://www.youtube.com/watch?v=hjpF8ukSrvk
track.info.title: Wish You Were Here
Tracks: [object Object]
Playing track
viztea
viztea4mo ago
you didn't add this ?
viztea
viztea4mo ago
viztea
viztea4mo ago
remove : unknown[]
JackW25
JackW254mo ago
Ah I had added that but left some of the type annotation in, thats my bad These are the current logs:
[ws] <<< stats: {"op":"stats","frameStats":null,"players":0,"playingPlayers":0,"uptime":950367,"memory":{"free":20749872,"used":73621968,"allocated":94371840,"reservable":4294967296},"cpu":{"cores":4,"systemLoad":0.029359227728792948,"lavalinkLoad":8.925180402582605E-4}}
[rest] PATCH /v4/sessions/lttzczmtf1xv9jvn + 81.40 ms
[ws] <<< ready: {"op":"ready","resumed":false,"sessionId":"lttzczmtf1xv9jvn"}
[ws] <<< event: {"op":"event","type":"TrackExceptionEvent","guildId":"889662048517124137","track":{"encoded":"QAAArgMAEldpc2ggWW91IFdlcmUgSGVyZQAKUGluayBGbG95ZAAAAAAABRyYAAtoanBGOHVrU3J2awABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWhqcEY4dWtTcnZrAQA0aHR0cHM6Ly9pLnl0aW1nLmNvbS92aS9oanBGOHVrU3J2ay9tYXhyZXNkZWZhdWx0LmpwZwAAB3lvdXR1YmUAAAAAAAAAAA==","info":{"identifier":"hjpF8ukSrvk","isSeekable":true,"author":"Pink Floyd","length":335000,"isStream":false,"position":0,"title":"Wish You Were Here","uri":"https://www.youtube.com/watch?v=hjpF8ukSrvk","sourceName":"youtube","artworkUrl":"https://i.ytimg.com/vi/hjpF8ukSrvk/maxresdefault.jpg","isrc":null},"pluginInfo":{},"userData":{}},"exception":{"message":"Video returned by YouTube isn't what was requested","severity":"common","cause":"java.lang.IllegalStateException: {\"responseContext\":{\"serviceTrackingParams\":[{\"service\":\"GFEEDBACK\",\"params\":[{\"key\":\"is_alc_surface\",\"value\":\"false\"},{\"key\":\"is_viewed_live\",\"value\":\"False\"},{\"key\":\"ipcc\",\"value\":\"0\"},{\"key\":\"logged_in\",\"value\":\"0\"},{\"key\":\"e\",\"value\":\"9407156,23946420,23966208,23983296,23998056,24004644,24036948,24077241,24078649,24080738,24117491,24120820,24135310,24143331,24166867,24181174,24186126,24187377,24230811,24232551,24241378,24265964,24267186,24290971,24377598,24397985,24406318,24451319,24457333,24458317,24458324,24458329,24458684,24468724,24515423,24522874,24524098,24542367,24548627,24548629,24556101,24560416,24585134,24585737,24696672,24697013,39325978,51003636,51009781,51012659,51014091,51016856,51017346,51019626,51020570,51025415,51027870,51030101,51030358,51033399,51033765,51037346,51037351,51038520,51040836,51044000,51048489,51050361,51053689,51057842,51057855,51060353,51064835,51068313,51068632,51069269,51074183,51078191,51078651...
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385038465,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385043472,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385048463,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385053466,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385058473,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385063474,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385068474,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385073477,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< stats: {"op":"stats","frameStats":null,"players":0,"playingPlayers":0,"uptime":950367,"memory":{"free":20749872,"used":73621968,"allocated":94371840,"reservable":4294967296},"cpu":{"cores":4,"systemLoad":0.029359227728792948,"lavalinkLoad":8.925180402582605E-4}}
[rest] PATCH /v4/sessions/lttzczmtf1xv9jvn + 81.40 ms
[ws] <<< ready: {"op":"ready","resumed":false,"sessionId":"lttzczmtf1xv9jvn"}
[ws] <<< event: {"op":"event","type":"TrackExceptionEvent","guildId":"889662048517124137","track":{"encoded":"QAAArgMAEldpc2ggWW91IFdlcmUgSGVyZQAKUGluayBGbG95ZAAAAAAABRyYAAtoanBGOHVrU3J2awABACtodHRwczovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWhqcEY4dWtTcnZrAQA0aHR0cHM6Ly9pLnl0aW1nLmNvbS92aS9oanBGOHVrU3J2ay9tYXhyZXNkZWZhdWx0LmpwZwAAB3lvdXR1YmUAAAAAAAAAAA==","info":{"identifier":"hjpF8ukSrvk","isSeekable":true,"author":"Pink Floyd","length":335000,"isStream":false,"position":0,"title":"Wish You Were Here","uri":"https://www.youtube.com/watch?v=hjpF8ukSrvk","sourceName":"youtube","artworkUrl":"https://i.ytimg.com/vi/hjpF8ukSrvk/maxresdefault.jpg","isrc":null},"pluginInfo":{},"userData":{}},"exception":{"message":"Video returned by YouTube isn't what was requested","severity":"common","cause":"java.lang.IllegalStateException: {\"responseContext\":{\"serviceTrackingParams\":[{\"service\":\"GFEEDBACK\",\"params\":[{\"key\":\"is_alc_surface\",\"value\":\"false\"},{\"key\":\"is_viewed_live\",\"value\":\"False\"},{\"key\":\"ipcc\",\"value\":\"0\"},{\"key\":\"logged_in\",\"value\":\"0\"},{\"key\":\"e\",\"value\":\"9407156,23946420,23966208,23983296,23998056,24004644,24036948,24077241,24078649,24080738,24117491,24120820,24135310,24143331,24166867,24181174,24186126,24187377,24230811,24232551,24241378,24265964,24267186,24290971,24377598,24397985,24406318,24451319,24457333,24458317,24458324,24458329,24458684,24468724,24515423,24522874,24524098,24542367,24548627,24548629,24556101,24560416,24585134,24585737,24696672,24697013,39325978,51003636,51009781,51012659,51014091,51016856,51017346,51019626,51020570,51025415,51027870,51030101,51030358,51033399,51033765,51037346,51037351,51038520,51040836,51044000,51048489,51050361,51053689,51057842,51057855,51060353,51064835,51068313,51068632,51069269,51074183,51078191,51078651...
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385038465,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385043472,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385048463,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385053466,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385058473,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385063474,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385068474,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385073477,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
Had to cut off the one ws event log just cause it was too long for this message but I can send a txt or a paste of it if needed
viztea
viztea4mo ago
JackW25
JackW254mo ago
Ah that worked for getting the Exception out the way, but still wont play anything in the call Trying again I get these logs
[rest] PATCH /v4/sessions/9orqnvwo6bhddehm/players/889662048517124137 + 127.96 ms
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385412715,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< event: {"op":"event","type":"TrackStartEvent","guildId":"889662048517124137","track":{"encoded":"QAABHAMAG1N3aW5nIEx5bm4gKE9mZmljaWFsIEF1ZGlvKQAISGFybWxlc3MAAAAAAATp0AALX1BhdzhaUlNscVkAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1fUGF3OFpSU2xxWQEAm2h0dHBzOi8vaS55dGltZy5jb20vdmkvX1BhdzhaUlNscVkvbWF4cmVzZGVmYXVsdC5qcGc/c3FwPS1vYXltd0VtQ0lBS0VOQUY4cXVLcVFNYThBRUItQUgtQ1lBQzBBV0tBZ3dJQUJBQkdIOGdIaWd6TUE4PSZycz1BT240Q0xCcWdyczRLQjNaSXRRSGJmdDNVVE93S2xFMGR3AAAHeW91dHViZQAAAAAAAAAA","info":{"identifier":"_Paw8ZRSlqY","isSeekable":true,"author":"Harmless","length":322000,"isStream":false,"position":0,"title":"Swing Lynn (Official Audio)","uri":"https://www.youtube.com/watch?v=_Paw8ZRSlqY","sourceName":"youtube","artworkUrl":"https://i.ytimg.com/vi/_Paw8ZRSlqY/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGH8gHigzMA8=&rs=AOn4CLBqgrs4KB3ZItQHbft3UTOwKlE0dw","isrc":null},"pluginInfo":{},"userData":{}}}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385412731,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[rest] PATCH /v4/sessions/9orqnvwo6bhddehm/players/889662048517124137 + 91.03 ms
[ws] <<< event: {"op":"event","type":"TrackEndEvent","guildId":"889662048517124137","track":{"encoded":"QAABHAMAG1N3aW5nIEx5bm4gKE9mZmljaWFsIEF1ZGlvKQAISGFybWxlc3MAAAAAAATp0AALX1BhdzhaUlNscVkAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1fUGF3OFpSU2xxWQEAm2h0dHBzOi8vaS55dGltZy5jb20vdmkvX1BhdzhaUlNscVkvbWF4cmVzZGVmYXVsdC5qcGc/c3FwPS1vYXltd0VtQ0lBS0VOQUY4cXVLcVFNYThBRUItQUgtQ1lBQzBBV0tBZ3dJQUJBQkdIOGdIaWd6TUE4PSZycz1BT240Q0xCcWdyczRLQjNaSXRRSGJmdDNVVE93S2xFMGR3AAAHeW91dHViZQAAAAAAAAAA","info":{"identifier":"_Paw8ZRSlqY","isSeekable":true,"author":"Harmless","length":322000,"isStream":false,"position":0,"title":"Swing Lynn (Official Audio)","uri":"https://www.youtube.com/watch?v=_Paw8ZRSlqY","sourceName":"youtube","artworkUrl":"https://i.ytimg.com/vi/_Paw8ZRSlqY/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGH8gHigzMA8=&rs=AOn4CLBqgrs4KB3ZItQHbft3UTOwKlE0dw","isrc":null},"pluginInfo":{},"userData":{}},"reason":"replaced"}
v=_Paw8ZRSlqY","sourceName":"youtube","artworkUrl":"https://i.ytimg.com/vi/_Paw8ZRSlqY/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGH8gHigzMA8=&rs=AOn4CLBqgrs4KB3ZItQHbft3UTOwKlE0dw","isrc":null},"pluginInfo":{},"userData":{}}}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385412799,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385412801,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[rest] PATCH /v4/sessions/9orqnvwo6bhddehm/players/889662048517124137 + 36.09 ms
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385462796,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385467799,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385472799,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< event: {"op":"event","type":"TrackEndEvent","guildId":"889662048517124137","track":{"encoded":"...","info":{"identifier":"_Paw8ZRSlqY", ...,"isrc":null},"pluginInfo":{},"userData":{}},"reason":"cleanup"}
[rest] PATCH /v4/sessions/9orqnvwo6bhddehm/players/889662048517124137 + 127.96 ms
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385412715,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< event: {"op":"event","type":"TrackStartEvent","guildId":"889662048517124137","track":{"encoded":"QAABHAMAG1N3aW5nIEx5bm4gKE9mZmljaWFsIEF1ZGlvKQAISGFybWxlc3MAAAAAAATp0AALX1BhdzhaUlNscVkAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1fUGF3OFpSU2xxWQEAm2h0dHBzOi8vaS55dGltZy5jb20vdmkvX1BhdzhaUlNscVkvbWF4cmVzZGVmYXVsdC5qcGc/c3FwPS1vYXltd0VtQ0lBS0VOQUY4cXVLcVFNYThBRUItQUgtQ1lBQzBBV0tBZ3dJQUJBQkdIOGdIaWd6TUE4PSZycz1BT240Q0xCcWdyczRLQjNaSXRRSGJmdDNVVE93S2xFMGR3AAAHeW91dHViZQAAAAAAAAAA","info":{"identifier":"_Paw8ZRSlqY","isSeekable":true,"author":"Harmless","length":322000,"isStream":false,"position":0,"title":"Swing Lynn (Official Audio)","uri":"https://www.youtube.com/watch?v=_Paw8ZRSlqY","sourceName":"youtube","artworkUrl":"https://i.ytimg.com/vi/_Paw8ZRSlqY/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGH8gHigzMA8=&rs=AOn4CLBqgrs4KB3ZItQHbft3UTOwKlE0dw","isrc":null},"pluginInfo":{},"userData":{}}}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385412731,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[rest] PATCH /v4/sessions/9orqnvwo6bhddehm/players/889662048517124137 + 91.03 ms
[ws] <<< event: {"op":"event","type":"TrackEndEvent","guildId":"889662048517124137","track":{"encoded":"QAABHAMAG1N3aW5nIEx5bm4gKE9mZmljaWFsIEF1ZGlvKQAISGFybWxlc3MAAAAAAATp0AALX1BhdzhaUlNscVkAAQAraHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1fUGF3OFpSU2xxWQEAm2h0dHBzOi8vaS55dGltZy5jb20vdmkvX1BhdzhaUlNscVkvbWF4cmVzZGVmYXVsdC5qcGc/c3FwPS1vYXltd0VtQ0lBS0VOQUY4cXVLcVFNYThBRUItQUgtQ1lBQzBBV0tBZ3dJQUJBQkdIOGdIaWd6TUE4PSZycz1BT240Q0xCcWdyczRLQjNaSXRRSGJmdDNVVE93S2xFMGR3AAAHeW91dHViZQAAAAAAAAAA","info":{"identifier":"_Paw8ZRSlqY","isSeekable":true,"author":"Harmless","length":322000,"isStream":false,"position":0,"title":"Swing Lynn (Official Audio)","uri":"https://www.youtube.com/watch?v=_Paw8ZRSlqY","sourceName":"youtube","artworkUrl":"https://i.ytimg.com/vi/_Paw8ZRSlqY/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGH8gHigzMA8=&rs=AOn4CLBqgrs4KB3ZItQHbft3UTOwKlE0dw","isrc":null},"pluginInfo":{},"userData":{}},"reason":"replaced"}
v=_Paw8ZRSlqY","sourceName":"youtube","artworkUrl":"https://i.ytimg.com/vi/_Paw8ZRSlqY/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGH8gHigzMA8=&rs=AOn4CLBqgrs4KB3ZItQHbft3UTOwKlE0dw","isrc":null},"pluginInfo":{},"userData":{}}}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385412799,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385412801,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[rest] PATCH /v4/sessions/9orqnvwo6bhddehm/players/889662048517124137 + 36.09 ms
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385462796,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385467799,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< playerUpdate: {"op":"playerUpdate","state":{"time":1712385472799,"position":0,"connected":false,"ping":-1},"guildId":"889662048517124137"}
[ws] <<< event: {"op":"event","type":"TrackEndEvent","guildId":"889662048517124137","track":{"encoded":"...","info":{"identifier":"_Paw8ZRSlqY", ...,"isrc":null},"pluginInfo":{},"userData":{}},"reason":"cleanup"}
Also just realizing the time now, it's near midnight over here so I'll likely have to look at this tomorrow with fresh eyes haha. Have work super early in the morning which sucks but I'll definitely take another look at these tomorrow. Thank you again for all the help I do appreciate it
viztea
viztea4mo ago
and there are no bot logs like "updating voice status in guild" "submitting voice update to node." ? Sounds good. Sorry for the relentless back & forth, I don't think it's to do with the library but I don't know for sure lol
JackW25
JackW254mo ago
There is this I found just from a quick search of the logs
[player:voice] updating voice status in guild=889662048517124137, channel=904850674435629056
[player:voice] updating voice status in guild=889662048517124137, channel=904850674435629056
Nothing else although
viztea
viztea4mo ago
I'll push an update for more voice status debug logging
JackW25
JackW254mo ago
You're all good haha I apologize for my ignorance with these things, you're helping a ton, I'd be completely lost on my own lmao Its interesting being back with NodeJS, I started using it years ago, now out of high school and working sometimes 50 hours a week I stopped using it entirely but it's good to be back working with it, just forgot all of it haha
viztea
viztea4mo ago
unfortunately i'm jobless so I have too much time to dedicate to my projects :')
JackW25
JackW254mo ago
Ah haha I’d love that so much more. Just in the process of becoming a full time paramedic so I’m having to work a lot more than I like lmao Nothing wrong with too much time haha
Elon
Elon4mo ago
wrong server mb hey @gino sorry for ping but u available?
viztea
viztea4mo ago
don’t ask to ask also create a new thread