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

Commit

Permalink
Komada 0.19.2 Master Patch (#219)
Browse files Browse the repository at this point in the history
* Try to fix invite in a non-breaking way since d.js constants changed

* Fix lint?

* Update package.json
  • Loading branch information
bdistin authored and CyberiumShadow committed May 9, 2017
1 parent 6c6cda0 commit b04228e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
29 changes: 2 additions & 27 deletions functions/botPermissions.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,3 @@
const permFlags = require("discord.js/src/util/Constants.js").PermissionFlags;
const { Permissions } = require("discord.js");

module.exports = (client) => {
const genObject = {};

for (const key in permFlags) {
genObject[key] = false;
}

genObject.READ_MESSAGES = true;
genObject.SEND_MESSAGES = true;

client.commands.forEach((command) => {
if (command.conf.botPerms.length > 0) {
command.conf.botPerms.forEach((val) => {
if (genObject.hasOwnProperty(val)) genObject[val] = true;
});
}
});

let permNumber = 0;
for (const key in genObject) {
if (genObject[key] === true) {
permNumber += permFlags[key];
}
}
return permNumber;
};
module.exports = client => Permissions.resolve([...new Set(client.commands.reduce((a, b) => a.concat(b.conf.botPerms), ["READ_MESSAGES", "SEND_MESSAGES"]))]);
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.19.1",
"version": "0.19.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 b04228e

Please sign in to comment.