From e5b85e454de41a119972306ad2d1ef8df1255131 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Sat, 13 May 2023 01:27:30 -0400 Subject: [PATCH] fix: don't expand message links for bots (#164) Signed-off-by: PandaNinjas --- src/utils/resolveMessage.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/resolveMessage.ts b/src/utils/resolveMessage.ts index e1ec162..4540898 100644 --- a/src/utils/resolveMessage.ts +++ b/src/utils/resolveMessage.ts @@ -20,6 +20,8 @@ function findFirstImage(message: Message): string | undefined { } export async function expandDiscordLink(message: Message): Promise { + if (message.author.bot && !message.author.webhookId) return; + const re = /(https?:\/\/)?(?:canary\.|ptb\.)?discord(?:app)?\.com\/channels\/(?\d+)\/(?\d+)\/(?\d+)/g;