music: fix now playing bar for streams

This commit is contained in:
Cynthia Foxwell 2022-12-10 16:10:20 -07:00
parent 484fd1aa10
commit 5b07c150dc

View file

@ -359,9 +359,7 @@ async function enqueue({
return;
}
console.log(media);
const resource = createAudioResource(media.stream, {inputType: media.type});
console.log(resource);
connection.player.play(resource);
textChannel.createMessage({
@ -649,10 +647,10 @@ command.callback = async function (
const position = Date.now() - nowPlaying.start;
const timeEnd = formatTime(nowPlaying.length);
const timeEnd = nowPlaying.length == 0 ? "\u221e" : formatTime(nowPlaying.length);
const timePos = formatTime(position);
const progress = position / nowPlaying.length;
const progress = nowPlaying.length == 0 ? 1 : position / nowPlaying.length;
const barLength = Math.round(progress * NOWPLAYING_BAR_LENGTH);
const bar = `\`[${"=".repeat(barLength)}${" ".repeat(