From 5b07c150dc6dfed297e1aae1e5e41d845426aff3 Mon Sep 17 00:00:00 2001 From: Cynthia Date: Sat, 10 Dec 2022 16:10:20 -0700 Subject: [PATCH] music: fix now playing bar for streams --- src/modules/music.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/modules/music.js b/src/modules/music.js index 2dc7d34..20ffeaa 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -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(