diff --git a/src/commands/load.ts b/src/commands/load.ts index df8c4ef..2c5b139 100644 --- a/src/commands/load.ts +++ b/src/commands/load.ts @@ -20,13 +20,13 @@ export default class Load extends Command { if (!allowed.includes(type)) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Invalid type to (re)load***`); const corepath = '/var/CloudServices/dist'; - if (type === 'config') this.client.config = require(`${corepath}/config.json`).default; + if (type === 'config') this.client.config = require(`${corepath}/config.json`); else if (type === 'util') { - const Util = require(`${corepath}/class/Util`); + const Util = require(`${corepath}/class/Util`).default; this.client.util = new Util(this.client); } else { try { - const cmdIndex = require(`${corepath}/commands`); + const cmdIndex = require('../commands'); let Cmd = cmdIndex[args[1]]; if (!Cmd) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Could not find file***`); Cmd = require(`${corepath}/commands/${args[1]}`).default; diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index 4f0f605..b9048cb 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -15,7 +15,7 @@ export default class { if (message.content.indexOf(this.client.config.prefix) !== 0) return; const noPrefix: string[] = message.content.slice(this.client.config.prefix.length).trim().split(/ +/g); const resolved = await this.client.util.resolveCommand(noPrefix, message); - if (!resolved.cmd) return; + if (!resolved) return; if (resolved.cmd.guildOnly && !(message.channel instanceof TextChannel)) return; let hasUserPerms: boolean; if (resolved.cmd.permissions.users) {