bots.forEach instead of a for loop

This commit is contained in:
2022-03-04 23:36:37 +01:00
parent c9d8d30128
commit 96821cfef6
+3 -5
View File
@@ -1,10 +1,8 @@
const bots = require("./config/robots.json").bots;
const GenericBot = require("./bot/genericBot")
for (let i = 0; i < bots.length; i++) {
startBot(bots[i]);
}
const bots = require("./config/robots.json").bots;
bots.forEach(startBot);
async function startBot(botConfig) {
let bot = new GenericBot(botConfig);