lets say i have this
Bot.on("message", (msg) => { if (msg.body.startsWith("!")) { doSomething(msg); } else { console.log("this is not command"); } });
and let say the doSomething is a promise;
how do i wait for do something to finish then start listening on message again (Bot.on("message") ?
why i want to achive this?
sometime user send command and the same time and Bot proceed the doSomething simultaneusly, i want it to process the first command first then after it finish, process the second command