Skip to content

Commit

Permalink
Merge pull request #161 from destinygg/fix/steven-cant-use-regex
Browse files Browse the repository at this point in the history
fix: wrap nuke/meganuke phrase in a regex with word boundaries
  • Loading branch information
11k authored Oct 2, 2024
2 parents b74009c + fd4899d commit 92e283f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/commands/implementations/nuke.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ function nuke(isMegaNuke) {
);
}
}
const wordToMute = nukeRegex === '' ? nukeWord : new RegExp(nukeRegex, 'i');
const wordToMute =
nukeRegex === '' ? new RegExp(`\\b${nukeWord}\\b`, 'i') : new RegExp(nukeRegex, 'i');
const now = moment().unix();

const messageList = services.chatCache.runningMessageList.filter((userPost) => {
Expand Down

0 comments on commit 92e283f

Please sign in to comment.