oggをループ再生しようとしたがエラーが出ずに音が聞こえない

although I can participate in the VC, the music does not play. There are no errors.
client.once('ready', async () => {
console.log('Ready!');
const guildId = '1236559277670531142';
const channelId = '1236989524903723028';
const loopUrl = 'https://cdn.glitch.global/c2c4a2c3-b622-45de-81be-91a67ca39b93/Chill-beats-lofi-hiphop-mix-__-study_chill_stay-home-playlist%E3%80%90night-lullaby% E3%80%91.ogg?v=1715028861751';
const guild = await client.guilds.fetch(guildId);
if (!guild) return console.error('Guild not found.');
const channel = guild.channels.cache.get(channelId);
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: guild.id,
adapterCreator: guild.voiceAdapterCreator,
});
connection.on('error', console.error);
connection.on('stateChange', (oldState, newState) => {
if (newState.status === 'idle') {
connection.play(createAudioResource(loopUrl));
}
});
});
client.once('ready', async () => {
console.log('Ready!');
const guildId = '1236559277670531142';
const channelId = '1236989524903723028';
const loopUrl = 'https://cdn.glitch.global/c2c4a2c3-b622-45de-81be-91a67ca39b93/Chill-beats-lofi-hiphop-mix-__-study_chill_stay-home-playlist%E3%80%90night-lullaby% E3%80%91.ogg?v=1715028861751';
const guild = await client.guilds.fetch(guildId);
if (!guild) return console.error('Guild not found.');
const channel = guild.channels.cache.get(channelId);
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: guild.id,
adapterCreator: guild.voiceAdapterCreator,
});
connection.on('error', console.error);
connection.on('stateChange', (oldState, newState) => {
if (newState.status === 'idle') {
connection.play(createAudioResource(loopUrl));
}
});
});
1 Reply
d.js toolkit
d.js toolkit7mo 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