1

似乎无法弄清楚如何实现这一目标。我试图让 Hubot 在特定的 hipchat 频道中定期调用一个函数。

目前,我可以通过让用户输入聊天“Hubot totalviewers”来做到这一点,hubot 将返回当前观众的数量。关键是让 hubot 自己执行此操作,而无需用户键入命令(每分钟发生一次)。

任何文档、示例或帮助将不胜感激。

4

2 回答 2

1

您可以为此使用node-cron

示例: https ://leanpub.com/automation-and-monitoring-with-hubot/read#leanpub-auto-periodic-task-execution

于 2014-05-21T03:34:03.097 回答
0

你可以使用setInterval吗?这在使用 Hubot 编写脚本时应该是可行的。

就像是...

setInterval ->
    do totalviewers
, 60000 # 1 minute
于 2014-05-20T19:14:37.457 回答