I'm developing ChatBots on Messenger with Node.js and Heroku + Wit.ai.
My problem :
I would like to know if it's possible to send a push XX hours after the last interaction and how to do it.
I already have Facebook ID stored in a database. I don't know how to automatically contact again the user 1 hour after the last message send to the bot. If you know how to do that, I will appreciate any help.
Thank You
Asked
Active
Viewed 55 times
0

Pablo DelaNoche
- 677
- 1
- 9
- 28
-
The question is a bit broad. But have you thought of wrapping the respond method via setTimeout(function(){ respond_to_user() }, 3000); – Aug 03 '17 at 19:15
-
I'll just tack on that there's [an npm package](https://www.npmjs.com/package/cron) for time-based tasks like this. – Reticulated Spline Aug 03 '17 at 20:17
1 Answers
1
Since you're already hosting this, your best bet is to have a background task that checks some kind of queue constantly, and fires off any events in that queue that are an hour old. You could use something like heroku scheduler as well.
What have you tired?

TheCog19
- 1,129
- 12
- 26
-
Thank you for this ! I didn't know Heroku's Scheduler ! It's seems to be great and exactly what I was looking for. Thanks again – Pablo DelaNoche Aug 03 '17 at 19:27