feat: Added figlet error logging
This commit is contained in:
parent
d1cf8a73dd
commit
20e732a268
2 changed files with 6 additions and 4 deletions
|
@ -22,10 +22,12 @@ import figlet from 'figlet';
|
|||
import gradient from 'gradient-string';
|
||||
|
||||
import { token } from '../config.json';
|
||||
import { info } from './utils/logger';
|
||||
import { debug, error, info } from './utils/logger';
|
||||
|
||||
debug('Starting bot... Please wait');
|
||||
|
||||
figlet('Argon Bot', (err, data) => {
|
||||
if (err) return;
|
||||
if (err) error(`Figlet encountered an error!\n${err.message}`);
|
||||
|
||||
info(gradient.rainbow.multiline(`\n${data}`));
|
||||
});
|
||||
|
@ -35,7 +37,7 @@ const client = new Client({
|
|||
});
|
||||
|
||||
client.on('ready', () => {
|
||||
info('Startup!');
|
||||
info('bot is ready!');
|
||||
});
|
||||
|
||||
client.login(token);
|
||||
|
|
|
@ -68,7 +68,7 @@ export function info(message: string): void {
|
|||
|
||||
export function warn(message: string): void {
|
||||
if(warnLevel)
|
||||
console.log(logger`{grey (${date})} {yellow.bold.underline [WARN]}: ${message}`);
|
||||
console.log(logger`{grey (${date})} {yellow.bold [WARN]}: ${message}`);
|
||||
}
|
||||
|
||||
export function error(message: string): void {
|
||||
|
|
Reference in a new issue