From e578c2b7da0a0b59559ab1fbfa66d4c42dcfa030 Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Mon, 12 Feb 2024 04:57:54 +1100 Subject: [PATCH] Remove unused automod function --- src/events/guildMemberAdd.ts | 2 -- src/models/punishments.ts | 10 ---------- 2 files changed, 12 deletions(-) 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);