1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-12-22 21:13:18 +00:00

possible fix

This commit is contained in:
MatteZ02 2020-05-05 12:52:35 +03:00
parent 1e760bb730
commit fe38315c34
2 changed files with 8 additions and 3 deletions

View File

@ -113,17 +113,17 @@ async function searchVideos(data, client, msg, voiceChannel) {
for (let i = 0; data.body.tracks.items.length > i; i++) { for (let i = 0; data.body.tracks.items.length > i; i++) {
const track = await data.body.tracks.items[i].track; const track = await data.body.tracks.items[i].track;
await client.funcs.sleep(250); await client.funcs.sleep(250);
await search( search(
`${track.artists[0].name} ${track.name} audio`, `${track.artists[0].name} ${track.name} audio`,
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);
if (res.videos.length === 0) { if (res.videos.length === 0) {
await search( search(
`${track.artists[0].name} ${track.name} lyrics`, `${track.artists[0].name} ${track.name} lyrics`,
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);
if (res.videos.length === 0) { if (res.videos.length === 0) {
await search( search(
`${track.artists[0].name} ${track.name}`, `${track.artists[0].name} ${track.name}`,
async function (err, res) { async function (err, res) {
if (err) return console.log(err); if (err) return console.log(err);

View File

@ -15,6 +15,11 @@ module.exports = async function (guild, song, client, seek, play) {
streamConfig.options.seek = seek; streamConfig.options.seek = seek;
if (!song.url) {
queue.songs.shift();
song = queue.songs[0]
}
let input = song.url; let input = song.url;
if (song.type === "ytdl") input = ytdl(song.url, streamConfig.ytdlOptions); if (song.type === "ytdl") input = ytdl(song.url, streamConfig.ytdlOptions);