From fe38315c3435592ad260a3ddac967072cdf7d9e3 Mon Sep 17 00:00:00 2001 From: MatteZ02 <47610069+MatteZ02@users.noreply.github.com> Date: Tue, 5 May 2020 12:52:35 +0300 Subject: [PATCH] possible fix --- src/commands/play.js | 6 +++--- src/struct/funcs/play.js | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/commands/play.js b/src/commands/play.js index fb6e5eca..dce6479e 100644 --- a/src/commands/play.js +++ b/src/commands/play.js @@ -113,17 +113,17 @@ async function searchVideos(data, client, msg, voiceChannel) { for (let i = 0; data.body.tracks.items.length > i; i++) { const track = await data.body.tracks.items[i].track; await client.funcs.sleep(250); - await search( + search( `${track.artists[0].name} ${track.name} audio`, async function (err, res) { if (err) return console.log(err); if (res.videos.length === 0) { - await search( + search( `${track.artists[0].name} ${track.name} lyrics`, async function (err, res) { if (err) return console.log(err); if (res.videos.length === 0) { - await search( + search( `${track.artists[0].name} ${track.name}`, async function (err, res) { if (err) return console.log(err); diff --git a/src/struct/funcs/play.js b/src/struct/funcs/play.js index 5ed7c6eb..36428b30 100644 --- a/src/struct/funcs/play.js +++ b/src/struct/funcs/play.js @@ -15,6 +15,11 @@ module.exports = async function (guild, song, client, seek, play) { streamConfig.options.seek = seek; + if (!song.url) { + queue.songs.shift(); + song = queue.songs[0] + } + let input = song.url; if (song.type === "ytdl") input = ytdl(song.url, streamConfig.ytdlOptions);