diff --git a/src/events/guildMemberAdd.ts b/src/events/guildMemberAdd.ts index 6b9bcef..2701009 100644 --- a/src/events/guildMemberAdd.ts +++ b/src/events/guildMemberAdd.ts @@ -27,7 +27,5 @@ export default class GuildMemberAdd { {name: '🔹 Account Creation Date', value: `\n`}, {name: '🔹 Invite Data:', value: usedInvite ? `Invite: \`${usedInvite.code}\`\nCreated by: **${usedInvite.inviter?.username}**\nChannel: **#${usedInvite.channel.name}**` : 'No invite data could be fetched.'} )]}); - - await client.punishments.caseEvasionCheck(member); } } diff --git a/src/models/punishments.ts b/src/models/punishments.ts index fca7fd6..783a1f7 100644 --- a/src/models/punishments.ts +++ b/src/models/punishments.ts @@ -5,7 +5,6 @@ import {Punishment} from 'src/interfaces'; import DatabaseServer from '../components/DatabaseServer.js'; import {Model, DataTypes} from 'sequelize'; import CacheServer from '../components/CacheServer.js'; -import MessageTool from '../helpers/MessageTool.js'; import Formatters from '../helpers/Formatters.js'; class punishments extends Model { @@ -95,15 +94,6 @@ export class PunishmentsSvc { const result = await this.model.findAll(); return Math.max(...result.map((x:Punishment)=>x.case_id), 0) + 1; } - async caseEvasionCheck(member:Discord.GuildMember) { - if (await this.model.findOne({where: {member: member.id, type: 'mute', expired: null}})) { - (this.client.channels.cache.get(this.client.config.dcServer.channels.dcmod_chat) as Discord.TextChannel).send({embeds: [new this.client.embed().setColor(this.client.config.embedColorYellow).setTitle('Case evasion detected').setDescription(MessageTool.concatMessage( - `**${member.user.username}** (\`${member.user.id}\`) has been detected for case evasion.`, - 'Timeout has been automatically added. (25 days)' - )).setTimestamp()]}); - await this.punishmentAdd('mute', {time: '25d'}, this.client.user.id, 'AUTOMOD:Case evasion', member.user, member) - } - } async findInCache():Promise { const cacheKey = 'punishments'; const cachedResult = await CacheServer.get(cacheKey, true);