Answer the question
In order to leave comments, you need to log in
How to loop a node js function?
The function does not work for me.
What could be the problem?
const biz = require('../biz.json')
const coin = require('../coin.json')
module.exports = async function(bots,user,message,member) {
if(biz[member.id].biz1 == 1)
{
coin[member.id].coin += 100
}
if(biz[member.id].biz2 == 1)
{
coin[member.id].coin += 300
}
if(biz[member.id].biz3 == 1)
{
coin[member.id].coin += 800
}
await setInterval(intervalFunc, 5000);
}
Answer the question
In order to leave comments, you need to log in
setInterval does not return a promise, so it cannot be used with await
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question