fix
This commit is contained in:
parent
5c5d62a174
commit
4b14bae282
@ -349,7 +349,7 @@ export async function postHandleMessage(message: Message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Filter out embeds that could be links, start from scratch
|
// Filter out embeds that could be links, start from scratch
|
||||||
data.embeds = data.embeds.filter((embed) => embed.type === "rich");
|
data.embeds = data.embeds.filter((embed) => embed.type !== "rich");
|
||||||
|
|
||||||
const seenNormalizedUrls = new Set<string>();
|
const seenNormalizedUrls = new Set<string>();
|
||||||
const uniqueLinks: string[] = [];
|
const uniqueLinks: string[] = [];
|
||||||
@ -374,10 +374,7 @@ export async function postHandleMessage(message: Message) {
|
|||||||
|
|
||||||
if (uniqueLinks.length === 0) {
|
if (uniqueLinks.length === 0) {
|
||||||
// No valid unique links found, update message to remove old embeds
|
// No valid unique links found, update message to remove old embeds
|
||||||
data.embeds = data.embeds.filter((embed) => {
|
data.embeds = data.embeds.filter((embed) => embed.type !== "rich");
|
||||||
const hasUrl = !!embed.url;
|
|
||||||
return !hasUrl;
|
|
||||||
});
|
|
||||||
const author = data.author?.toPublicUser();
|
const author = data.author?.toPublicUser();
|
||||||
const event = {
|
const event = {
|
||||||
event: "MESSAGE_UPDATE",
|
event: "MESSAGE_UPDATE",
|
||||||
|
|||||||
Reference in New Issue
Block a user