new config options
parent
c126fc99d1
commit
826f28556e
|
@ -2,10 +2,10 @@ import eris from 'eris';
|
|||
import mongoose from 'mongoose';
|
||||
import { promises as fs } from 'fs';
|
||||
import { Collection, Command, Util, ServerManagement, Event } from '.';
|
||||
import { Member, MemberInterface, Moderation, ModerationInterface, Redirect, RedirectInterface } from '../models';
|
||||
import { Member, MemberInterface, Moderation, ModerationInterface, PagerNumber, PagerNumberInterface, Redirect, RedirectInterface } from '../models';
|
||||
|
||||
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, emailPass: string, };
|
||||
|
||||
public commands: Collection<Command>;
|
||||
|
||||
|
@ -17,14 +17,14 @@ export default class Client extends eris.Client {
|
|||
|
||||
public serverManagement: ServerManagement;
|
||||
|
||||
public db: { Member: mongoose.Model<MemberInterface>, Moderation: mongoose.Model<ModerationInterface>, Redirect: mongoose.Model<RedirectInterface> };
|
||||
public db: { Member: mongoose.Model<MemberInterface>, Moderation: mongoose.Model<ModerationInterface>, PagerNumber: mongoose.Model<PagerNumberInterface>, Redirect: mongoose.Model<RedirectInterface> };
|
||||
|
||||
constructor(token: string, options?: eris.ClientOptions) {
|
||||
super(token, options);
|
||||
this.commands = new Collection<Command>();
|
||||
this.events = new Collection<Event>();
|
||||
this.intervals = new Collection<NodeJS.Timeout>();
|
||||
this.db = { Member, Moderation, Redirect };
|
||||
this.db = { Member, Moderation, PagerNumber, Redirect };
|
||||
}
|
||||
|
||||
public async loadDatabase() {
|
||||
|
|
|
@ -9,7 +9,7 @@ import * as commandFiles from './commands';
|
|||
|
||||
async function main(): Promise<void> {
|
||||
const read = await fs.readFile('../config.yaml', 'utf8');
|
||||
const config: { token: string, prefix: string, guildID: string, mongoDB: string } = parse(read);
|
||||
const config: { token: string, prefix: string, guildID: string, mongoDB: string, emailPass: string } = parse(read);
|
||||
const client = new Client(config.token, { defaultImageFormat: 'png', restMode: true });
|
||||
client.config = config;
|
||||
await client.loadDatabase();
|
||||
|
|
Loading…
Reference in New Issue