Low res thumbnail fix

This commit is contained in:
2022-03-04 00:29:50 +07:00
parent 11f5a3fd20
commit 4f24a41ac6
4 changed files with 22 additions and 4 deletions
+5 -1
View File
@@ -61,7 +61,11 @@ const EMBEDS = {
user: DiscordProvider.client.user
});
embed.setImage(track.thumbnails[0].url);
const highestResolutionThumbnail = track.thumbnails.reduce((prev, current) => (prev.height * prev.width > current.height * current.width) ? prev : current)
if(highestResolutionThumbnail)
embed.setImage(highestResolutionThumbnail.url);
return embed;
}
}
+5 -1
View File
@@ -14,7 +14,11 @@ const EMBEDS = {
user: DiscordProvider.client.user
});
embed.setImage(track.thumbnails[0].url);
const highestResolutionThumbnail = track.thumbnails.reduce((prev, current) => (prev.height * prev.width > current.height * current.width) ? prev : current)
if(highestResolutionThumbnail)
embed.setImage(highestResolutionThumbnail.url);
return embed;
},
NO_MUSIC_PLAYING: (data: Message | Interaction) => {
+6 -1
View File
@@ -38,7 +38,12 @@ const EMBEDS = {
description: `${track.title}`,
user: (data instanceof Interaction) ? data.user : data.author
});
embed.setImage(track.thumbnails[0].url);
const highestResolutionThumbnail = track.thumbnails.reduce((prev, current) => (prev.height * prev.width > current.height * current.width) ? prev : current)
if(highestResolutionThumbnail)
embed.setImage(highestResolutionThumbnail.url);
return embed;
},
ADDED_SONGS_QUEUE: (data: Message | Interaction, track: ValidTracks[]) => {
+6 -1
View File
@@ -38,7 +38,12 @@ const EMBEDS = {
description: `${track.title}`,
user: (data instanceof Interaction) ? data.user : data.author
});
embed.setImage(track.thumbnails[0].url);
const highestResolutionThumbnail = track.thumbnails.reduce((prev, current) => (prev.height * prev.width > current.height * current.width) ? prev : current)
if(highestResolutionThumbnail)
embed.setImage(highestResolutionThumbnail.url);
return embed;
},
USER_NOT_IN_VOICECHANNEL: (data: Message | Interaction) => {