A Slackbot that makes documentation easier! Docubot connects to a channel and automatically sends messages in a slack channel to a linked Notion database.
Features:
- Supports two message parsing modes: 'all' (all messages get sent) and 'link' (only messages with URLs get sent)
- Threads are tracked in Notion Page
- Messages can be added/removed from notion using a react
- Priority of message can be marked using reacts
The following slack message will create the row in the linked notion database below!
Any comments threaded on the slack message, will similarly be sent to the Notion page!
- Create a new Slackbot in your workspace on the Slack API Webiste
Necessary Scopes:
- channels:history
- channels:read
- chat:write
- reactions:read
- reactions:write
- users:read
Necessary Event Subscriptions:
- message.channels
- reaction_added
- Clone this repo and set up the appropriate environment variables
Environment Variables
SLACK_AUTH_TOKEN= <Found under "Oauth & Permissions">
SLACK_SIGNING_SECRET= <Found under "Basic Information">
NOTION_AUTH_TOKEN= <Login to Notion on web, and take value from cookie named "token_v2">
-
Create a relevant settings file using structure described below
-
Deploy code to server (like heroku) and setup Event URL on Slackbot API Website
-
Invite Slackbot to channels and start using!
Sample Settings.json file:
{
"channelRules": {
"references": {
"notionBaseUrl": "https://www.notion.so/....",
"messageTrigger": "link",
"reactions": {
"ack": "floppy_disk",
"normalPriority": "heavy_plus_sign",
"highPriority": "exclamation",
"veryHighPriority": "bangbang",
"saveMessage": "inbox_tray",
"unsaveMessage": "outbox_tray"
},
"fieldNames": {
"title": "Title",
"priority": "Importance",
"user": "Sourcer",
"link": "Link"
}
}
}
}
For each channel that you want Docubot to watch, add a new property in channelRules
with the name of the channel. Below is an explanation of each of the properties for each channel
notionBaseUrl
: This is the URL of the database you want to send data to (right-click and press "copy link" to get this URL from notion)
messageTrigger
: This determines which type of messages Docubot will respond to. Options are "all" (which sends all messages) and "link" (which only sends messages with links)
reactions
: Emojis used to react and control Docubot
ack
: This is the emoji Docubot uses to note that it has saved a message in notionXpriority
: These three emojis are used to denote the priority of a rowsaveMessage
: This emoji react can be used to save an otherwise untracked message in Slack (it will not pick up existing threaded messages)unsaveMessage
: This emoji react can be used to unsave a currently tracked message in Slack
fieldNames
: Docubot sends data to notion using these column titles
title
: This is the primary key of the table. WhenmessageTrigger
is set to Link, this will be the title of the URL. Otherwise it'll just be the messagepriority
: Column name for priority delineation. Must be a single-select with options "Normal", "High", and "Very High" in Notionuser
: This is the column name where the user who sent the message will be savedlink
: If the trigger is a link, this is where the URL will be saved.