eslint fix and tableRam

This commit is contained in:
jacoobes
2022-02-13 13:34:34 -06:00
parent ad86658e11
commit 47ea143581
3 changed files with 8 additions and 8 deletions

View File

@@ -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 }]
}
}

View File

@@ -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)), {})
)
}

View File

@@ -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