Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

Commit

Permalink
sigh, why isn't this commited?
Browse files Browse the repository at this point in the history
  • Loading branch information
bdistin committed May 27, 2017
1 parent dfb7c19 commit ac551c2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions classes/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const coreProtected = {
finalizers: [],
monitors: [],
providers: [],
extendables: ["get_attachable", "get_conf", "get_embedable", "get_postable", "get_reactable", "get_readable", "get_usableCommands", "hasAtleastPermissionLevel", "send", "sendCode", "sendEmbed", "sendFile", "sendFiles", "sendMessage"],
};

/* eslint-disable no-throw-literal, import/no-dynamic-require, class-methods-use-this */
Expand Down Expand Up @@ -349,8 +350,8 @@ module.exports = class Loader {
const coreFiles = await fs.readdirAsync(`${this.client.coreBaseDir}extendables${sep}`)
.catch(() => { fs.ensureDirAsync(`${this.client.coreBaseDir}extendables${sep}`).catch(err => this.client.emit("error", this.client.funcs.newError(err))); });
if (coreFiles) {
await this.loadFiles(coreFiles.filter(file => file.endsWith(".js"))
// && (coreProtected.extendables.includes(file.split(".")[0]) || !this.client.config.disabled.extendables.includes(file.split(".")[0])))
await this.loadFiles(coreFiles.filter(file => file.endsWith(".js")
&& (coreProtected.extendables.includes(file.split(".")[0]) || !this.client.config.disabled.extendables.includes(file.split(".")[0])))
, this.client.coreBaseDir, this.loadNewExtendable, this.loadExtendables)
.catch((err) => { throw err; });
}
Expand All @@ -366,11 +367,13 @@ module.exports = class Loader {
loadNewExtendable(file, dir) {
const extendable = require(`${dir}extendables${sep}${file}`);
let myExtend;
switch (extendable.conf.type) {
switch (extendable.conf.type.toLowerCase()) {
case "set":
case "setter":
myExtend = { set: extendable.extend };
break;
case "get":
case "getter":
myExtend = { get: extendable.extend };
break;
case "method":
Expand Down

0 comments on commit ac551c2

Please sign in to comment.