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);
        });


Is there anything to optimise? ? My bot take a lot of seconds to start playing the music
Was this page helpful?