1
0
Fork 0

More edits

refactor/models
Bsian 2019-10-31 20:26:01 +00:00
parent e8441563f3
commit d01624fc11
No known key found for this signature in database
GPG Key ID: 097FB9A291026091
3 changed files with 3 additions and 7 deletions

View File

@ -16,8 +16,6 @@ export default class Client extends Eris.Client {
public commands: Collection<Command>;
public aliases: Map<string, string>;
public db: { Account: mongoose.Model<AccountInterface>; Domain: mongoose.Model<DomainInterface>; Moderation: mongoose.Model<ModerationInterface>; };
public stores: { emojis: { success: string, loading: string, error: string }; };
@ -73,8 +71,8 @@ export default class Client extends Eris.Client {
const cmd: Command = new C(this);
command.subcommands.add(cmd.name, cmd);
});
delete command.subcmds;
}
delete command.subcmds;
this.commands.add(command.name, command);
this.signale.complete(`Loaded command ${command.name}`);
} catch (err) { throw err; }

View File

@ -4,12 +4,10 @@
export default class Collection<V> extends Map<string, V> {
baseObject: any
iterable: any[]|object
/**
* Creates an instance of Collection
*/
constructor({ base: baseObject = null, iterable = null }) {
constructor(iterable: any[]|object = null) {
if (iterable && iterable instanceof Array) {
// @ts-ignore
super(iterable);
@ -19,7 +17,6 @@ export default class Collection<V> extends Map<string, V> {
} else {
super();
}
this.baseObject = baseObject;
}
/**

View File

@ -34,6 +34,7 @@ export default class Command {
this.guildOnly = true;
this.client = client;
this.subcmds = [];
this.subcommands = new Collection<Command>();
this.permissions = {};
}
}