1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 00:10:58 -05:00

Remove unused automod function

This commit is contained in:
toast-ts 2024-02-12 04:57:54 +11:00
parent 81f590dea7
commit e578c2b7da
2 changed files with 0 additions and 12 deletions

View File

@ -27,7 +27,5 @@ export default class GuildMemberAdd {
{name: '🔹 Account Creation Date', value: `<t:${Math.round(member.user.createdTimestamp/1000)}>\n<t:${Math.round(member.user.createdTimestamp/1000)}:R>`},
{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);
}
}

View File

@ -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<any> {
const cacheKey = 'punishments';
const cachedResult = await CacheServer.get(cacheKey, true);