Hey i want to my bot send a message when the foreach is finished with the duration
code:
let beforecheck = new Date();
bot.guilds.forEach(guild => {
//my foreach code
}).then(() => {
let aftercheck = new Date();
var finished = new Discord.RichEmbed()
.setDescription("✔ Finished ✔")
.addField(" Bot Latency", bot.ping + " ms")
.addField("expected time", expectedtime + " minute(s)")
.addField("final time", (60000 / (beforecheck - aftercheck)) + " minute(s)")
message.channel.send(finished)
})
thanks for any response