From d8068715eff8536bb223b191aaa69efc35af1a36 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Tue, 29 Nov 2022 08:27:00 -0500 Subject: Fixed formatting for embeds --- AudioBackend.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'AudioBackend.js') diff --git a/AudioBackend.js b/AudioBackend.js index b629882..3cd2867 100644 --- a/AudioBackend.js +++ b/AudioBackend.js @@ -169,8 +169,8 @@ export async function playAudio(bot) { return `${hours}:${minutes}:${seconds}`; }; formattedDuration = toHHMMSS(duration); - } catch (error) { - console.error(error.message); + } catch (e) { + console.error(e); } audio = audio.split('.').slice(0, -1).join('.'); @@ -184,11 +184,14 @@ export async function playAudio(bot) { const statusEmbed = new EmbedBuilder(); if (metadataEmpty === true) { - statusEmbed.addFields({ name: 'Now Playing', value: audio }); - statusEmbed.addFields({ name: 'Duration', value: formattedDuration }); + statusEmbed.setTitle({ title: 'Now Playing' }) + statusEmbed.addFields( + { name: 'Title', value: audio }, + { name: 'Duration', value: formattedDuration } + ); statusEmbed.setColor('#0066ff'); } else { - statusEmbed.setTitle('Now Playing'); + statusEmbed.setTitle({ title: 'Now Playing' }); statusEmbed.addFields( { name: 'Title', value: audioTitle }, { name: 'Artist', value: audioArtist }, -- cgit v1.2.3