Start a bot to send scheduled message to your slack channel.
Be sure to have a web hook installed at your slack subdomain. You'll need you'r own team's Webhook URL
For more information check: Incoming Webhooks API
You can start using this bot either as:
npm install
./configs/config.json with the next data:{
"SLACK_HOOK_URL": "someUrl",
"SLACK_MESSAGE": "Hello World!",
"SLACK_CHANNEL": "#random",
"CRON_TIME": "0 * * * * *"
}
npm start
The local Dockerfile is used at the Docker Hub Official Registry.
Just run:
docker run -e NODE_ENV=production SLACK_HOOK_URL={yourSlackWebHookUrl} -e SLACK_MESSAGE={messageToBeSent} -e SLACK_CHANNEL={channelId(s)/Name(s)} -e CRON_TIME={yourCronTime} -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime oscardhdz/slack-cronbot
You might want to be aware of container timezone issues. I reommend binding time paths between conatiner and host with:
-v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime
If set up correctly, you should get an output like this (Preview available at Github):

| Variable | Value | Description |
|---|---|---|
| NODE_ENV | development OR Any | If not specified, Will set development by default and will try to read ./configs/config.json file. Use anyother value to listen to Env var binds |
| SLACK_HOOK_URL | Web Hook Url | Your slack team incoming web hook. Check Incoming Web Hook API for more info. |
| SLACK_MESSAGE | Text | The message to be sent by this Bot |
| SLACK_CHANNEL | #ChannelName OR ChannelId OR Channels,separeted,by,commas | A channel name with '#' char, or a channel Id (Beware channel name might change but Id wont). You can also specify 2 or more by separating each one with a coma |
| CRON_TIME | Cron Format: * * * * * * | Cron time syntax. Check npm Cron Ranges for more detail. Sets each minute by default (0 * * * * *) |
Content type
Image
Digest
Size
27.1 MB
Last updated
about 9 years ago
docker pull oscardhdz/slack-cronbot