From 14297f5c56f57e3da6cfae81ba02ba1c68efe859 Mon Sep 17 00:00:00 2001 From: Jayesh Gaba Date: Mon, 14 Oct 2024 02:06:02 +0530 Subject: [PATCH] Implemented a REGEX check for <@ID> Fixed the issue using regex check since bot id is not a guaranteed field in the event data --- triggers/issues.ts | 2 +- triggers/ping.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/triggers/issues.ts b/triggers/issues.ts index 04a3553..17534b6 100644 --- a/triggers/issues.ts +++ b/triggers/issues.ts @@ -21,7 +21,7 @@ const IssuesTrigger: Trigger = { filter: { version: 1, root: { - statement: "{{data.text}} CONTAINS issues", + statement: "{{data.text}} MATCHES '^<@[A-Z0-9]+>\\s+issues$'", }, }, }, diff --git a/triggers/ping.ts b/triggers/ping.ts index 06164e9..5634199 100644 --- a/triggers/ping.ts +++ b/triggers/ping.ts @@ -18,7 +18,7 @@ const pingTrigger: Trigger = { filter: { version: 1, root: { - statement: "{{data.text}} CONTAINS ping", + statement: "{{data.text}} MATCHES '^<@[A-Z0-9]+>\\s+issues$'", }, }, },