From 8aea62156a90447e7992e3e2671d10220608eb76 Mon Sep 17 00:00:00 2001 From: Andrea Saez Date: Sat, 16 Mar 2024 10:36:38 +0100 Subject: [PATCH] fix: improve filtering --- src/cron.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cron.ts b/src/cron.ts index a9de903..afd6b46 100644 --- a/src/cron.ts +++ b/src/cron.ts @@ -87,7 +87,7 @@ const initCronJob = async (client: Client) => { const filters = await FirestoreChannel.getFilters(channelId); const noFiltersDefined = filters.length === 0; const someFiltersMatch = filters.some((f) => { - const regex = new RegExp(f, "i"); + const regex = new RegExp(`[\\s,;.-_'"]${f}[\\s,;.-_'"]`, "i"); return regex.test(pub.title) || regex.test(pub.contentSnippet); });