My bot take a lot of seconds to start playing the music

HII
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
selfDeaf: true,
});
const resource = createAudioResource(radio, {
inputType: StreamType.WebmOpus,
inlineVolume: true
});
resource.volume.setVolume(0.1 * (vol));
const player = createAudioPlayer();
player.play(resource);
connection.subscribe(player);
player.on('error', error => {
console.error('Error:', error.message);
});
const connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
selfDeaf: true,
});
const resource = createAudioResource(radio, {
inputType: StreamType.WebmOpus,
inlineVolume: true
});
resource.volume.setVolume(0.1 * (vol));
const player = createAudioPlayer();
player.play(resource);
connection.subscribe(player);
player.on('error', error => {
console.error('Error:', error.message);
});
Is there anything to optimise? ? My bot take a lot of seconds to start playing the music
2 Replies
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Millenium is here
Millenium is hereOP•3y ago
(i think this part of code can help a lot of peoples too 😉 )
Want results from more Discord servers?
Add your server