A powerful, Python-based Telegram bot that acts as a bridge to your self-hosted Blinko instance. Seamlessly archive text, images, files, and entire media groups from a designated chat. Built to work with the latest version of Blinko and designed for simple, reliable deployment using Docker Compose. The modern, maintained alternative.
- Save Text: Receives plain text messages and creates new Blinko notes.
- Upload Files: Handles images and various documents/files, uploading them as native attachments and creating corresponding notes.
- Media Group Support: Correctly processes media groups (albums) with multiple images, combining all images and the caption into a single note.
- Instant Feedback: Provides status updates like "Received, saving..." and confirms the result upon completion.
- Dockerized: Deploys instantly with Docker and Docker Compose for easy management.
- Secure: Configured via environment variables to keep your secrets safe.
Before you begin, ensure you have the following:
- Docker and Docker Compose.
- A running self-hosted instance of Blinko.
- A Telegram Bot Token (created via @BotFather).
- Your own Telegram Chat ID (you can get it from @userinfobot).
- An API Bearer Token generated from your Blinko instance.
-
Clone the repository
git clone https://github.com/ikofan/PyBlinkoBot.git cd PyBlinkoBot -
Create and configure the
.envfile Copy the example file to create your own configuration file.cp env.example .env
Then, edit the
.envfile and fill in your credentials.TELEGRAM_BOT_TOKEN="YOUR_TELEGRAM_BOT_TOKEN" AUTHORIZED_CHAT_ID="YOUR_CHAT_ID" BLINKO_API_URL="http://your-blinko-instance.com" BLINKO_API_KEY="YOUR_BLINKO_BEARER_TOKEN"
-
Start the service Launch the bot with a single Docker Compose command.
docker-compose up -d
Your PyBlinkoBot is now running in the background!
-
View real-time logs:
docker-compose logs -f
-
Stop and remove the container:
docker-compose down
-
Update and redeploy after code changes:
docker-compose up -d --build
Pull requests and issues are welcome to improve this project!
This project is licensed under the MIT License.
一个功能强大的 Telegram 机器人,它可以接收指定用户的消息、文件和媒体组,并自动将它们保存到您自托管的 Blinko 笔记服务中。本项目使用 Python 实现,适配最新版 Blinko,并通过 Docker 进行部署。
- 文本保存: 接收纯文本消息并创建新的 Blinko 笔记。
- 文件上传: 接收图片和各类文档(文件),将其作为原生附件上传并创建笔记。
- 媒体组支持: 能够正确处理包含多张图片的媒体组,将所有图片和文字说明合并到一条笔记中。
- 即时反馈: 发送“收到,正在保存...”等状态更新,并在完成后告知结果。
- Docker 化部署: 使用 Docker 和 Docker Compose,实现一键启动和轻松管理。
- 安全: 通过环境变量配置密钥,避免敏感信息硬编码。
在开始之前,请确保您已准备好:
- Docker 和 Docker Compose。
- 一个正在运行的 Blinko 自托管实例。
- 一个 Telegram 机器人 Token (通过 @BotFather 创建)。
- 您自己的 Telegram Chat ID (通过 @userinfobot 获取)。
- 从您的 Blinko 实例生成的 API Bearer Token。
-
克隆本仓库
git clone https://github.com/ikofan/PyBlinkoBot.git cd PyBlinkoBot -
创建并配置
.env文件 复制env.example文件,并将其重命名为.env。cp env.example .env
然后,编辑
.env文件,填入您的个人信息。TELEGRAM_BOT_TOKEN="YOUR_TELEGRAM_BOT_TOKEN" AUTHORIZED_CHAT_ID="YOUR_CHAT_ID" BLINKO_API_URL="http://your-blinko-instance.com" BLINKO_API_KEY="YOUR_BLINKO_BEARER_TOKEN"
-
启动服务 使用 Docker Compose 一键启动机器人。
docker-compose up -d
现在,您的 PyBlinkoBot 已经在后台运行了!
-
查看实时日志:
docker-compose logs -f
-
停止并移除容器:
docker-compose down
-
更新代码后重新部署:
docker-compose up -d --build
欢迎提交 PR 或 Issue 来改进这个项目!
本项目使用 MIT License 开源。