music.queue: timestamps try 3

This commit is contained in:
Cynthia Foxwell 2022-04-24 11:41:19 -06:00
parent b20344e2a3
commit a3f32a8954
1 changed files with 5 additions and 4 deletions

View File

@ -607,8 +607,7 @@ command.callback = async function (msg, line) {
const nowPlaying = connection._music_nowplaying;
const now = Date.now();
let nextTrack =
now + (Math.floor(nowPlaying.length / 1000) - (now - nowPlaying.start));
let nextTrack = now + (nowPlaying.length - (now - nowPlaying.start));
const fields = [];
for (const index in queue.slice(0, 8)) {
const item = queue[index];
@ -616,10 +615,12 @@ command.callback = async function (msg, line) {
name: item.title ?? item.url,
value: `${item.title ? `[Link](${item.url}) - ` : ""}${formatTime(
item.length
)}\nAdded by: <@${item.addedBy}>\n<t:${nextTrack}:R>`,
)}\nAdded by: <@${item.addedBy}>\n<t:${Math.floor(
nextTrack / 1000
)}:R>`,
inline: true,
});
nextTrack += Math.floor(item.length / 1000);
nextTrack += item.length;
}
return {