https://discord.gg/botpress logo
#🤝help
Wait time in between messages
# 🤝help
l

loud-gold-18101

07/16/2023, 9:34 PM
Hello just wondering if anyone knows how to add a wait time between the bot sending the premade messages. For example I have a text card that says "I am now gonna ask a few questions". Then I want it to wait 3 seconds and send the first question. If its not available even with custom code, could be a good feature to add.
c

curved-traffic-50479

07/16/2023, 11:21 PM
How do u mean bro ?
d

damp-forest-63651

07/17/2023, 3:20 AM
use settimeout inside custom code, it works. i use it already
l

loud-gold-18101

07/17/2023, 4:00 PM
Whats the code for it?
@damp-forest-63651 So when I have regular text card and it says something there's wait time before it sends the next message.
d

damp-forest-63651

07/17/2023, 7:34 PM
it is in the execute code card: with a code like this one: console.log('**********LE DELAI*************') const timeout = luxon.Duration.fromObject({ seconds: 20 }) await new Promise(resolve => setTimeout(resolve, timeout.as("milliseconds")))
l

loud-gold-18101

07/17/2023, 7:35 PM
ok thanks
d

damp-forest-63651

07/17/2023, 7:37 PM
you're welcome.
4 Views