From 2fed78ec0431ea9999bd5f23347b189c3cc9e094 Mon Sep 17 00:00:00 2001 From: Emily J Date: Sun, 18 Oct 2020 18:28:51 +1100 Subject: [PATCH] add category array as global --- bot/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/index.js b/bot/index.js index 6d6e261..0c8ce02 100644 --- a/bot/index.js +++ b/bot/index.js @@ -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();