starboard: don't include image link when discord hides it

This commit is contained in:
Dragory 2020-12-23 02:37:08 +02:00
parent ff98670cf5
commit b616b6a02a
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -28,7 +28,9 @@ export async function saveMessageToStarboard(
embed.author.icon_url = msg.author.avatarURL;
}
if (msg.content) {
// The second condition here checks for messages with only an image link that is then embedded.
// The message content in that case is hidden by the Discord client, so we hide it here too.
if (msg.content && msg.embeds[0]?.thumbnail?.url !== msg.content) {
embed.description = msg.content;
}