简体   繁体   English

如何在Messenger上使用Node.js / Heroku / Wit.ai ChatBot发送推x小时

[英]How to send push x hours later with Node.js / Heroku / Wit.ai ChatBot on Messenger

I'm developing ChatBots on Messenger with Node.js and Heroku + Wit.ai. 我正在使用Node.js和Heroku + Wit.ai在Messenger上开发ChatBots。
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. 我想知道是否可以在上一次互动后XX小时发送推送以及如何执行。

I already have Facebook ID stored in a database. 我已经在数据库中存储了Facebook ID。 I don't know how to automatically contact again the user 1 hour after the last message send to the bot. 我不知道如何在最后一条消息发送到bot后1小时自动与用户再次联系。 If you know how to do that, I will appreciate any help. 如果您知道该怎么做,我们将不胜感激。

Thank You 谢谢

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. 您也可以使用类似heroku的调度程序

What have you tired? 你累什么了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM