Compare commits

..

No commits in common. "28481c2775e826d9454d3081e70b4ecdf9055471" and "ad141377e7d92277d45b51236726eb062bb232d9" have entirely different histories.

View file

@ -213,13 +213,7 @@ async function enqueue({
].url
.replace("vi_webp", "vi")
.replace(".webp", ".jpg");
const formats = info?.format;
let url;
if (formats) {
formats.sort((a, b) => b.bitrate - a.bitrate);
media = formats[0].url;
}
media = {url: info?.format.sort((a, b) => b.bitrate - a.bitrate)[0].url};
} else if (type == "sc") {
if (url?.startsWith("sc:"))
url = url.replace(/^sc:/, "https://soundcloud.com/");
@ -239,7 +233,7 @@ async function enqueue({
title = info.title;
length = info.duration;
thumbnail = info.artwork_url;
media = streamUrl;
media = {stream: streamUrl};
} else if (type == "file") {
title = url;
let info;
@ -265,7 +259,7 @@ async function enqueue({
}
length = info.duration ? Math.floor(info.duration) * 1000 : 0;
media = url;
media = {stream: url};
}
if (connection.connection.playing) {
@ -296,7 +290,7 @@ async function enqueue({
fields: [
{
name: "Title",
value: (title && title != url ? `[${title}](${url})` : url).substring(0, 1024),
value: title && title != url ? `[${title}](${url})` : url,
inline: true,
},
{
@ -329,7 +323,7 @@ async function enqueue({
return;
}
await connection.connection.play(media, {
await connection.connection.play(media.stream, {
inlineVolume: true,
voiceDataTimeout: -1,
});
@ -342,7 +336,7 @@ async function enqueue({
fields: [
{
name: "Title",
value: (title ? `[${title}](${url})` : url).substring(0, 1024),
value: title ? `[${title}](${url})` : url,
inline: true,
},
{