https://discord.gg/botpress logo
Hello Guys
# 🌎general
p
Hello Guys Is this how botpress developed/works, in code template i'm using a timeout function for 5 sec, but botpress is jumping to next card , i want to wait for the execution to complete (till the timer got finished) and move to next card, how to do this?
a
Hi, you can use the following code snippet. Beware there is a 60 seconds limit. So if you need a longer delay, you would need to stack several execute code cards
Copy code
await new Promise((resolve) => {
        setTimeout(() => {
            resolve('waiting 5 seconds');
        }, 5000);
    })
p
Thanks It worked.
5 Views