Bot response time?
# 🤝help
c
I have lots of text fields, so i dont want user to get overwhelmed, so how i can make the bot respond slowly taking time after each text is sent? giving it a little humanly feeling for taking his time to text.
@witty-football-93730 can u help?
a
Hey Sorrento, pop this in an execute code card wherever you want the bot to wait
Copy code
js
async function waitNSeconds(n) {
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve()
    }, n)
  })
}

// Usage
console.log('Start waiting...')
await waitNSeconds(10000) // 10000 milliseconds = 10 seconds
This will wait 10 seconds. You can change the duration by modifying the last line. 10,000 = 10 seconds; 5,000 = 5 sec, etc
m
their appears to be an error on resolve()
nevermind, all works