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

Commit

Permalink
Indev (#121)
Browse files Browse the repository at this point in the history
* Download.js Fix

* Fixes

* No longer failed
  • Loading branch information
UnseenFaith authored and CyberiumShadow committed Jan 23, 2017
1 parent ccc4db0 commit 14f882f
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- New Initialize Function to alleviate undefined errors

### Changed
- Changed info to no longer mention Evie because she said she was tired of it.. kek
- New runCommandInhibitors should be much faster and prioritizes inhibitors via a prioritiy configuration setting.
- Old Configuration system now points to the new configuration system, to ease the trouble of updating to newer versions of Komada
- Pieces now have specific order they load in. (Functions, Providers, Commands, Inhibitors, Monitors, Events)
- Confs.js uses new configuration system now
Expand Down
3 changes: 1 addition & 2 deletions commands/System/info.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
exports.run = (client, msg) => {
msg.channel.sendMessage(`This bot is built on the Komada framework, a plug-and-play bot builder made by <@139412744439988224> (LuckyEvie#4611 , aka \`root\`).
For more information visit: <https://komada.js.org>`);
msg.channel.sendMessage("This bot is built on the Komada framework, a plug-and-play bot builder made by Dirigeant's team of dedicated developers. For more information visit: <https://komada.js.org>");
};

exports.conf = {
Expand Down
25 changes: 11 additions & 14 deletions functions/runCommandInhibitors.js
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);
});
1 change: 1 addition & 0 deletions inhibitors/disable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
exports.conf = {
enabled: true,
spamProtection: false,
priority: 9,
};

exports.run = (client, msg, cmd) => new Promise((resolve, reject) => {
Expand Down
1 change: 1 addition & 0 deletions inhibitors/guildOnly.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
exports.conf = {
enabled: true,
spamProtection: false,
priority: 8,
};

exports.run = (client, msg, cmd) => new Promise((resolve, reject) => {
Expand Down
1 change: 1 addition & 0 deletions inhibitors/missingBotPermissions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
exports.conf = {
enabled: true,
spamProtection: false,
priority: 7,
};

exports.run = (client, msg, cmd) => new Promise((resolve, reject) => {
Expand Down
1 change: 1 addition & 0 deletions inhibitors/permissions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
exports.conf = {
enabled: true,
spamProtection: false,
priority: 10,
};

exports.run = (client, msg, cmd) => new Promise(async (resolve, reject) => {
Expand Down
1 change: 1 addition & 0 deletions inhibitors/requiredFuncs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
exports.conf = {
enabled: true,
spamProtection: false,
priority: 6,
};

exports.run = (client, msg, cmd) => new Promise((resolve, reject) => {
Expand Down
1 change: 1 addition & 0 deletions inhibitors/usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const url = require("url");
exports.conf = {
enabled: true,
spamProtection: true,
priority: 5,
};

exports.run = (client, msg, cmd, args = undefined) => new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "komada",
"version": "0.14.1",
"version": "0.14.2",
"author": "Evelyne Lachance",
"description": "Komada: Croatian for 'pieces', is a modular bot system including reloading modules and easy to use custom commands.",
"main": "app.js",
Expand Down

0 comments on commit 14f882f

Please sign in to comment.