LoginSignup
30
30

More than 5 years have passed since last update.

1日1回ゆどうふに HipChat でブログを書けと言うための hubot script

Last updated at Posted at 2014-06-25
// Description:
//   Yudoufu blog notifier


module.exports = function (robot) {
  var msgs = [
    'ブログ書いた?',
    'ブログ...書いてょ(ヽ´ω`)',
    'ブログは?(*´ω`*)',
    '元気?',
    'ブログ更新したかな〜',
    'いつになったら...ブログ書いてくれるの?',
    '更新は今日かな? 明日かな? ((o(´∀`)o)) ',
  ];
  var room = "xxxxyour-room-idxxxx@conf.hipchat.com"

  var sendMsg = function () {
    var currentMessage = "@yudoufu " + msgs[Math.floor(Math.random() * msgs.length)];
    robot.messageRoom(room, currentMessage);
  };

  setTimeout(sendMsg, 1000*10);
  setInterval(sendMsg, 1000*86400);
}

こんなかんじになります:

スクリーンショット

たまに、気遣ってくれたりしてウケます:

気遣い

cron.js とか使うと、何かしらの notification にも使えるので、定例業務がある場合 (日報とか、週報とか?) にも応用効くし、なにげに便利。
あと messageRoom() メソッドの情報があまり転がってないので(ソース嫁ばわかるのだけど) ご参考にどうぞ。

30
30
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
30
30