discord-player
discord-player copied to clipboard
The movie data is retrieved normally, but it is disconnected from the voice channel.
Describe the bug
I'm running Node.js on a server that doesn't have root privileges So everything is done in Node.js inside Miniconda. I don't know if that's the reason, but I've been able to get track titles and call ffmpeg successfully, but the Bot will not play anything and will disconnect the voice channel.
To Reproduce Steps to reproduce the behavior:
Create a Bot with a simple connection and playback. And if I do that in my environment, the audio is cut off, not played.
Expected behavior
Play music
Screenshots
Please complete the following information:
- Node Version: 16.13.1
- Discord Player Version: 5,3,1
- Discord.js Version: 14.3.0
Additional context
If you check the process with the ps x command, you can see that ffmpeg is running, but it's already disconnected from the voice channel. 36389 pts/0 Sl+ 0:00 ffmpeg -i - -ss 0 -analyzeduration 0 -loglevel 0 -f s16le -ar 48000 -ac 2 pipe:1
There's a warning on the console, but I don't know what it means. And it doesn't show what's causing it, so if I have a problem, I'll ask for a hint.
Could you provide your code snippet as well?
There's a warning on the console, but I don't know what it means. And it doesn't show what's causing it, so if I have a problem, I'll ask for a hint.
The warning will disappear if you update it to Node.js 18 so I don't think that is related to the error.
Could you provide your code snippet as well?
Okay, code here.
const { Colors, ApplicationCommandOptionType } = require("discord.js")
const { settings } = require("../modules/static");
module.exports = {
data: {
name: "play",
description: "ๆๅฎใใๆฒใๅ็ใใพใ",
dmPermission: false,
options: [
{
name: "query",
description: "ๆฒใๆๅฎใใฆใใ ใใ",
type: ApplicationCommandOptionType.String,
required: true
}
]
},
async execute(i) {
let queue = i.player.queues.get(i.guild.id);
if (!queue) {
if (!i.member.voice.channelId) {
return i.reply({
embeds: [
{
title: "Join",
description: "ใใคในใใฃใณใใซใซๅๅ ใใใซใฏใใพใใใชใใใใคในใใฃใณใใซใซๅฑ
ใๅฟ
่ฆใใใใพใ",
color: Colors.Red,
footer: settings.footer
}
],
ephemeral: true
})
}
queue = i.player.createQueue(i.guild, {
metadata: {
channel: i.channel
}
})
try {
if (!queue.connection) await queue.connect(i.member.voice.channel);
} catch {
queue.destroy();
return i.reply({
embeds: [
{
title: "Join",
description: "ใใคในใใฃใณใใซใซๆฅ็ถใงใใพใใใงใใ",
color: Colors.Red,
footer: settings.footer
}
],
ephemeral: true
})
}
await i.channel.send({
embeds: [{
title: "Join",
description: `<#${i.member.voice.channelId}> ใซๅๅ ใใพใใ`,
color: Colors.Green,
footer: settings.footer
}]
})
}
await i.deferReply({ephemeral: false});
if (!queue.connection) {
i.followUp({
embeds: [
{
title: "Join",
description: "Botใใใคในใใฃใณใใซใใๅๆญใใใฆใใพใ",
color: Colors.Red,
footer: settings.footer
}
],
ephemeral: true
})
return queue.destroy();
}
const query = i.options.getString("query");
const track = await i.player.search(query, {
requestedBy: i.user
}).then(x => x.tracks[0]);
if (!track) {
return i.followUp({
embeds: [
{
title: "Play",
description: "ๆฒใ่ฆใคใใใพใใใงใใ",
color: Colors.Red,
footer: settings.footer
}
],
ephemeral: true
})
}
await queue.play(track);
await i.followUp({
embeds: [{
title: "Play",
description: `${track.title} ใใญใฅใผใซ่ฟฝๅ ใใพใใ`,
color: Colors.Green,
footer: settings.footer
}]
})
}
}
By the way, it worked when I ran it locally on Windows. I forgot to write.
There's a warning on the console, but I don't know what it means. And it doesn't show what's causing it, so if I have a problem, I'll ask for a hint.
The warning will disappear if you update it to Node.js 18 so I don't think that is related to the error.
I see. Thank you.
@KohnoseLami I have the same problem
it's been a while now, but by chance were you guys using ubuntu 22 when this issue occurred?
it's been a while now, but by chance were you guys using ubuntu 22 when this issue occurred?
No, Cent OS6 Running with Node.js in Miniconda
it's been a while now, but by chance were you guys using ubuntu 22 when this issue occurred?
No, Cent OS6 Running with Node.js in Miniconda
if you are still using discord-player, could you try using the latest version (6.0.0) and see if it persists? If it does, could you run it in debug mode (attaching a debug
event listener to player.events
) and see if it shows anything?
if you are still using discord-player, could you try using the latest version (6.0.0) and see if it persists? If it does, could you run it in debug mode (attaching a debug event listener to player.events) and see if it shows anything?
I'll try it.
possible duplicate of https://github.com/Androz2091/discord-player/issues/1639 lets discuss there instead