diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2022-11-29 08:27:00 -0500 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2022-11-29 08:27:00 -0500 |
| commit | d8068715eff8536bb223b191aaa69efc35af1a36 (patch) | |
| tree | dd8a1a367673f40d7495155d8a2dec688a7aef3a | |
| parent | 6d2b8650972cde46953999195f26c29bb5660d36 (diff) | |
| download | DLAP-d8068715eff8536bb223b191aaa69efc35af1a36.tar.gz DLAP-d8068715eff8536bb223b191aaa69efc35af1a36.tar.bz2 DLAP-d8068715eff8536bb223b191aaa69efc35af1a36.zip | |
Fixed formatting for embeds
| -rw-r--r-- | AudioBackend.js | 13 | ||||
| -rw-r--r-- | commands/about.js | 16 |
2 files changed, 17 insertions, 12 deletions
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 }, diff --git a/commands/about.js b/commands/about.js index dbc96c2..442cb48 100644 --- a/commands/about.js +++ b/commands/about.js @@ -31,13 +31,15 @@ export default { async execute(interaction, bot) { const aboutEmbed = new EmbedBuilder() .setAuthor({ name: `About ${bot.user.username}`, iconURL: bot.user.avatarURL() }) - .addFields({ name: 'Information', value: 'A Discord bot that plays local audio tracks.' }) - .addFields({ name: 'Version', value: `DLAP ${npmPackage.version}` }) - .addFields({ name: 'Original Creator', value: 'Andrew Lee (Alee#4277)' }) // Do not remove this since I created this :) - // .addFields({ name: 'Contributors', value: '[your name] (discord#0000)' }) - // .addFields({ name: 'Forked by', value: '[your name] (discord#0000)' }) - .addFields({ name: 'Frameworks', value: `Discord.JS ${version} + Voice` }) - .addFields({ name: 'License', value: 'GNU General Public License v3.0' }) + .addFields( + { name: 'Information', value: 'A Discord bot that plays local audio tracks.' }, + { name: 'Version', value: `DLAP ${npmPackage.version}` }, + { name: 'Original Creator', value: 'Andrew Lee (Alee#4277)' }, // Do not remove this since I created this :) + // { name: 'Contributors', value: '[your name] (discord#0000)' }, + // { name: 'Forked by', value: '[your name] (discord#0000)' }, + { name: 'Frameworks', value: `Discord.JS ${version} + Voice` }, + { name: 'License', value: 'GNU General Public License v3.0' } + ) .setFooter({ text: '© Copyright 2020-2022 Andrew Lee' }) .setColor('#0066ff'); |
