mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-16 18:56:00 +00:00
Chore update 3.8.2
This commit is contained in:
@ -28,11 +28,8 @@ module.exports = {
|
||||
!queue.songs[0] &&
|
||||
queue.endReason !== "stop"
|
||||
) {
|
||||
const prevSongs = queue.prevSongs.filter(
|
||||
(song) => song.type == "spotify"
|
||||
);
|
||||
if (prevSongs.length >= 0)
|
||||
return findSimilar(client, queue, prevSongs, guild);
|
||||
if (queue.prevSongs.length > 0)
|
||||
return findSimilar(client, queue, queue.prevSongs, guild);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -44,8 +41,8 @@ function findSimilar(client, queue, prevSongs, guild) {
|
||||
let retries = 0;
|
||||
const query =
|
||||
prevSongs[Math.floor(Math.random() * Math.floor(prevSongs.length))];
|
||||
if (!query) return;
|
||||
similarSongs.find({
|
||||
similarSongs.find(
|
||||
{
|
||||
title: query.track.name,
|
||||
artist: query.track.artists[0].name,
|
||||
limit: 10,
|
||||
@ -69,6 +66,7 @@ function findSimilar(client, queue, prevSongs, guild) {
|
||||
author: {},
|
||||
type: "ytdl",
|
||||
info: songInfo.videoDetails,
|
||||
track: query.track,
|
||||
});
|
||||
client.funcs.play(guild, queue.songs[0], client, 0, true);
|
||||
} else {
|
||||
@ -82,4 +80,4 @@ function findSimilar(client, queue, prevSongs, guild) {
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user