Skip to content

shataev/audio-noter-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Noter

A Telegram bot that turns voice messages into structured diary entries in Notion. Designed to work with the Notion Journal — see the official setup guide to create one.

How it works

  1. You send a voice message to the bot
  2. OpenAI Whisper transcribes the audio
  3. GPT-4o-mini formats the transcription into a title, clean text, and tags
  4. The bot shows a preview — you can edit the title, text, or tags before saving
  5. Optionally mark the entry as a highlight ⭐
  6. Press Save — the entry is appended to today's Notion page (or a new page is created)
  7. Every day at 21:00 the bot sends a GPT-generated summary of the day

Commands

Command Description
/start Welcome message and quick overview
/help Detailed usage instructions

Editing before saving

After the voice message is processed, the bot sends four messages in sequence:

  • Title — short heading generated by GPT
  • Text — cleaned up transcription
  • Tags — auto-extracted + Daily (always added)
  • Action buttons
[ ✎ Title ]  [ ✎ Text ]  [ ✎ Tags ]
[      Mark as Highlight ⭐       ]
[            ✓ Save              ]

Clicking an edit button removes the buttons and prompts you to send a new value. After you send it, the corresponding message updates in place and the buttons return.

Highlights

Press Mark as Highlight ⭐ to mark the entry as a key moment of the week. The button toggles — press again to unmark. When saved, the entry heading in Notion gets a prefix so it's easy to spot.

Tags

The Daily tag is always added automatically. Additional tags can be:

  • Extracted from voice — mention them naturally: "went for a run today. Tags: sport, health"
  • Edited manually — click ✎ Tags and send tags separated by commas: sport, health, work

When appending to an existing page, tags from all entries are merged without duplicates.

Daily summary

Every day at 21:00 (in your timezone) the bot sends a GPT-generated summary of all diary entries recorded that day. If no entries were recorded, it sends a friendly reminder instead.

Notion database setup

The bot works with the Notion Journal database described in the official guide. Make sure your database has the following properties:

Property Type Notes
Name Title Page title. Format: 9 May | Entry 1, Entry 2
Created Date Set per entry. Used to find today's page
Tags Multi-select Auto-populated. Daily is always added

Installation

git clone https://github.com/shataev/audio-noter-bot.git
cd audio-noter-bot
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Configuration

Copy .env.example to .env and fill in the values:

cp .env.example .env
Variable Description
TELEGRAM_TOKEN Bot token from @BotFather
OPENAI_API_KEY OpenAI API key (used for Whisper + GPT-4o-mini)
NOTION_TOKEN Internal integration secret from notion.so/profile/integrations
NOTION_DATABASE_ID ID from the database URL: notion.so/workspace/{ID}?v=...
ALLOWED_USER_ID Your Telegram user ID — get it from @userinfobot
TIMEZONE Your timezone, e.g. Asia/Bangkok, Europe/Moscow

Connecting Notion integration to your database

  1. Open your database in Notion
  2. Click ...Connections → select your integration

Development

Run locally (stops the bot on VPS to avoid conflicts):

make dev

When done, restore the bot on VPS:

make stop-dev

Deployment

Deploy to VPS with one command:

make deploy

This pushes changes to GitHub, pulls them on the VPS, and restarts the bot.

First-time VPS setup

git clone https://github.com/shataev/audio-noter-bot.git /opt/noter
cd /opt/noter
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
nano .env  # fill in all values

Create /etc/systemd/system/noter.service:

[Unit]
Description=Noter Telegram Bot
After=network.target

[Service]
User=root
WorkingDirectory=/opt/noter
ExecStart=/opt/noter/.venv/bin/python bot.py
Restart=always
RestartSec=5

[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable noter
systemctl start noter

Useful commands:

systemctl status noter        # check status
journalctl -u noter -f        # live logs
systemctl restart noter       # restart manually

Project structure

noter/
├── bot.py                  # Telegram bot entry point
├── config.py               # Settings loaded from .env
├── services/
│   ├── whisper.py          # Audio transcription via OpenAI Whisper
│   ├── formatter.py        # Entry formatting via GPT-4o-mini
│   ├── notion.py           # Notion API: create/update diary pages
│   └── summary.py          # Daily summary and weekly report generation
├── Makefile                # Dev and deploy commands
├── requirements.txt
└── .env.example

Estimated costs

Both Whisper and GPT-4o-mini are very cheap for personal use:

Service Price Cost per entry (~1 min voice)
Whisper $0.006 / minute ~$0.006
GPT-4o-mini $0.15 / 1M tokens ~$0.00005

100 entries/month ≈ $0.60

About

A Telegram bot that turns voice messages into structured diary entries in Notion.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors