Rewrite MessageLinkEmbeds part 2

This commit is contained in:
Vendicated 2023-03-02 21:05:09 +01:00
parent d6a3edefd9
commit ab8c93fbac
No known key found for this signature in database
GPG Key ID: A1DC0CFB5615D905

View File

@ -168,8 +168,8 @@ function noContent(attachments: number, embeds: number) {
function requiresRichEmbed(message: Message) {
if (message.components.length) return true;
if (message.attachments.some(a => a.content_type?.startsWith("image/"))) return true;
if (message.embeds.some(e => e.type === "image" || (e.type === "gifv" && !tenorRegex.test(e.url!)))) return true;
if (message.attachments.some(a => !a.content_type?.startsWith("image/"))) return true;
if (message.embeds.some(e => e.type !== "image" && (e.type !== "gifv" || tenorRegex.test(e.url!)))) return true;
return false;
}