From c7ed529a6cfc4ca0396c44e51f733784eaeb0891 Mon Sep 17 00:00:00 2001 From: camila314 <47485054+camila314@users.noreply.github.com> Date: Sun, 26 Nov 2023 08:32:37 -0600 Subject: [PATCH] add ignore bots --- src/plugins/keywordNotify/index.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/keywordNotify/index.tsx b/src/plugins/keywordNotify/index.tsx index b87ca3f4b..7ee70205b 100644 --- a/src/plugins/keywordNotify/index.tsx +++ b/src/plugins/keywordNotify/index.tsx @@ -74,7 +74,13 @@ function highlightKeywords(s: string, r: Array) { } const settings = definePluginSettings({ - replace: { + ignoreBots: { + type: OptionType.BOOLEAN, + description: "Ignore messages from bots", + default: true + }, + + keywords: { type: OptionType.COMPONENT, description: "", component: () => { @@ -172,6 +178,9 @@ export default definePlugin({ }, applyRegexes(m) { + if (settings.store.ignoreBots && m.author.bot) + return; + if (regexes.some(r => r != "" && safeMatchesRegex(m.content, r))) { m.mentions.push(this.me);