From 84a290933ff63d3a89509cd7c808718069e32a32 Mon Sep 17 00:00:00 2001 From: GramingFoxTeam Date: Sun, 25 Dec 2022 16:07:13 +0300 Subject: [PATCH] feat: run only one bot when bot name given --- bots/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bots/index.js b/bots/index.js index e861f67..e26770a 100644 --- a/bots/index.js +++ b/bots/index.js @@ -4,8 +4,10 @@ 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(); } \ No newline at end of file