From 018bbe34c55c45382e799c2ff3aa39f55da9cf87 Mon Sep 17 00:00:00 2001 From: vyneer Date: Thu, 3 Oct 2024 00:37:10 +0300 Subject: [PATCH] fix: aegissingle not cleansing normal nukes anymore --- lib/commands/implementations/aegis.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/commands/implementations/aegis.js b/lib/commands/implementations/aegis.js index b56f6b8..c034cdb 100644 --- a/lib/commands/implementations/aegis.js +++ b/lib/commands/implementations/aegis.js @@ -24,7 +24,10 @@ function aegisSingle(input, services) { const matched = /(?:\/(.*)\/)?(.*)/.exec(input); const aegisWord = _.get(matched, 2).toLowerCase(); const aegisRegex = _.get(matched, 1, ''); - const wordToUnnuke = aegisRegex === '' ? aegisWord : (new RegExp(aegisRegex, 'i')).toString(); + const wordToUnnuke = + aegisRegex === '' + ? new RegExp(`\\b${aegisWord}\\b`, 'i').toString() + : new RegExp(aegisRegex, 'i').toString(); const usersToUnmute = services.punishmentCache.getNukedUsersForPhrase(wordToUnnuke); services.punishmentCache.cleanseSingleNuke(wordToUnnuke); if (usersToUnmute.length === 0) {