From 2f44691ff4e8314c06d5f3283d9644f6d30bea8b Mon Sep 17 00:00:00 2001 From: Puyodead1 Date: Sun, 20 Nov 2022 16:36:36 -0500 Subject: fix --- src/api/util/handlers/Message.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/api/util/handlers/Message.ts b/src/api/util/handlers/Message.ts index d760d27c..fcba29b7 100644 --- a/src/api/util/handlers/Message.ts +++ b/src/api/util/handlers/Message.ts @@ -148,13 +148,13 @@ export async function handleMessage(opts: MessageOptions): Promise { // TODO: cache link result in db export async function postHandleMessage(message: Message) { - let links = message.content?.match(LINK_REGEX); - if (!links) return; + const matches = message.content?.match(LINK_REGEX); + if (!matches) return; const data = { ...message }; data.embeds = data.embeds.filter((x) => x.type !== "link"); - links = links.slice(0, 20); // embed max 20 links — TODO: make this configurable with instance policies + const links = matches.slice(0, 20); // embed max 20 links — TODO: make this configurable with instance policies for (const link of links) { try { -- cgit 1.4.1