Logger and fastify, settings server

This commit is contained in:
Isaac
2021-02-25 12:34:16 +00:00
parent a0b1853bff
commit 1f2d40234b
5 changed files with 460 additions and 9 deletions

View File

@@ -60,7 +60,7 @@ const config = require('../user/config');
require('./banner')();
const Logger = require('leekslazylogger');
const Logger = require('leekslazylogger-fastify');
const log = new Logger({
name: 'DiscordTickets by eartharoid',
debug: config.debug,
@@ -72,6 +72,10 @@ const log = new Logger({
title: 'info',
prefix: 'commands'
},
http: {
title: 'info',
prefix: 'http'
},
plugins: {
title: 'info',
prefix: 'plugins'
@@ -88,6 +92,7 @@ const I18n = require('@eartharoid/i18n');
const { CommandManager } = require('./modules/commands');
const TicketManager = require('./modules/tickets');
const { PluginManager } = require('./modules/plugins');
const SettingsServer = require('./server');
require('./modules/structures')(); // load extended structures before creating the client
@@ -142,6 +147,9 @@ class Bot extends Client {
this.plugins = new PluginManager(this);
this.plugins.load(); // load plugins
/** SettingsServer internal plugin instance */
this.server = new SettingsServer(this);
this.log.info('Connecting to Discord API...');
this.login();