Song information is fetched but there is no sound

Song information is fetched but there is no sound
73 Replies
evident-indigo
evident-indigo•14mo ago
LL logs please
'   3z
' 3zOP•14mo ago
Wait
'   3z
' 3zOP•14mo ago
No description
evident-indigo
evident-indigo•14mo ago
The code of your index.js, please
'   3z
' 3zOP•14mo ago
I use a code in the npm page
evident-indigo
evident-indigo•14mo ago
It seems like: client.on("raw", data => { // Updating the Moonlink.js package with the necessary data client.moon.packetUpdate(data); }); Is missing. Is it?
'   3z
' 3zOP•14mo ago
:hi:
MEE6
MEE6•14mo ago
GG @' 3z, you just advanced to level 1!
evident-indigo
evident-indigo•14mo ago
?-?
'   3z
' 3zOP•14mo ago
Yes
evident-indigo
evident-indigo•14mo ago
Add it and it will work LMAO
'   3z
' 3zOP•14mo ago
Okk Wait
evident-indigo
evident-indigo•14mo ago
I have class now Sorry
'   3z
' 3zOP•14mo ago
i add it The same problem
1Lucas1.apk
1Lucas1.apk•14mo ago
Are the intents so active?
'   3z
' 3zOP•14mo ago
discord intents ?
evident-indigo
evident-indigo•14mo ago
LL logs again
1Lucas1.apk
1Lucas1.apk•14mo ago
Yes
'   3z
' 3zOP•14mo ago
No description
'   3z
' 3zOP•14mo ago
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildIntegrations,GatewayIntentBits.GuildWebhooks,GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildMembers,GatewayIntentBits.MessageContent,GatewayIntentBits.GuildMessages],
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildIntegrations,GatewayIntentBits.GuildWebhooks,GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildMembers,GatewayIntentBits.MessageContent,GatewayIntentBits.GuildMessages],
evident-indigo
evident-indigo•14mo ago
May I see your index.js?
'   3z
' 3zOP•14mo ago
const MusicPlayer = new MoonlinkManager(Nodes, {
}, (id, data) => {
let guild = client.guilds.cache.get(id);
if(guild) guild.shard.send(JSON.parse(data))
})
client.Player = MusicPlayer
client.Player.on("nodeCreate", node => {
console.log(`${node.host} Was Connected`);
});
client.Player.on("nodeClose", node => {
console.log(`${node.host} Was Closed`);
});
client.on(Events.Raw, data => {
client.Player.packetUpdate(data);
});
client.on(Events.ClientReady, async () => {
client.Player.init(client.user.id);
})
const MusicPlayer = new MoonlinkManager(Nodes, {
}, (id, data) => {
let guild = client.guilds.cache.get(id);
if(guild) guild.shard.send(JSON.parse(data))
})
client.Player = MusicPlayer
client.Player.on("nodeCreate", node => {
console.log(`${node.host} Was Connected`);
});
client.Player.on("nodeClose", node => {
console.log(`${node.host} Was Closed`);
});
client.on(Events.Raw, data => {
client.Player.packetUpdate(data);
});
client.on(Events.ClientReady, async () => {
client.Player.init(client.user.id);
})
evident-indigo
evident-indigo•14mo ago
If you console.log('idk') inside the Raw, does it print?
'   3z
' 3zOP•14mo ago
client.on(Events.MessageCreate, async message => {
let commandName = message.content;
if (commandName === "play") {
if (!message.member.voice.channel) return message.reply({content: `You are not in a voice channel`,});
let query = `cry`
let player = client.Player.players.create({
guildId: message.guild.id,
voiceChannel: message.member.voice.channel.id,
textChannel: message.channel.id,
autoPlay: true
});
if (!player.connected) {
player.connect({
setDeaf: true,
setMute: false
});
}

let res = await client.Player.search({
query,
source: "youtube",
requester: message.member.id
});

if (res.loadType === "loadfailed") {
// Responding with an error message if loading fails
return message.reply({
content: `:x: Load failed - the system is not cooperating.`
});
} else if (res.loadType === "empty") {
// Responding with a message if the search returns no results
return message.reply({
content: `:x: No matches found!`
});
}

if (res.loadType === "playlist") {
message.reply({
content: `${res.playlistInfo.name} This playlist has been added to the waiting list, spreading joy`
});

for (const track of res.tracks) {
// Adding tracks to the queue if it's a playlist
player.queue.add(track);
}
} else {
player.queue.add(res.tracks[0]);
message.reply({
content: `${res.tracks[0].title} was added to the waiting list`
});
}
if (!player.playing) player.play();

}
})
client.on(Events.MessageCreate, async message => {
let commandName = message.content;
if (commandName === "play") {
if (!message.member.voice.channel) return message.reply({content: `You are not in a voice channel`,});
let query = `cry`
let player = client.Player.players.create({
guildId: message.guild.id,
voiceChannel: message.member.voice.channel.id,
textChannel: message.channel.id,
autoPlay: true
});
if (!player.connected) {
player.connect({
setDeaf: true,
setMute: false
});
}

let res = await client.Player.search({
query,
source: "youtube",
requester: message.member.id
});

if (res.loadType === "loadfailed") {
// Responding with an error message if loading fails
return message.reply({
content: `:x: Load failed - the system is not cooperating.`
});
} else if (res.loadType === "empty") {
// Responding with a message if the search returns no results
return message.reply({
content: `:x: No matches found!`
});
}

if (res.loadType === "playlist") {
message.reply({
content: `${res.playlistInfo.name} This playlist has been added to the waiting list, spreading joy`
});

for (const track of res.tracks) {
// Adding tracks to the queue if it's a playlist
player.queue.add(track);
}
} else {
player.queue.add(res.tracks[0]);
message.reply({
content: `${res.tracks[0].title} was added to the waiting list`
});
}
if (!player.playing) player.play();

}
})
evident-indigo
evident-indigo•14mo ago
The play command isn't necessary, it's working flawlessly
'   3z
' 3zOP•14mo ago
yes
evident-indigo
evident-indigo•14mo ago
console.log(data) and show what it prints
'   3z
' 3zOP•14mo ago
No description
evident-indigo
evident-indigo•14mo ago
I need the rest, specifically what prints when the bot joins the channel
'   3z
' 3zOP•14mo ago
t: 'VOICE_STATE_UPDATE',
s: 17,
op: 0,
d: {
member: {
user: [Object],
roles: [Array],
premium_since: null,
pending: false,
nick: null,
mute: false,
joined_at: '2022-03-16T04:40:35.500000+00:00',
flags: 0,
deaf: false,
communication_disabled_until: null,
avatar: null
},
user_id: '409475602823774219',
suppress: false,
session_id: 'e164dc0194fd1d797b724ff091....',
self_video: false,
self_mute: false,
self_deaf: false,
request_to_speak_timestamp: null,
mute: false,
guild_id: '953513087573565460',
deaf: false,
channel_id: '1189677303404445787'
}
}
t: 'VOICE_STATE_UPDATE',
s: 17,
op: 0,
d: {
member: {
user: [Object],
roles: [Array],
premium_since: null,
pending: false,
nick: null,
mute: false,
joined_at: '2022-03-16T04:40:35.500000+00:00',
flags: 0,
deaf: false,
communication_disabled_until: null,
avatar: null
},
user_id: '409475602823774219',
suppress: false,
session_id: 'e164dc0194fd1d797b724ff091....',
self_video: false,
self_mute: false,
self_deaf: false,
request_to_speak_timestamp: null,
mute: false,
guild_id: '953513087573565460',
deaf: false,
channel_id: '1189677303404445787'
}
}
evident-indigo
evident-indigo•14mo ago
I need to know what's the state of VOICE_SERVER_UPDATE Those informations are harmless.. they become unusable after the bot restarts its main gateway or leaves the channel
'   3z
' 3zOP•14mo ago
{
t: 'VOICE_SERVER_UPDATE',
s: 20,
op: 0,
d: {
token: 'c05476a89fb13c86',
guild_id: '953513087573565460',
endpoint: 'tel-aviv10000.discord.media:443'
}
}
{
t: 'VOICE_SERVER_UPDATE',
s: 20,
op: 0,
d: {
token: 'c05476a89fb13c86',
guild_id: '953513087573565460',
endpoint: 'tel-aviv10000.discord.media:443'
}
}
this ?
evident-indigo
evident-indigo•14mo ago
I'm confused now @1Lucas1.apk Eu vou dar uma olhada, mas talvez seja melhor que você olhe Por algum motivo não ta enviando o voice data Which moonlink.js version are you using?
'   3z
' 3zOP•14mo ago
"dependencies": {
"@discordjs/opus": "^0.9.0",
"@discordjs/voice": "^0.16.1",
"cacheable-lookup": "^7.0.0",
"chalk": "^4.1.2",
"discord.js": "^14.14.1",
"dotenv": "^16.0.1",
"ffmpeg-static": "^4.4.1",
"fs": "^0.0.1-security",
"moonlink.js": "^3.6.0",
"node-fetch": "^2.7.0",
"string-progressbar": "^1.0.4",
"ytdl-core": "^4.11.2",
},
"dependencies": {
"@discordjs/opus": "^0.9.0",
"@discordjs/voice": "^0.16.1",
"cacheable-lookup": "^7.0.0",
"chalk": "^4.1.2",
"discord.js": "^14.14.1",
"dotenv": "^16.0.1",
"ffmpeg-static": "^4.4.1",
"fs": "^0.0.1-security",
"moonlink.js": "^3.6.0",
"node-fetch": "^2.7.0",
"string-progressbar": "^1.0.4",
"ytdl-core": "^4.11.2",
},
MEE6
MEE6•14mo ago
GG @' 3z, you just advanced to level 2!
evident-indigo
evident-indigo•14mo ago
(Just a heads up, fs is a built-in node module, not a npm, feel free to remove it)
'   3z
' 3zOP•14mo ago
ok thx
evident-indigo
evident-indigo•14mo ago
And LL and discordjs/voice are incompatible as only one instance can be connected to the voice gateway I'll look into the internals of moonlink.js to see if I can catch anything that may cause this
'   3z
' 3zOP•14mo ago
ok
evident-indigo
evident-indigo•14mo ago
https://github.com/Ecliptia/moonlink.js/blob/v3/dist/src/%40Managers/PlayerManager.js#L45 In this line, below the function, could you add a console.log(this.voices[guildId])?
GitHub
moonlink.js/dist/src/@Managers/PlayerManager.js at v3 · Ecliptia/mo...
MoonLink.js is a simple package for lavalink client, perfect for you to create your discord bot with songs, and very simple and easy to use. - Ecliptia/moonlink.js
evident-indigo
evident-indigo•14mo ago
@1Lucas1.apk Eu já falei que é || não &&. Se for &&, e faltar um deles, ele vai enviar mesmo assim Por isso o NL tava puto no logs de alguém que tinha visto aí pelo moonlink mandar só o sessionId 💀
'   3z
' 3zOP•14mo ago
{ sessionId: 'a7b8a1a996a3482dceb33003e110c745' }
{
sessionId: 'a7b8a1a996a3482dceb33003e110c745',
endpoint: 'tel-aviv10000.discord.media:443',
token: '0d369d302d6abfdb'
}
{ sessionId: 'a7b8a1a996a3482dceb33003e110c745' }
{
sessionId: 'a7b8a1a996a3482dceb33003e110c745',
endpoint: 'tel-aviv10000.discord.media:443',
token: '0d369d302d6abfdb'
}
evident-indigo
evident-indigo•14mo ago
GitHub
moonlink.js/dist/src/@Managers/PlayerManager.js at v3 · Ecliptia/mo...
MoonLink.js is a simple package for lavalink client, perfect for you to create your discord bot with songs, and very simple and easy to use. - Ecliptia/moonlink.js
evident-indigo
evident-indigo•14mo ago
(outside the } btw)
'   3z
' 3zOP•14mo ago
No description
No description
evident-indigo
evident-indigo•14mo ago
It was meant to be outside, but that also works -- may I see LL logs?
'   3z
' 3zOP•14mo ago
No description
evident-indigo
evident-indigo•14mo ago
Now it seems fine ??? I'm confused, but okay It should output audio now, no?
'   3z
' 3zOP•14mo ago
:hi: Yes, but so far no sound is coming out
evident-indigo
evident-indigo•14mo ago
could you try using https://github.com/PerformanC/NodeLink which is a bit more expressive with issues?
GitHub
GitHub - PerformanC/NodeLink: Performant LavaLink alternative writt...
Performant LavaLink alternative written with Node.Js - PerformanC/NodeLink
'   3z
' 3zOP•14mo ago
LavaLink host ?
evident-indigo
evident-indigo•14mo ago
Alternative, yes Lucas, tu ta de coplô com o NL pra eu não conseguir desenvolver o CogLink?
'   3z
' 3zOP•14mo ago
how i use it
evident-indigo
evident-indigo•14mo ago
git clone https://github.com/PerformanC/NodeLink
cd NodeLink
npm i -f
npm start
git clone https://github.com/PerformanC/NodeLink
cd NodeLink
npm i -f
npm start
'   3z
' 3zOP•14mo ago
No description
evident-indigo
evident-indigo•14mo ago
node -v Which Node.js are you using?
'   3z
' 3zOP•14mo ago
v16.16.0
evident-indigo
evident-indigo•14mo ago
I recommend you to update it, but if you don't want to:
node src/connection/index.js
node src/connection/index.js
'   3z
' 3zOP•14mo ago
ok its work
evident-indigo
evident-indigo•14mo ago
Try playing & please take a screenshot of the NodeLink logs
'   3z
' 3zOP•14mo ago
No description
evident-indigo
evident-indigo•14mo ago
It's not playing/outputting audio?
'   3z
' 3zOP•14mo ago
its played music and there was sound, but the sound was intermittent
evident-indigo
evident-indigo•14mo ago
Wdym intermittent?
'   3z
' 3zOP•14mo ago
lag
MEE6
MEE6•14mo ago
GG @' 3z, you just advanced to level 3!
evident-indigo
evident-indigo•14mo ago
GC collections -- although your machine needs to be really underpowered to actually have it seen Is your network good? In any way -- I don't see why LavaLink isn't playing, I'll let Lucas handle it if you want to use it
'   3z
' 3zOP•14mo ago
yes my network is good
evident-indigo
evident-indigo•14mo ago
Is that a good hardware? And are you running it on Windows?
1Lucas1.apk
1Lucas1.apk•14mo ago
Manda ele usar o Github no branch development eu mudei Mas esse problema não é da moonlink, que ele manda o payload imediatamente quando recebe as informações
evident-indigo
evident-indigo•14mo ago
Eu sei É da LL ou do hardware dele O NodeLink não deveria dar pausar tão longas assim como ditas
'   3z
' 3zOP•14mo ago
yes yes
evident-indigo
evident-indigo•14mo ago
That's the reason For some reason, one of the internals seems to perform bad on Windows, lagging a lot You can try use other libraries like: @discordj/opus libsodium-wrappers if you want to try: npm rm opusscript sodium-native npm i @discordjs/opus libsodium-wrappers

Did you find this page helpful?