get user audio and resend in channel

I want to get a user audio and resend in real time the audio in voice channel
let connection = await joinVoiceChannel({
channelId: message.member.voice.channel.id,
guildId: message.guildId,
adapterCreator: message.guild.voiceAdapterCreator,
selfDeaf: false,
});

let audioA = connection.receiver.subscribe("266636247017979904", {
end: { behavior: EndBehaviorType.Manual }
})

audioA.on("data", (data) => {
console.log(data)
})

let resource = await createAudioResource(audioA)

let player = await createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Play
}
})

player.subscribe(connection);

player.play(resource);
let connection = await joinVoiceChannel({
channelId: message.member.voice.channel.id,
guildId: message.guildId,
adapterCreator: message.guild.voiceAdapterCreator,
selfDeaf: false,
});

let audioA = connection.receiver.subscribe("266636247017979904", {
end: { behavior: EndBehaviorType.Manual }
})

audioA.on("data", (data) => {
console.log(data)
})

let resource = await createAudioResource(audioA)

let player = await createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Play
}
})

player.subscribe(connection);

player.play(resource);
2 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Bouns
BounsOP3y ago
my problem is that I have no sound coming out of the bot in catFunWhat2
Want results from more Discord servers?
Add your server