Skip to content

Commit

Permalink
Merge pull request #162 from destinygg/fix/aegissingle-fix
Browse files Browse the repository at this point in the history
fix: aegissingle not cleansing normal nukes anymore
  • Loading branch information
11k authored Oct 3, 2024
2 parents 328e86e + 018bbe3 commit 1ae6929
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/commands/implementations/aegis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1ae6929

Please sign in to comment.