Creating a Daily Comic Slack Bot
Published in
1 min readDec 18, 2016
When it comes to task automation, few tools are as powerful as bots. Yet, not all bots have to solve serious business problems. Some can be fun. In this article, I am going to show you how to deploy a simple bot that posts a daily Dilbert comic to a Slack channel. The source code is available on GitHub.
Slack Integration
- Create a new Incoming WebHook on the Custom Integrations page
- Copy and save the Webhook URL
It should start withhttps://hooks.slack.com
You’ll need it for the commands below
Deploy Bot with Zeit’s Now
- Download “Δ now” from Zeit.co
Alternatively, install it with npm (npm install now -g
) - Deploy the application with the environment flag
now -e SLACK_WEBHOOK_URL=<URL from #2 above>
If you want to deploy my version of the bot, so that it posts to the #dilbert channel every day at 15:00 UTC (7am PST / 10am EST), you can do it with one simple command:
now deploy \
-e SLACK_WEBHOOK_URL=[CHANGE ME] \
https://github.com/ilyakam/dilbertbot
Remember to substitute [CHANGE ME]
with your SLACK_WEBHOOK_URL
in the command above.