diff --git a/commands/play.js b/commands/play.js index 72c6fbc..1a631f9 100644 --- a/commands/play.js +++ b/commands/play.js @@ -14,9 +14,12 @@ exports.run = async (client, message, args) => { // If there's already a track playing if(aTrackIsAlreadyPlaying){ - // Add the track to the queue + //Add the track to the queue const result = await client.player.addToQueue(message.guild.id, args.join(" ")).catch(() => {}); - if(!result) return message.channel.send(`This song provider is not supported...`); + if(!result) { + message.member.voice.channel.leave() + return message.channel.send(`This song provider is not supported...`) + }; if(result.type === 'playlist'){ message.channel.send(`${result.tracks.length} songs added to the queue ${emotes.music}`); @@ -28,7 +31,10 @@ exports.run = async (client, message, args) => { // Else, play the song const result = await client.player.play(message.member.voice.channel, args.join(" ")).catch(() => {}); - if(!result) return message.channel.send(`This song provider is not supported...`); + if(!result) { + message.member.voice.channel.leave() + return message.channel.send(`This song provider is not supported...`) + }; if(result.type === 'playlist'){ message.channel.send(`${result.tracks.length} songs added to the queue ${emotes.music}\nCurrently playing ${result.tracks[0].name} !`);