bind server management to Client
parent
5dd86e1fed
commit
ea3806fcc3
|
@ -1,8 +1,8 @@
|
||||||
import eris from 'eris';
|
import eris from 'eris';
|
||||||
import mongoose from 'mongoose';
|
import mongoose from 'mongoose';
|
||||||
import { promises as fs } from 'fs';
|
import { promises as fs } from 'fs';
|
||||||
import { Collection, Command, Util } from '.';
|
import { Collection, Command, Util, ServerManagement } from '.';
|
||||||
import { Member, MemberInterface, Moderation, ModerationInterface } from '../models';
|
import { Member, MemberInterface, Moderation, ModerationInterface, Redirect, RedirectInterface } from '../models';
|
||||||
|
|
||||||
export default class Client extends eris.Client {
|
export default class Client extends eris.Client {
|
||||||
public config: { token: string, prefix: string, guildID: string, mongoDB: string };
|
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 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
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
||||||
constructor(token: string, options?: eris.ClientOptions) {
|
constructor(token: string, options?: eris.ClientOptions) {
|
||||||
super(token, options);
|
super(token, options);
|
||||||
this.commands = new Collection<Command>();
|
this.commands = new Collection<Command>();
|
||||||
this.intervals = new Collection<NodeJS.Timeout>();
|
this.intervals = new Collection<NodeJS.Timeout>();
|
||||||
this.db = { member: Member, moderation: Moderation };
|
this.db = { member: Member, moderation: Moderation, redirect: Redirect };
|
||||||
}
|
}
|
||||||
|
|
||||||
public async loadDatabase() {
|
public async loadDatabase() {
|
||||||
|
@ -29,6 +31,7 @@ export default class Client extends eris.Client {
|
||||||
|
|
||||||
public loadPlugins() {
|
public loadPlugins() {
|
||||||
this.util = new Util(this);
|
this.util = new Util(this);
|
||||||
|
this.serverManagement = new ServerManagement(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public async loadIntervals() {
|
public async loadIntervals() {
|
||||||
|
|
Loading…
Reference in New Issue