bind server management to Client

merge-requests/11/merge
Matthew 2020-05-05 19:13:18 -04:00
parent 5dd86e1fed
commit ea3806fcc3
No known key found for this signature in database
GPG Key ID: 766BE43AE75F7559
1 changed files with 7 additions and 4 deletions

View File

@ -1,8 +1,8 @@
import eris from 'eris';
import mongoose from 'mongoose';
import { promises as fs } from 'fs';
import { Collection, Command, Util } from '.';
import { Member, MemberInterface, Moderation, ModerationInterface } from '../models';
import { Collection, Command, Util, ServerManagement } from '.';
import { Member, MemberInterface, Moderation, ModerationInterface, Redirect, RedirectInterface } from '../models';
export default class Client extends eris.Client {
public config: { token: string, prefix: string, guildID: string, mongoDB: string };
@ -13,14 +13,16 @@ export default class Client extends eris.Client {
public util: Util;
public db: { member: mongoose.Model<MemberInterface>, moderation: mongoose.Model<ModerationInterface> };
public serverManagement: ServerManagement;
public db: { member: mongoose.Model<MemberInterface>, moderation: mongoose.Model<ModerationInterface>, redirect: mongoose.Model<RedirectInterface> };
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
constructor(token: string, options?: eris.ClientOptions) {
super(token, options);
this.commands = new Collection<Command>();
this.intervals = new Collection<NodeJS.Timeout>();
this.db = { member: Member, moderation: Moderation };
this.db = { member: Member, moderation: Moderation, redirect: Redirect };
}
public async loadDatabase() {
@ -29,6 +31,7 @@ export default class Client extends eris.Client {
public loadPlugins() {
this.util = new Util(this);
this.serverManagement = new ServerManagement(this);
}
public async loadIntervals() {