Properly filter existing embed links

In a previous PR, I was checking if the `.url` property existed, the
correct fix is to remove any embed that isn't a rich embed
type (non-link).

See also: #1296
This commit is contained in:
Zane Helton
2025-06-29 08:39:42 +10:00
committed by Madeline
parent f81e5f6afa
commit 81d4313631
+2 -8
View File
@@ -290,14 +290,8 @@ export async function postHandleMessage(message: Message) {
}
}
// Remove ALL embeds that have URLs when processing links (start fresh)
data.embeds = data.embeds.filter((embed) => {
if (!embed.url) {
return true;
}
return false;
});
// Filter out embeds that could be links, start from scratch
data.embeds = data.embeds.filter((embed) => embed.type === "rich");
const seenNormalizedUrls = new Set<string>();
const uniqueLinks: string[] = [];