From ea3806fcc3545159fe7fbd07ca8360737327e226 Mon Sep 17 00:00:00 2001 From: Matthew R Date: Tue, 5 May 2020 19:13:18 -0400 Subject: [PATCH] bind server management to Client --- src/class/Client.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/class/Client.ts b/src/class/Client.ts index 29212bb..51e5c0b 100644 --- a/src/class/Client.ts +++ b/src/class/Client.ts @@ -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, moderation: mongoose.Model }; + public serverManagement: ServerManagement; + + public db: { member: mongoose.Model, moderation: mongoose.Model, redirect: mongoose.Model }; // eslint-disable-next-line @typescript-eslint/no-useless-constructor constructor(token: string, options?: eris.ClientOptions) { super(token, options); this.commands = new Collection(); this.intervals = new Collection(); - 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() {