12
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

HubotでCronがSlackに流れなくてハマった

12
Last updated at Posted at 2014-12-29

各所のサンプルを見ながらやってみてローカル上では上手く動いているのに、Slack上にメッセージが流れなくてハマった。
最近のバージョンでroom名の'#'は不要になったっぽい。

cron-test.coffee
CronJob = require('cron').CronJob

module.exports = (robot) ->
  new CronJob '0 * * * * *', () =>
    # これだとSlack#generalにメッセージが流れない
    # robot.messageRoom "#general", "テスト"

    # これならおっけー
    robot.messageRoom "general", "テスト"
  , null, true, "Asia/Tokyo"

参考

hubot-slack アダプタ v2 から v3 へ | 半月記

12
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?