1
0
Fork 0

fixes for command resolve

refactor/models
Matthew 2020-06-29 17:26:39 -04:00
parent 1af0f58b23
commit 47444a26ed
No known key found for this signature in database
GPG Key ID: 210AF32ADE3B5C4B
1 changed files with 7 additions and 0 deletions

View File

@ -110,6 +110,13 @@ export default class Client extends Eris.Client {
const cmdFiles = Object.values<typeof Command>(commandFiles); const cmdFiles = Object.values<typeof Command>(commandFiles);
for (const Cmd of cmdFiles) { for (const Cmd of cmdFiles) {
const command = new Cmd(this); const command = new Cmd(this);
if (command.subcmds.length) {
command.subcmds.forEach((C) => {
const cmd: Command = new C(this);
command.subcommands.add(cmd.name, cmd);
});
}
delete command.subcmds;
this.commands.add(command.name, command); this.commands.add(command.name, command);
this.signale.success(`Successfully loaded command: ${command.name}`); this.signale.success(`Successfully loaded command: ${command.name}`);
} }