This repository has been archived by the owner on Aug 27, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Download.js Fix * Fixes * No longer failed
- Loading branch information
1 parent
ccc4db0
commit 14f882f
Showing
10 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
module.exports = (client, msg, cmd, selective = false) => new Promise((resolve, reject) => { | ||
const mps = [true]; | ||
let i = 1; | ||
module.exports = (client, msg, cmd) => new Promise((resolve, reject) => { | ||
let usage; | ||
client.commandInhibitors.forEach((mProc, key) => { | ||
if (key === "usage") usage = i; | ||
if (!mProc.conf.spamProtection || !selective) { | ||
mps.push(mProc.run(client, msg, cmd)); | ||
} | ||
i++; | ||
}); | ||
Promise.all(mps) | ||
const priority = client.commandInhibitors.array(); | ||
const sorted = priority.sort((a, b) => a.conf.priority > b.conf.priority); | ||
sorted.forEach((inhib) => { | ||
inhib.run(client, msg, cmd) | ||
.then((value) => { | ||
resolve(value[usage]); | ||
}, (reason) => { | ||
reject(reason); | ||
if (value) usage = value; | ||
}) | ||
.catch((error) => { | ||
reject(error); | ||
}); | ||
}); | ||
resolve(usage); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters