diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-12-02 00:31:17 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-12-02 00:40:10 -0500 |
| commit | e0fe64b06c0eb8b92578ae1bf5a166f8d633c9b3 (patch) | |
| tree | af930df72f7bfeb2a3ca7c11321f894b02ad7411 /backend/PlayAudio.js | |
| parent | ebdf6e92b146d1bad3b0e295e926f9e43e26c532 (diff) | |
| download | DLAP-e0fe64b06c0eb8b92578ae1bf5a166f8d633c9b3.tar.gz DLAP-e0fe64b06c0eb8b92578ae1bf5a166f8d633c9b3.tar.bz2 DLAP-e0fe64b06c0eb8b92578ae1bf5a166f8d633c9b3.zip | |
Fixed duration date; More stop functions; Required in voice channel
Diffstat (limited to 'backend/PlayAudio.js')
| -rw-r--r-- | backend/PlayAudio.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/backend/PlayAudio.js b/backend/PlayAudio.js index 77a33bc..9b4a83b 100644 --- a/backend/PlayAudio.js +++ b/backend/PlayAudio.js @@ -59,14 +59,7 @@ export async function playAudio(bot) { } else { metadataEmpty = true; } - const toHHMMSS = (numSecs) => { - const secNum = parseInt(numSecs, 10); - const hours = Math.floor(secNum / 3600).toString().padStart(2, '0'); - const minutes = Math.floor((secNum - (hours * 3600)) / 60).toString().padStart(2, '0'); - const seconds = secNum - (hours * 3600) - (minutes * 60).toString().padStart(2, '0'); - return `${hours}:${minutes}:${seconds}`; - }; - duration = toHHMMSS(format.duration); + duration = new Date(format.duration * 1000).toISOString().substr(11, 8); } catch (e) { console.error(e); } @@ -104,8 +97,8 @@ export async function playAudio(bot) { return await channel.send({ embeds: [statusEmbed] }); } -export function updatePlaylist(i) { - switch (i) { +export function updatePlaylist(option) { + switch (option) { case 'next': currentTrack++; audio = files[currentTrack]; |
