Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
Fixed registerCommandsIn logic (was filtering out normal groups when …
Browse files Browse the repository at this point in the history
…finding parent groups) | Increment version
  • Loading branch information
harrisonhoward committed Oct 25, 2020
1 parent c3dda3e commit 70b14aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eris.js-commando",
"version": "1.1.4",
"version": "1.1.5",
"description": "Command Handler built for Eris (not a replica of discord.js-commando)",
"main": "src/index.js",
"typings": "./index.d.ts",
Expand Down
8 changes: 6 additions & 2 deletions src/CommandClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,14 @@ module.exports = class CommandClient extends Eris.Client {
let groups = fs.readdirSync(dir)
.filter(group => fs.lstatSync(`${dir}/${group}`).isDirectory());
groups.forEach(parent => {
const parentsUsed = [];
const array = fs.readdirSync(`${dir}/${parent}`)
.filter(group => fs.lstatSync(`${dir}/${parent}/${group}`).isDirectory())
.map(group => `${parent}/${group}`);
groups = groups.filter(group => group !== parent).concat(array);
.map(group => {
parentsUsed.push(parent);
return `${parent}/${group}`;
});
groups = groups.filter(group => !parentsUsed.includes(group)).concat(array);
});

let commandsInGroups = [];
Expand Down

0 comments on commit 70b14aa

Please sign in to comment.