アクティブでなさそうなSlackチャンネルをArchiveお願いする
May 14, 2017
slack-channel-active-reminder
書いたもの: https://github.com/9renpoto/slack-channel-active-reminder
slack の部屋は便利に増やしていけますが、 同じような部屋が散乱したり、入ってみたものの活動が薄かったり様々あるので 一定時間発言がない部屋に対してメッセージを送りつけるようなものを書いた。
Usage
Cron などと合わせて仕込んで良いタイミングで発言がなさそうなところに対してメッセージを送る。
const CronJob = require('cron').CronJob
const Reminder = require('slack-channel-active-reminder').default
const reminder = new Reminder()
const job = new CronJob({
cronTime: '0 00 18 * * 1-5',
onTick: function () {
reminder.postRemindMessage()
},
start: false,
timeZone: 'Asia/Tokyo',
})
job.start()
中身は @slack/client
を使っているだけ。
便利な API が多いと助かる。
追記
https://github.com/9renpoto/slack-channel-active-reminder/pull/9
flow gen-flow-files
が良いものをだしてくれないため外す。
早く 1.0 が待ち遠しい。
Written by Keisuke Kan who lives and works in Japan building useful things. You should follow him on Twitter