Bot didn't speak in voice on an host

Hi, I make a bot who play radio with URL of free API. My command works when I test it on my own computer but when I put it on a host, the bot do not speak. Here my code :
async execute(client: DiscordClient, interaction: ChatInputCommandInteraction)
{
const radio_id = interaction.options.getString('nom');
if (radio_id == 'null')return interaction.reply({
embeds: [
new EmbedBuilder()
.setDescription("Veuillez entrer une nom de radio")
],
ephemeral: true
});

const radio = (await client.radio.getStationsById([radio_id]))[0];

const member = await interaction.guild.members.fetch(interaction.user.id);

if (!member.voice?.channelId)return interaction.reply({
embeds: [
new EmbedBuilder()
.setDescription("Vous devez être dans un channel vocal pour utiliser cette commande !")
],
ephemeral: true
});

const connection = joinVoiceChannel({
channelId: member.voice.channelId,
guildId: member.guild.id,
adapterCreator: member.guild.voiceAdapterCreator,
});
const player = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Play,
},
});

const resource = createAudioResource(radio.url);
player.play(resource);

connection.subscribe(player);

await interaction.reply({
embeds: [
new EmbedBuilder()
.setTitle("Lancement de la radio")
.setThumbnail(radio.favicon == '' ? null : radio.favicon)
.setDescription(
`[\`${radio.name}\`](${radio.homepage == '' ? radio.url : radio.homepage})`
)
]
})
}
async execute(client: DiscordClient, interaction: ChatInputCommandInteraction)
{
const radio_id = interaction.options.getString('nom');
if (radio_id == 'null')return interaction.reply({
embeds: [
new EmbedBuilder()
.setDescription("Veuillez entrer une nom de radio")
],
ephemeral: true
});

const radio = (await client.radio.getStationsById([radio_id]))[0];

const member = await interaction.guild.members.fetch(interaction.user.id);

if (!member.voice?.channelId)return interaction.reply({
embeds: [
new EmbedBuilder()
.setDescription("Vous devez être dans un channel vocal pour utiliser cette commande !")
],
ephemeral: true
});

const connection = joinVoiceChannel({
channelId: member.voice.channelId,
guildId: member.guild.id,
adapterCreator: member.guild.voiceAdapterCreator,
});
const player = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Play,
},
});

const resource = createAudioResource(radio.url);
player.play(resource);

connection.subscribe(player);

await interaction.reply({
embeds: [
new EmbedBuilder()
.setTitle("Lancement de la radio")
.setThumbnail(radio.favicon == '' ? null : radio.favicon)
.setDescription(
`[\`${radio.name}\`](${radio.homepage == '' ? radio.url : radio.homepage})`
)
]
})
}
First image, Dependencies on pterodactyl and second on my computer. I also put listeners on state of the player and and here are the statuses: ready -> Buffering -> idle
No description
6 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Ifanoxy
IfanoxyOP6mo ago
My dependencies And node js version is v18.20.4
No description
Ifanoxy
IfanoxyOP6mo ago
Second screen of my DependencyReport
No description
M7MD
M7MD2mo ago
i have the same problem, please if you find a solution tell me.
Retro
Retro2mo ago
ffmpeg static is known to sometimes bug out on some linux distros try to install ffmpeg on the host itself if you can cc @M7MD gyan.dev provide builds for windows. was this on windows?
M7MD
M7MD2mo ago
i solved it

Did you find this page helpful?