Why this message spamming in the log

if (isjoinedchannel || ischangedchannel) {
if(channelid == veri.bilgilendirmekanali){
const player = createAudioPlayer();
player.on(AudioPlayerStatus.Playing, () => {
console.log('The audio player has started playing!');
});
player.on('error', error => {
console.error(`Error: ${error.message} with resource`);
});
const resource = createAudioResource('https://cdn.discordapp.com/attachments/985491649209716816/988916981908533248/SES_KAYDI.mp3');
player.play(resource);
const connection = joinVoiceChannel({
channelId: newState.channelId,
guildId: newState.guild.id,
adapterCreator: newState.channel.guild.voiceAdapterCreator,
});
const subscription = connection.subscribe(player);
if (subscription) {
setTimeout(() => subscription.unsubscribe(), 30_000);
}
}
}
if (isjoinedchannel || ischangedchannel) {
if(channelid == veri.bilgilendirmekanali){
const player = createAudioPlayer();
player.on(AudioPlayerStatus.Playing, () => {
console.log('The audio player has started playing!');
});
player.on('error', error => {
console.error(`Error: ${error.message} with resource`);
});
const resource = createAudioResource('https://cdn.discordapp.com/attachments/985491649209716816/988916981908533248/SES_KAYDI.mp3');
player.play(resource);
const connection = joinVoiceChannel({
channelId: newState.channelId,
guildId: newState.guild.id,
adapterCreator: newState.channel.guild.voiceAdapterCreator,
});
const subscription = connection.subscribe(player);
if (subscription) {
setTimeout(() => subscription.unsubscribe(), 30_000);
}
}
}
3 Replies
d.js toolkit
d.js toolkit2y 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.
duck
duck2y ago
const resource = createAudioResource('https://cdn.discordapp.com/attachments/985491649209716816/988916981908533248/SES_KAYDI.mp3');
not necessarily related to your issue, @discordjs/voice does not stream from urls for you you'll need to fetch/request from the url first createAudioResource accepts a readable stream beyond that, it's entirely possible this code is just executing multiple times
Alperenl
Alperenl2y ago
Aha Türk
Want results from more Discord servers?
Add your server