diff --git a/src/plugins/messageLinkEmbeds/index.tsx b/src/plugins/messageLinkEmbeds/index.tsx index 5c306362..6c8fd83e 100644 --- a/src/plugins/messageLinkEmbeds/index.tsx +++ b/src/plugins/messageLinkEmbeds/index.tsx @@ -227,10 +227,8 @@ function MessageEmbedAccessory({ message }: { message: Message; }) { const accessories = [] as (JSX.Element | null)[]; - let match = null as RegExpMatchArray | null; - while ((match = messageLinkRegex.exec(message.content!)) !== null) { - const [_, channelID, messageID] = match; - if (embeddedBy.includes(messageID)) { + for (const [_, channelID, messageID] of message.content!.matchAll(messageLinkRegex)) { + if (embeddedBy.includes(messageID) || embeddedBy.length > 2) { continue; }