N2D is a simple to use script that sends messages to a Discord channel for every new update to the items in your Notion database!
For any questions, please contact me via Discord at @bherrera or email at b10@asu.edu
What it looks like on Notion
What it looks like on Discord
What it looks like on Discord with vertically stacked attributes
- Any Linux Distribution
- Docker (if not using in-house python packages)
- Miniconda (if not using Docker)
This is going to be tedious, but bare with me! 😉👍
- Git clone this repo
git clone https://github.com/BenjaminHerrera/Notion2Discord.git- Create a
.envfile in the./directory. It should have the following contents:
NOTION_INTEGRATION_TOKEN="..."
NOTION_DATABASE_ID="..."
DISCORD_WEBHOOK_URL="..."- Go to your Notion integration page >>
New Integration>> Enter name for integration >>Submit>> CopyInternal Integration Secret>> Paste it as a value for theNOTION_INTEGRATION_TOKENvariable in your.envfile. - Go to your database on Notion >> Click on the three dots on the top right
of the page >>
Add connections>> Select integration that you made. - Copy the database's link and extract the substring
<hash_1>from this format:
https://www.notion.so/<hash_1>?v=<hash_2>
- Place this substring as a value for the
NOTION_DATABASE_IDvariable in your.envfile. - Click on the gear icon next discord channel name >>
Integrations>>Webhooks>>New Webhook>> Click on new webhook >>Copy Webhook URL>> Paste the URL into the value section of theDISCORD_WEBHOOK_URLvariable in your.envfile. - Hard part's done 🎉🎉🎉! Now that you have your
.envcreated, check the Run Guide on how to run the project.
NOTE: To update the frequency, editor the MINUTES arguments value in ./docker-compose.yml.
Default is at 15 minutes.
docker compose up -d --build
NOTE: Installation requires repeat frequency in minutes. Replace X with your
preferred repeat frequency.
bash ./install_crontab.sh X
cd notion2discordpip install -r requirements.txtpython main.py
Configuration for the application can be found in
./notion2discord/config/config.json
logo: string - Image URL to customize your webhook sendername: string - Name of the webhook sendercolor: int - Color of the embed messages. Use this to find decimal value representation of your preferred color.inline_attributes: boolean - True to have everything fill from left to right. False if you want them to be in a straight columndatetime_format_with_time: string - Time formatter for dates with times. This is used for date attributes in Notion DB items with time specified. Use this to help you create your desired format stringdatetime_format_without_time: string - Time formatter for dates without times. This is used for date attributes in Notion DB items with NO time specified. Use this to help you create your desired format string.dispatch_limit: int or None - Limit how much can be dispatched to your Discord text channel.empty_value: string - Standard format for values that are emptycheckbox_true: string or Emoji - Value to show if checkboxes are filledcheckbox_false: string or Emoji - Value to show if checkboxes are NOT filleddebug_mode: boolean - Either turn on or turn off debugging outputslast_update_offset: int - Sometimes, timings can be finicky. Accounts for lag from Notion and your server's end. Use this value to get items that have been edited 60 seconds pluslast_update_offsetseconds amount of time.
- Q: How does it work? 🤔
- A: The script works by checking to see if a Notion item was changed after
the last check. The script leverages
crontabto check your every now and then.
- A: The script works by checking to see if a Notion item was changed after
the last check. The script leverages
- Q: Why use crontab? ⏳❓
- A:
crontabis more efficient than using a while true loop or a scheduler inside Python. This project is designed to be easy to use and lightweight on resource utilization. You can dynamically control the refresh rate without stopping the system.
- A:
- Q: I noticed a bug/issue. How do I report it? 🚨
- A: Please go to the issues page and create a new issue there. When you create an issue, there will be steps on how to communicate them. Thanks in advance!


