1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-09-29 08:20:59 -04:00

Fix case evasion check for expired value

This commit is contained in:
toast-ts 2023-12-26 22:41:39 +11:00
parent 8d03360899
commit 2e664c0e6a

View File

@ -114,7 +114,7 @@ export class PunishmentsSvc {
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) { async caseEvasionCheck(member:Discord.GuildMember) {
if (await this.model.findOne({where: {member: member.id, type: 'mute', expired: undefined}})) { 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( (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.`, `**${member.user.username}** (\`${member.user.id}\`) has been detected for case evasion.`,
'Timeout has been automatically added. (25 days)' 'Timeout has been automatically added. (25 days)'