From 2fde5d0fcdf6213fd71dca4e43c2ab056fdebb0d Mon Sep 17 00:00:00 2001 From: Matthew R Date: Wed, 30 Dec 2020 10:06:59 -0500 Subject: [PATCH] rm automod.ts & report.ts --- src/class/AutoMod.ts | 35 -------------------- src/class/Report.ts | 77 -------------------------------------------- 2 files changed, 112 deletions(-) delete mode 100644 src/class/AutoMod.ts delete mode 100644 src/class/Report.ts diff --git a/src/class/AutoMod.ts b/src/class/AutoMod.ts deleted file mode 100644 index da42242..0000000 --- a/src/class/AutoMod.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable no-bitwise */ -import { Member, Message, User } from 'eris'; -import { randomBytes } from 'crypto'; -import moment, { unitOfTime } from 'moment'; -import { Client, Moderation, RichEmbed } from '.'; -import { Moderation as ModerationModel, ModerationInterface } from '../models'; -import { moderation as channels } from '../configs/channels.json'; - -export default class AutoMod extends Moderation { - public client: Client; - - public list: Set - - // eslint-disable-next-line @typescript-eslint/no-useless-constructor - constructor(client: Client) { - super(client); - this.list = new Set(); - } - - public run(message: Message, member: Member) { - /* - try { - if (member) - } - */ - } - - public warn(message: Message, member: Member) { - /* - try { - await message.channel.createMessage(`__**`) - } - */ - } -} diff --git a/src/class/Report.ts b/src/class/Report.ts deleted file mode 100644 index e14a7b7..0000000 --- a/src/class/Report.ts +++ /dev/null @@ -1,77 +0,0 @@ -import { EventEmitter } from 'events'; -import { Client, RichEmbed } from '.'; -import { ScoreHistoricalRaw } from '../models/ScoreHistorical'; - -export default class Report { - public client: Client; - - constructor(client: Client) { - this.client = client; - } - - public async soft(userID: string) { - const report = await this.client.db.Score.findOne({ userID }); - if (!report) return null; - let totalScore: number; - let activityScore: number; - const moderationScore = Math.round(report.moderation); - let roleScore: number; - let cloudServicesScore: number; - const otherScore = Math.round(report.other); - let miscScore: number; - - if (report.total < 200) totalScore = 0; - else if (report.total > 800) totalScore = 800; - else totalScore = Math.round(report.total); - - if (report.activity < 10) activityScore = 0; - else if (report.activity > Math.floor((Math.log1p(3000 + 300 + 200 + 100) * 12))) activityScore = Math.floor((Math.log1p(3000 + 300 + 200 + 100) * 12)); - else activityScore = Math.round(report.activity); - - if (report.roles <= 0) roleScore = 0; - else if (report.roles > 54) roleScore = 54; - else roleScore = Math.round(report.roles); - - if (report.staff <= 0) miscScore = 0; - else miscScore = Math.round(report.staff); - - if (report.cloudServices === 0) cloudServicesScore = 0; - else if (report.cloudServices > 10) cloudServicesScore = 10; - else cloudServicesScore = Math.round(report.cloudServices); - - const historicalData = await this.client.db.ScoreHistorical.find({ userID: member.userID }).lean().exec(); - const array: ScoreHistoricalRaw[] = []; - for (const data of historicalData) { - let total: number; - let activity: number; - const moderation = Math.round(data.report.moderation); - let role: number; - let cloud: number; - const other = Math.round(data.report.other); - let misc: number; - - if (data.report.total < 200) total = 0; - else if (data.report.total > 800) total = 800; - else total = Math.round(data.report.total); - - if (data.report.activity < 10) activity = 0; - else if (data.report.activity > Math.floor((Math.log1p(3000 + 300 + 200 + 100) * 12))) activity = Math.floor((Math.log1p(3000 + 300 + 200 + 100) * 12)); - else activity = Math.round(data.report.activity); - - if (data.report.roles <= 0) role = 0; - else if (data.report.roles > 54) role = 54; - else role = Math.round(data.report.roles); - - if (data.report.staff <= 0) role = 0; - else misc = Math.round(data.report.staff); - - if (data.report.cloudServices === 0) cloud = 0; - else if (data.report.cloudServices > 10) cloud = 10; - else cloud = Math.round(data.report.cloudServices); - - data.report.total = total; data.report.activity = activity; data.report.moderation = moderation; data.report.roles = role; data.report.cloudServices = cloud; data.report.other = other; data.report.staff = misc; - - array.push(data); - } - } -}