forked from Galactic/galactic-bot
wordwatcher tweak
This commit is contained in:
parent
287bcd6cf4
commit
e77f3c6254
@ -321,7 +321,7 @@ module.exports = class AutoModeration extends Observer {
|
||||
|
||||
for (const reg of words) {
|
||||
|
||||
match = content.match(new RegExp(` ${reg} `, 'iu'));
|
||||
match = content.match(new RegExp(`(?:^|\\s)${reg}`, 'iu'));
|
||||
|
||||
if (match) break;
|
||||
|
||||
@ -337,7 +337,7 @@ module.exports = class AutoModeration extends Observer {
|
||||
`, // ** User:** <@${ author.id }>
|
||||
color: 15120384,
|
||||
fields: context.reverse().reduce((acc, val) => {
|
||||
const text = val.content.length ? val.content.replace(match, '**__$&__**') : '**NO CONTENT**';
|
||||
const text = val.content.length ? Util.escapeMarkdown(val.content).replace(match, '**__$&__**') : '**NO CONTENT**';
|
||||
acc.push({
|
||||
name: `${val.author.tag} (${val.author.id}) - ${val.id}`,
|
||||
value: text.length < 1024 ? text : text.substring(0, 1013) + '...'
|
||||
|
Loading…
Reference in New Issue
Block a user