From 47ea1435812b59b45de48b549ec1501c33967c04 Mon Sep 17 00:00:00 2001 From: jacoobes Date: Sun, 13 Feb 2022 13:34:34 -0600 Subject: [PATCH] eslint fix and tableRam --- .eslintrc | 3 ++- src/handler/logger.ts | 11 +++++------ src/handler/sern.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.eslintrc b/.eslintrc index f3560a0..6598da8 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,6 +3,7 @@ "extends": ["plugin:@typescript-eslint/recommended"], "parserOptions": { "ecmaVersion": "esnext", "sourceType": "" }, "rules": { - "@typescript-eslint/no-non-null-assertion": "off" + "@typescript-eslint/no-non-null-assertion": "off", + "quotes": [2, "single", { "avoidEscape": true, "allowTemplateLiterals" : true }] } } \ No newline at end of file diff --git a/src/handler/logger.ts b/src/handler/logger.ts index ef6a6b8..5a89820 100644 --- a/src/handler/logger.ts +++ b/src/handler/logger.ts @@ -1,6 +1,6 @@ -import dayjs from "dayjs"; -import timezone from "dayjs/plugin/timezone"; -import utc from "dayjs/plugin/timezone"; +import dayjs from 'dayjs'; +import timezone from 'dayjs/plugin/timezone'; +import utc from 'dayjs/plugin/timezone'; enum sEvent { GLOBAL_SLASH, @@ -22,10 +22,9 @@ export default class Logger { } public tableRam() { - throw Error("unimpl") console.table( - Object.values(process.memoryUsage()) - .map(([k,v]) => { return {[k] : `${(Math.round(v) / 1024 / 1024 * 100) / 100}`} }) + Object.entries(process.memoryUsage()) + .map(([k, v] : [string, number]) => { return {[k] : ((Math.round(v) / 1024 / 1024 * 100) / 100).toFixed(2) }}) .reduce(((r, c) => Object.assign(r, c)), {}) ) } diff --git a/src/handler/sern.ts b/src/handler/sern.ts index 1100886..dbfd5f4 100644 --- a/src/handler/sern.ts +++ b/src/handler/sern.ts @@ -51,7 +51,7 @@ export class Handler { new Logger().tableRam(); }) - .on('messageCreate', async (message: any) => { + .on('messageCreate', async (message: Message) => { if (isBot(message) || !hasPrefix(message, this.prefix)) return; if (message.channel.type === 'DM') return; // TODO: Handle dms