From 152b78b2eaad424a80f2ff6a413564bf9fa4e460 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Sun, 8 Nov 2020 00:59:56 -0500 Subject: [PATCH] fixes --- src/commands/score_hist.ts | 2 +- src/commands/score_notify.ts | 2 -- src/commands/score_pref.ts | 13 ++----------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/commands/score_hist.ts b/src/commands/score_hist.ts index 96fe945..8184d5e 100644 --- a/src/commands/score_hist.ts +++ b/src/commands/score_hist.ts @@ -25,7 +25,7 @@ export default class Score_Hist extends Command { user = message.author; if (!user) return this.error(message.channel, 'Member not found.'); const hists = await this.client.db.ScoreHistorical.find({ userID: user.id }).lean().exec(); - if (!hists) return this.error(message.channel, 'No history found.'); + if (!hists || hists?.length <= 0) return this.error(message.channel, 'No history found.'); const histArray: [{ name: string, value: string }?] = []; const totalArray: number[] = []; const activityArray: number[] = []; diff --git a/src/commands/score_notify.ts b/src/commands/score_notify.ts index d6dfc08..2a9b98b 100644 --- a/src/commands/score_notify.ts +++ b/src/commands/score_notify.ts @@ -1,6 +1,5 @@ import { Message } from 'eris'; import { Client, Command } from '../class'; -import Score_Hist from './score_hist'; export default class Score_Notify extends Command { constructor(client: Client) { @@ -8,7 +7,6 @@ export default class Score_Notify extends Command { this.name = 'notify'; this.description = 'Edits your notification preferences for Hard Inquiries.'; this.usage = `${this.client.config.prefix}score notify `; - this.subcmds = [Score_Hist]; this.permissions = 0; this.guildOnly = false; this.enabled = true; diff --git a/src/commands/score_pref.ts b/src/commands/score_pref.ts index fa6c257..a0c2e3d 100644 --- a/src/commands/score_pref.ts +++ b/src/commands/score_pref.ts @@ -1,13 +1,5 @@ -/* eslint-disable no-continue */ -/* eslint-disable default-case */ -import moment from 'moment'; -import { median, mode, mean } from 'mathjs'; -import { v4 as uuid } from 'uuid'; -import { createPaginationEmbed } from 'eris-pagination'; -import { Message, User, TextChannel } from 'eris'; -import { Client, Command, RichEmbed } from '../class'; -import Score_Hist from './score_hist'; -import Score_Notify from './score_notify'; +import { Message } from 'eris'; +import { Client, Command } from '../class'; export default class Score_Pref extends Command { constructor(client: Client) { @@ -15,7 +7,6 @@ export default class Score_Pref extends Command { this.name = 'pref'; this.description = 'Locks or unlocks your Community Report.'; this.usage = `${this.client.config.prefix}score pref `; - this.subcmds = [Score_Hist, Score_Notify]; this.permissions = 0; this.guildOnly = false; this.enabled = true;