how do you play audio

I cant figure out how to play audio through my bot for some reason
5 Replies
d.js toolkit
d.js toolkit10mo 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!
d.js docs
d.js docs10mo ago
:guide: Library: Voice Connections read more
mushtaq
mushtaqOP10mo ago
arctic its stuck in signalling phase however I have GatewayIntentBits.GuildVoiceStates as intent
const resource = createAudioResource("../../media/goofy.mp3");
const channel = interaction.options.getChannel("channel"); // interaction.guild is the object representing the Guild in which the command was run

const connection = joinVoiceChannel({
channelId: channel.id,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator,
});
const player = createAudioPlayer({});
player.play(resource);
connection.subscribe(player);
console.log(connection);
player.on(AudioPlayerStatus.Playing, () => {
console.log("The audio player has started playing!");
});
interaction.reply("ok");
const resource = createAudioResource("../../media/goofy.mp3");
const channel = interaction.options.getChannel("channel"); // interaction.guild is the object representing the Guild in which the command was run

const connection = joinVoiceChannel({
channelId: channel.id,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator,
});
const player = createAudioPlayer({});
player.play(resource);
connection.subscribe(player);
console.log(connection);
player.on(AudioPlayerStatus.Playing, () => {
console.log("The audio player has started playing!");
});
interaction.reply("ok");
it is connecting
d.js docs
d.js docs10mo ago
:guide: Getting Started: Introduction - Debugging Dependencies read more
mushtaq
mushtaqOP10mo ago
omg I cannot fathom this the path was the issue thanks brother
Want results from more Discord servers?
Add your server