resetting linux lol
diff --git a/src/events/messageChecks.ts b/src/events/messageChecks.ts
index 4e99c61..2755ff1 100644
--- a/src/events/messageChecks.ts
+++ b/src/events/messageChecks.ts
@@ -1,9 +1,11 @@
import { LinkCheck, MalwareCheck, NSFWCheck, SizeCheck, TestString, TestImage } from '../automations/unscan.js'
import { Message } from 'discord.js'
+import client from '../utils/client.js'
export const event = 'messageCreate'
export async function callback(client, message) {
+ const { log, NucleusColors, entry, renderUser } = client.logger
if (message.author.bot) return
if (message.channel.type === 'dm') return
@@ -16,8 +18,7 @@
!message.author.roles.cache.some(role => config.filters.invite.allowed.roles.includes(role.id))
) {
if ((/(?:https?:\/\/)?discord(?:app)?\.(?:com\/invite|gg)\/[a-zA-Z0-9]+\/?/.test(content))) {
- message.delete();
- return toLog(message, 'invite', content.match(/(?:https?:\/\/)?discord(?:app)?\.(?:com\/invite|gg)\/[a-zA-Z0-9]+\/?/))
+ return message.delete();
}
}
}
@@ -34,22 +35,19 @@
if(/\.+(webp|png|jpg|jpeg|bmp)/.test(url)) {
if (config.filters.images.NSFW && !message.channel.nsfw) {
if (await NSFWCheck(url)) {
- await message.delete()
- return toLog(message, 'NSFW', url)
+ return await message.delete()
}
}
if (config.filters.images.size) {
if(!url.match(/\.+(webp|png|jpg)$/gi)) return
if(!await SizeCheck(element)) {
- await message.delete()
- return toLog(message, 'size', url)
+ return await message.delete()
}
}
}
if (config.filters.malware) {
if (!MalwareCheck(url)) {
- await message.delete()
- return toLog(message, 'malware', url)
+ return await message.delete()
}
}
}
@@ -58,15 +56,13 @@
if(!message) return;
if (await LinkCheck(message)) {
- await message.delete()
- return toLog(message, 'link')
+ return await message.delete()
}
if (config.filters.wordFilter.enabled) {
let check = TestString(content, config.filters.wordFilter.words.loose, config.filters.wordFilter.words.strict)
- if(check != "none") {
- await message.delete()
- return toLog(message, 'wordFilter', content)
+ if(check !== null) {
+ return await message.delete()
}
}
@@ -75,26 +71,19 @@
!message.author.roles.cache.some(role => config.filters.pings.allowed.roles.includes(role.id))
) {
if (config.filters.pings.everyone && message.mentions.everyone) {
- message.delete();
- return toLog(message, 'mention everyone')
+ return message.delete();
}
if (config.filters.pings.roles) {
for(let role of message.mentions.roles) {
if(!message) return;
if (!config.filters.pings.allowed.roles.includes(role.id)) {
- message.delete();
- return toLog(message, 'mention role')
+ return message.delete();
}
}
}
if(!message) return;
if (message.mentions.users.size >= config.filters.pings.mass && config.filters.pings.mass) {
- message.delete();
- return toLog(message, 'Mass Pings')
+ return message.delete();
}
}
}
-
-async function toLog(message: Message, reason: string, data?: any) {
- // log(message.guild.id, {type: reason, data: data})
-}