LoginSignup
11
12

More than 5 years have passed since last update.

hubotから@channelでメッセージを送る

Last updated at Posted at 2015-05-29

hubotからSlackに、全員に向けて通知を送りたいときがあると思います。
cronを使って定時になったよとか。

その場合 msg.sendrobot.send を使うと思うんですが、下記のコードだと@channelがうまくメンションになってくれません。

robot.send {room: "general"}, "@channel: 終業時間デス"

こう書くとちゃんと飛びます。

robot.send {room: "general"}, "<!channel> 終業時間デス"

@everyone@groupも同じ書き方でいけます。
ちなみに、2015/5/29時点では動きますが、将来変わるかもしれませんのでご注意を。

How do you 'mention' users in this hubot cron script for Slack, so they can see it as notification if their notification settings are on? - Stack Overflow

11
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
11
12