aboutsummaryrefslogtreecommitdiff
path: root/AudioBackend
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2024-02-14 23:11:21 -0500
committerAndrew Lee <alee14498@protonmail.com>2024-02-14 23:11:21 -0500
commitf815095b28de01959c536850462566e9a37a01f3 (patch)
treef534544eb0890694d3925f53e7d94e21a8455011 /AudioBackend
parentc180bd541adb689d6bc0ab72473fd5408e38d312 (diff)
downloadDLAP-f815095b28de01959c536850462566e9a37a01f3.tar.gz
DLAP-f815095b28de01959c536850462566e9a37a01f3.tar.bz2
DLAP-f815095b28de01959c536850462566e9a37a01f3.zip
Thumbnails on embeds
Diffstat (limited to 'AudioBackend')
-rw-r--r--AudioBackend/PlayAudio.js15
1 files changed, 10 insertions, 5 deletions
diff --git a/AudioBackend/PlayAudio.js b/AudioBackend/PlayAudio.js
index 5c45418..a0cfb39 100644
--- a/AudioBackend/PlayAudio.js
+++ b/AudioBackend/PlayAudio.js
@@ -68,7 +68,7 @@ export async function playAudio(bot) {
const imageBuffer = Buffer.from(common.picture[0].data, 'base64');
// Create a new attachment using the buffer
- audioPicture = new AttachmentBuilder(imageBuffer, 'albumArt.png');
+ audioPicture = new AttachmentBuilder(imageBuffer, { name: 'albumArt.png' });
}
} else {
metadataEmpty = true;
@@ -105,15 +105,20 @@ export async function playAudio(bot) {
{ name: t('musicDuration'), value: `${duration}` }
);
- // if (audioPicture) {
- // statusEmbed.setThumbnail('attachment://albumArt.png');
- // }
+ if (audioPicture) {
+ statusEmbed.setThumbnail('attachment://albumArt.png');
+ }
+
statusEmbed.setFooter({ text: t('playerFooter', { audioAlbum, audioFile }) });
statusEmbed.setColor('#0066ff');
}
const channel = bot.channels.cache.get(statusChannel);
if (!channel) return console.error(t('statusChannelError'));
- return await channel.send({ embeds: [statusEmbed] });
+ if (audioPicture) {
+ return await channel.send({ embeds: [statusEmbed], files: [audioPicture] });
+ } else {
+ return await channel.send({ embeds: [statusEmbed] });
+ }
}
export function updatePlaylist(option) {