diff options
author | Puyodead1 <puyodead@protonmail.com> | 2022-11-20 16:36:36 -0500 |
---|---|---|
committer | Puyodead1 <puyodead@protonmail.com> | 2022-11-20 16:36:36 -0500 |
commit | 2f44691ff4e8314c06d5f3283d9644f6d30bea8b (patch) | |
tree | 117d1f3a57a285097755c83dfd629e158f05a35e | |
parent | Merge pull request #891 from fosscord/dev/improve-security (diff) | |
download | server-2f44691ff4e8314c06d5f3283d9644f6d30bea8b.tar.xz |
fix
-rw-r--r-- | src/api/util/handlers/Message.ts | 6 |
1 files 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<Message> { // 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 { |