summary refs log tree commit diff
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@protonmail.com>2022-12-13 08:23:08 -0500
committerGitHub <noreply@github.com>2022-12-13 08:23:08 -0500
commitdd4745ab46bf4f9d8dcc43f27830cd2363382284 (patch)
tree316c66db0701cc24f36de7e38061635eb9f4fa9e
parentfix adding roles to users (diff)
parentMerge pull request #910 from Puyodead1/patch1 (diff)
downloadserver-dd4745ab46bf4f9d8dcc43f27830cd2363382284.tar.xz
Merge branch 'staging' into patch/roles
-rw-r--r--src/api/util/handlers/Message.ts6
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 {