feat: run bots in one process

This commit is contained in:
GramingFoxTeam
2022-12-25 15:45:40 +03:00
parent 54ec6232ee
commit d26d533174
5 changed files with 140 additions and 115 deletions

View File

@@ -3,11 +3,11 @@ import { readFileSync, readdirSync } from 'node:fs';
// Fix __dirname not being defined in ES modules. (https://stackoverflow.com/a/64383997)
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
import HelperClient from '../../client/index.js';
export default async () => {
const config = JSON.parse(readFileSync('../config.json', 'utf-8'));
const helper = new HelperClient(config);
@@ -78,3 +78,5 @@ for (const file of helperEventFiles) {
}
client.login(config.discord.token);
}