From 0e9c1ebea833cd3228fdac95c8f35205569a2115 Mon Sep 17 00:00:00 2001 From: camila314 <47485054+camila314@users.noreply.github.com> Date: Thu, 4 Jan 2024 12:54:08 -0600 Subject: [PATCH] embed support --- src/plugins/keywordNotify/index.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/plugins/keywordNotify/index.tsx b/src/plugins/keywordNotify/index.tsx index 1e9e54755..5af576c08 100644 --- a/src/plugins/keywordNotify/index.tsx +++ b/src/plugins/keywordNotify/index.tsx @@ -182,7 +182,18 @@ export default definePlugin({ if (settings.store.ignoreBots && m.author.bot) return; - if (regexes.some(r => r != "" && safeMatchesRegex(m.content, r))) { + let matches = false; + + if (regexes.some(r => r != "" && (safeMatchesRegex(m.content, r)))) { + matches = true; + } + for (let embed of m.embeds) { + if (regexes.some(r => r != "" && (safeMatchesRegex(embed.description, r) || safeMatchesRegex(embed.title, r)))) { + matches = true; + } + } + + if (matches) { m.mentions.push(this.me); if (m.author.id != this.me.id)