Slack Bot that aggregates Google Calendar's events by colors, and send the summary chart to Slack.
- Open https://api.slack.com/apps and create new Slack App
- In
Incoming Webhooks
, input the channel name you want to post the message. Then obtain Webhook URL [1]
- In
OAuth & Permissions > Scopes
, addfiles:write
- Copy
Bot User OAuth Token
[2]
-
If it's already installed, re-install it (needed because you changed the app's scope)
-
Add the Slack App to the channel
-
Copy https://docs.google.com/spreadsheets/d/1uf5XqUqcsIfwMdeJYZg6rJ3psmPPnJhMKf9OouLl55c/edit
-
Open
📆 Menu > Settings
in the Spreadsheet -
Authorize it
- You might see "Google hasn't verified this app" in the popup, click
Advanced -> Go to Google Calendar Events Analyzer (unsafe)
- You might see "Google hasn't verified this app" in the popup, click
-
Open
📆 Menu > Settings
again, input [1] Webhook URL, [2] Bot User OAuth Token, [3] Slack channel name -
In
categories
sheet, input category names next to the color cells you want to aggregate -
In
Apps Script
menu, add the following 2 triggers
Function | What it does | type of time based trigger |
---|---|---|
runDaily |
Aggregate today's Google Calendar events and post to Slack | Day timer |
runWeekly |
Post the weekly summary chart to Slack | Week timer |