Trilium Telegram Bot

March 11, 2025 ยท View on GitHub

A powerful Telegram bot for seamless interaction with Trilium Notes, combining features from TGTriliumBot and trilium-bot.

โœจ Features

  • ๐Ÿ“ Note Creation - Create new notes directly from Telegram
  • ๐Ÿ“Ž Attachment Upload - Easily upload files to your Trilium notes
  • โœ… TODO Management - View, check, add, update, and delete TODO items
  • ๐Ÿ”„ Automated Tasks - Move yesterday's unfinished TODOs to today's note
  • ๐ŸŽฎ Interactive Interface - Inline buttons for intuitive navigation

๐Ÿš€ Quick Start

Prerequisites

  • A running Trilium Notes server
  • Docker and Docker Compose
  • A Telegram bot token (get one from BotFather)

Installation

  1. Clone the repository:

    git clone https://github.com/ktibr0/Trilium_telegram_bot
    cd Trilium_telegram_bot
    
  2. Configure environment variables:

    cp example.env .env
    

    Edit .env with your details:

    TELEGRAM_BOT_TOKEN=your_telegram_bot_token
    TRILIUM_ETAPI_TOKEN=your_trilium_token
    TRILIUM_API_URL=https://URL_for_Your_Trilium_server
    admin_list=your_telegram_id
    
  3. Build and run the Docker container:

    docker compose up --build -d
    

    For detailed logs:

    docker compose up --build -d && docker compose logs -f
    

๐Ÿ“ฑ Usage

  1. Start the bot by sending /start in your Telegram chat
  2. Use the interactive menu to access various features:

Creating Notes

Select "Create Note" and follow the prompts to add a title and content.

Managing Attachments

First, create a note titled "FromTelegram" in your Trilium. Then select "Create Attachment" in the bot, provide a name, and upload your file.

Note: Attachments remain for 30 days unless converted to notes. Access them by going to the note, clicking the 3 dots menu, and selecting "Note attachments".

Quick Notes

Simply send text messages to the bot to save them as subnotes to today's note.

TODO Management

  • Select "TODO List" to view today's TODOs
  • Tap items to check/uncheck them
  • Use the function buttons to add, update, or delete TODOs

Automated Tasks

The bot automatically moves yesterday's unfinished TODOs to today's note. Customize the schedule in config.json.

๐Ÿค Contributing

Contributions are welcome! Feel free to:

๐Ÿ™ Acknowledgements

This project builds upon the work done in: