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

10
bots/index.js Normal file
View File

@@ -0,0 +1,10 @@
import { readdirSync } from 'node:fs';
const botFolders = readdirSync('./', { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => dirent.name);
for (const botFolder of botFolders) {
const botIndex = await import(`./${botFolder}/index.js`);
botIndex.default();
}