This is simple program that get new messages from Telegram bot and sync its to notion page block.
-
Create a telegram bot and get the token
-
Create a notion integrations and get token
-
Create a notion database and set the page template to
Journal -
From the upper right corner of your Notion database
Add connectionsadd connection bindings to the integration name created in step 2. -
The browser opens the Notion database and copies the database_id
www.notion.so/<username>/<database_id>?v=<view_id> -
Configure in
config.py-
telegram token
TELEGRAM_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -
notion integration token
NOTION_AUTH = "secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -
notion database_id
NOTION_DATABASE_ID = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
-
Note: For optional parameters such as custom tag attributes and names, speech-to-text, etc., please read config.py to configure it yourself.
-
Install Docker
- ubuntu:
sudo apt install docker - centos:
sudo yum install docker-ce
- ubuntu:
-
Run the program
docker run -d \
--name notion-inbox-telegram \
-e TELEGRAM_TOKEN="" \
-e NOTION_AUTH="" \
-e NOTION_DATABASE_ID="" \
-e TIMEZONE="Asia/Shanghai" \
cooolr/notion-inbox-telegram:latest- Install dependencies
pip install -r requirements.txt- Quick start
python3 main.pyAdd the Telegram bot to a chat and start sending messages.
- Log text, images, documents, video notes, and voice messages from Telegram to a Notion database.
- Automatically convert voice messages to text (optional, requires Baidu Speech API).
- Manage links in messages and add them to the Notion database.
- Make sure you have the required API keys and tokens for Telegram and Notion.
- The Baidu Speech API is optional and requires additional configuration, and install ffmpeg.

