This commit is contained in:
Erik 2021-06-06 19:08:51 +03:00
parent 44251ed305
commit ba952afa46
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

@ -97,6 +97,7 @@ module.exports = class AutoModeration extends Observer {
// Which message obj to work with
const msg = edited || message;
if (!msg.content) return;
let log = `Message filter debug:`;
log += `\nPre norm: ${msg.cleanContent}`;
const content = FilterUtil.normalise(FilterUtil.removeDiscordFormatting(msg.cleanContent));
@ -286,6 +287,7 @@ module.exports = class AutoModeration extends Observer {
const logChannel = await guild.resolveChannel(_logChannel);
const msg = edited || message;
if (!msg.content) return;
const content = FilterUtil.normalise(msg.cleanContent);
let match = null;
@ -340,6 +342,7 @@ module.exports = class AutoModeration extends Observer {
if (roles.some((r) => bypass.includes(r.id)) || ignore.includes(channel.id)) return;
const msg = edited || message;
if (!msg.content) return;
const content = msg.content.split('').join(''); //Copy the string...
const linkRegG = /(https?:\/\/(www\.)?)?(?<domain>([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/\S*)?/iug;
const linkReg = /(https?:\/\/(www\.)?)?(?<domain>([a-z0-9-]{1,63}\.)?([a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})(\.[a-z0-9-]{2,63})?)(\/\S*)?/iu;
@ -421,6 +424,7 @@ module.exports = class AutoModeration extends Observer {
const msg = edited || message;
const { content } = msg;
if (!content) return;
const reg = /((discord)?\s?\.?\s?gg\s?|discord(app)?\.com\/invite)\/\s?(?<code>[a-z0-9]+)/iu;
const match = content.match(reg);
@ -465,6 +469,7 @@ module.exports = class AutoModeration extends Observer {
const reg = /<@!?[0-9]{18,22}>/gu;
const { content } = message;
if (!content) return;
//const mentions = content.match(reg);
}