2020-04-14 13:15:33 -04:00
|
|
|
import { parse } from 'yaml';
|
|
|
|
import { promises as fs } from 'fs';
|
|
|
|
import { Client } from './class';
|
|
|
|
|
|
|
|
async function main(): Promise<void> {
|
|
|
|
const read = await fs.readFile('../config.yaml', 'utf8');
|
2020-04-15 15:12:17 -04:00
|
|
|
const config: { token: string, prefix: string, guildID: string, mongoDB: string } = parse(read);
|
2020-04-16 10:11:54 -04:00
|
|
|
const client = new Client(config.token, { defaultImageFormat: 'png', restMode: true });
|
2020-04-14 13:15:33 -04:00
|
|
|
client.config = config;
|
2020-04-15 15:12:17 -04:00
|
|
|
await client.loadDatabase();
|
2020-04-14 13:15:33 -04:00
|
|
|
client.loadPlugins();
|
2020-04-15 15:12:17 -04:00
|
|
|
await client.loadIntervals();
|
2020-04-14 13:15:33 -04:00
|
|
|
await client.loadEvents();
|
|
|
|
await client.loadCommands();
|
|
|
|
client.connect();
|
|
|
|
}
|
|
|
|
|
|
|
|
main();
|