Files
revanced-bots/bots/index.js
2023-03-20 21:28:52 +03:00

14 lines
459 B
JavaScript

import { readdirSync } from 'node:fs';
const botFolders = readdirSync('./', { withFileTypes: true })
.filter((dirent) => dirent.isDirectory())
.map((dirent) => dirent.name);
const runBotOnly = process.argv[2] ? process.argv[2] : null;
for (const botFolder of botFolders) {
if (botFolder === 'node_modules') continue;
if (runBotOnly && runBotOnly !== botFolder) continue;
const botIndex = await import(`./${botFolder}/index.js`);
botIndex.default();
}