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:
parent
f81e5f6afa
commit
81d4313631
@ -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[] = [];
|
||||
|
||||
Reference in New Issue
Block a user