Skip to content

ProALgebra/telegram-diary-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gpt-friend — Telegram diary bot + LLM chat

A private Telegram bot for journaling (text/photos), quick summaries, and a “chat” mode. Stores data locally in SQLite.

Features

  • Diary: text entries and photo entries (photos are saved to disk).
  • Summaries: daily / weekly / monthly.
  • Tags: #tags inside entry text.
  • Privacy: allowlist by Telegram user_id (or open access if the list is empty).
  • Web search (optional): enable/disable via WEB_SEARCH_ENABLED.
  • UI language: Russian/English via BOT_LANG.

Requirements

  • Python 3.10+ (recommended 3.11+)
  • Telegram Bot API token
  • OpenAI API key

Quick start

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

cp .env.example .env
# fill in .env

python3 bot.py

Configuration (.env)

The bot reads settings from environment variables and an optional .env file (do not commit secrets).

Required:

  • TELEGRAM_TOKEN — Telegram bot token
  • OPENAI_API_KEY — OpenAI API key
  • ALLOWED_USER_IDS — Telegram user_id allowlist (comma/space-separated, e.g. 123,456). Empty => open access.

Optional:

  • BOT_LANGru or en (default: ru)
  • OPENAI_MODEL — default model (example: gpt-5.2)
  • OPENAI_VISION_MODEL — model for photo understanding (default: OPENAI_MODEL)
  • OPENAI_WEB_SEARCH_MODEL — model for web search (default: OPENAI_MODEL)
  • WEB_SEARCH_ENABLED1/0
  • BOT_DB_PATH — SQLite path (default: diary.db)
  • PHOTO_DIR — photo directory (default: diary_photos)
  • DIARY_PAGE_SIZE — diary list page size
  • LOG_LEVELINFO, DEBUG, ...

To find your Telegram user_id, message @userinfobot (or similar).

Data

  • Database: BOT_DB_PATH (default diary.db)
  • Photos: PHOTO_DIR (default diary_photos/)

Set up regular backups for these files/folders.

Localization

All user-facing strings are centralized in texts.py. Switch UI language via BOT_LANG.

ETH: 0x5F911FA3045dfE3d8E7c23a916FE8f2Aa45f8bd7

Roadmap

Ideas and next steps live in ROADMAP.md.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages