From e46d8e15da96ef49cf7a2258a7819e2639b777e6 Mon Sep 17 00:00:00 2001
From: Dragory <2606411+Dragory@users.noreply.github.com>
Date: Thu, 30 Jul 2020 22:49:34 +0300
Subject: [PATCH] automod: fix member_join trigger only_new matching

---
 backend/src/plugins/Automod/triggers/memberJoin.ts | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/backend/src/plugins/Automod/triggers/memberJoin.ts b/backend/src/plugins/Automod/triggers/memberJoin.ts
index 3efca615..50b84541 100644
--- a/backend/src/plugins/Automod/triggers/memberJoin.ts
+++ b/backend/src/plugins/Automod/triggers/memberJoin.ts
@@ -20,9 +20,7 @@ export const MemberJoinTrigger = automodTrigger<unknown>()({
 
     if (triggerConfig.only_new) {
       const threshold = Date.now() - convertDelayStringToMS(triggerConfig.new_threshold);
-      if (context.member.createdAt >= threshold) {
-        return {};
-      }
+      return context.member.createdAt >= threshold ? {} : null;
     }
 
     return {};