mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-18 00:31:00 -05:00
Remove unused automod function
This commit is contained in:
parent
04024dea2e
commit
c67b64c514
@ -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: '🔹 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.'}
|
{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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import {Punishment} from 'src/interfaces';
|
|||||||
import DatabaseServer from '../components/DatabaseServer.js';
|
import DatabaseServer from '../components/DatabaseServer.js';
|
||||||
import {Model, DataTypes} from 'sequelize';
|
import {Model, DataTypes} from 'sequelize';
|
||||||
import CacheServer from '../components/CacheServer.js';
|
import CacheServer from '../components/CacheServer.js';
|
||||||
import MessageTool from '../helpers/MessageTool.js';
|
|
||||||
import Formatters from '../helpers/Formatters.js';
|
import Formatters from '../helpers/Formatters.js';
|
||||||
|
|
||||||
class punishments extends Model {
|
class punishments extends Model {
|
||||||
@ -95,15 +94,6 @@ export class PunishmentsSvc {
|
|||||||
const result = await this.model.findAll();
|
const result = await this.model.findAll();
|
||||||
return Math.max(...result.map((x:Punishment)=>x.case_id), 0) + 1;
|
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> {
|
async findInCache():Promise<any> {
|
||||||
const cacheKey = 'punishments';
|
const cacheKey = 'punishments';
|
||||||
const cachedResult = await CacheServer.get(cacheKey, true);
|
const cachedResult = await CacheServer.get(cacheKey, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user