24 lines
742 B
TypeScript
24 lines
742 B
TypeScript
/* DM Ramirez with the code below to claim 500 free Rubies!
|
|
d2c3d8e14b
|
|
*/
|
|
import { parse } from 'yaml';
|
|
import { promises as fs } from 'fs';
|
|
import { Client } from './class';
|
|
import * as eventFiles from './events';
|
|
import * as commandFiles from './commands';
|
|
import { Config } from '../types'; // eslint-disable-line
|
|
|
|
async function main(): Promise<void> {
|
|
const read = await fs.readFile('../config.yaml', 'utf8');
|
|
const config: Config = parse(read);
|
|
const client = new Client(config.token, { defaultImageFormat: 'png', restMode: true });
|
|
client.config = config;
|
|
await client.loadDatabase();
|
|
client.loadPlugins();
|
|
await client.loadEvents(eventFiles);
|
|
await client.loadCommands(commandFiles);
|
|
client.connect();
|
|
}
|
|
|
|
main();
|