mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
BetterCode
This commit is contained in:
@@ -1,17 +1,31 @@
|
||||
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 {
|
||||
TEXT_CMD,
|
||||
GLOBAL_SLASH,
|
||||
LOCAL_SLASH,
|
||||
DM,
|
||||
DM,
|
||||
CRASH,
|
||||
TEXT_CMD,
|
||||
}
|
||||
|
||||
class Logger {
|
||||
export default class Logger {
|
||||
public log<T extends sEvent>(e : T, message: string) {
|
||||
console.log(`[${'ISOSTRING (todo) '}][${sEvent[e]}] :: ${message}`);
|
||||
dayJS.extend(UTC);
|
||||
dayJS.extend(Timezone);
|
||||
dayJS.tz.guess();
|
||||
|
||||
const tz = dayJS().format();
|
||||
console.log(`[${`${tz}`}][${sEvent[e]}] :: ${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
public tableRam() {
|
||||
throw Error('unimpl');
|
||||
|
||||
console.table(
|
||||
Object.values(process.memoryUsage())
|
||||
.map(([k,v]) => { return {[k] : `${(Math.round(v) / 1024 / 1024 * 100) / 100}`} })
|
||||
.reduce(((r, c) => Object.assign(r, c)), {}))
|
||||
}
|
||||
}
|
||||
@@ -2,19 +2,11 @@ import * as Files from './utilities/readFile';
|
||||
import type * as Utils from './utilities/preprocessors/args';
|
||||
|
||||
import type {
|
||||
<<<<<<< HEAD
|
||||
Arg,
|
||||
Context,
|
||||
Visibility,
|
||||
possibleOutput
|
||||
} from '../Types/Handler';
|
||||
=======
|
||||
Arg,
|
||||
Context,
|
||||
Visibility,
|
||||
possibleOutput
|
||||
} from '../types/handler';
|
||||
>>>>>>> ad86658e11a26d01e86d1a83e0bbcecef57d3001
|
||||
|
||||
import type {
|
||||
ApplicationCommandOptionData,
|
||||
@@ -28,7 +20,6 @@ import { Ok, Result, None, Some } from 'ts-results';
|
||||
import { isBot, hasPrefix, fmt } from './utilities/messageHelpers';
|
||||
import Logger from './logger';
|
||||
|
||||
|
||||
/**
|
||||
* @class
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user