! はげたこ
DIAdiscord.js - Imagine an app
•Created by ! はげたこ on 5/6/2024 in #djs-voice
I tried to play ogg but it doesn't play
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));
}
});
});
28 replies
DIAdiscord.js - Imagine an app
•Created by ! はげたこ on 5/6/2024 in #djs-voice
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));
}
});
});
2 replies