17 lines
450 B
TypeScript
17 lines
450 B
TypeScript
|
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');
|
||
|
const config: { token: string, prefix: string } = parse(read);
|
||
|
const client = new Client(config.token);
|
||
|
client.config = config;
|
||
|
client.loadPlugins();
|
||
|
await client.loadEvents();
|
||
|
await client.loadCommands();
|
||
|
client.connect();
|
||
|
}
|
||
|
|
||
|
main();
|