Auto pause

For some reason the bot is auto pausing the audio immediately once it starts, here's my code:
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: guild.id,
adapterCreator: guild.voiceAdapterCreator,
});

const audioPlayer = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
volume: 0.5,
});
connection.subscribe(audioPlayer);

const resource = createAudioResource("./DrinkingwithCupid.mp3", {
inputType: "ffmpeg",
inlineVolume: true,
});

audioPlayer.play(resource);
audioPlayer.on("stateChange", (oldState, newState) => {
console.log(`Player Status: ${oldState.status} -> ${newState.status}`);
if (newState.status === "Playing") {
console.log("Audio Player is now playing.");
}
});
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: guild.id,
adapterCreator: guild.voiceAdapterCreator,
});

const audioPlayer = createAudioPlayer({
behaviors: {
noSubscriber: NoSubscriberBehavior.Pause,
},
volume: 0.5,
});
connection.subscribe(audioPlayer);

const resource = createAudioResource("./DrinkingwithCupid.mp3", {
inputType: "ffmpeg",
inlineVolume: true,
});

audioPlayer.play(resource);
audioPlayer.on("stateChange", (oldState, newState) => {
console.log(`Player Status: ${oldState.status} -> ${newState.status}`);
if (newState.status === "Playing") {
console.log("Audio Player is now playing.");
}
});
1 Reply
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! - Marked as resolved by OP
Want results from more Discord servers?
Add your server