add category array as global

This commit is contained in:
Emily 2020-10-18 18:28:51 +11:00
parent 3097e363d1
commit 2fed78ec04

View file

@ -5,7 +5,8 @@ const { CommandHandler, EventHandler } = require('./util/handlers');
const Functions = require('./util/functions');
const Database = require('./util/database');
const logger = require('./util/logger');
const sentry = require('@sentry/node'); // eslint-disable-line no-unused-vars
const sentry = require('@sentry/node'); // eslint-disable-line no-unused-vars
const { readdirSync } = require('fs');
const config = require('../config.json');
const pkg = require('../package.json');
@ -17,6 +18,7 @@ class WoomyClient extends Client {
this.config = config;
this.path = __dirname;
this.version = pkg.version;
this.categories = readdirSync('./commands/');
// dev mode, disables some features if enabled
this.dev = false;
@ -46,6 +48,8 @@ async function init () {
client.logger.info(`Initializing Woomy v${client.version}`);
require('./util/prototypes');
await client.commandHandler.loadAll();
await client.eventHandler.loadAll();