Fixed errors throwing starting prefix
parent
98c3b22f66
commit
85a60c00e7
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue