ZerioDev / Music-bot

A complete code to download for a cool Discord music bot !
https://discord.gg/5cGSYV8ZZj
GNU General Public License v3.0
882 stars 1.08k forks source link

Make the bot not leave the voice channel even if it's empty #240

Closed EngShop closed 2 years ago

EngShop commented 2 years ago

Is there anyway that i can configure the bot to just afk on the voice channel?

BlobDeveloper commented 2 years ago

Hello! To keep the bot in the voice channel on queue end & empty voice channel:

In the play.js file where u declare the queue... Replace

        const queue = await player.createQueue(inter.guild, { 
             metadata: inter.channel, 
             spotifyBridge: client.config.opt.spotifyBridge, 
             initialVolume: client.config.opt.defaultvolume, 
             leaveOnEnd: client.config.opt.leaveOnEnd 
         });

With

const queue = await player.createQueue(inter.guild, {
             metadata: inter.channel, 
             spotifyBridge: client.config.opt.spotifyBridge, 
             initialVolume: client.config.opt.defaultvolume, 
             leaveOnEnd: false, 
             leaveOnEmpty: false, 
        });
EngShop commented 2 years ago

thanks!