Unveiling the Photo Moments Telegram Bot: Revive Your Treasured Memories
In the digital age, we’ve become the proud curators of an expansive library of photographs, a captivating collection spanning of our lives. Yet, these snapshots of joy, love, and adventure often lay dormant, tucked away in the recesses of our devices. They yearn to be unearthed, to breathe life into forgotten moments and transport us back to the heartwarming stories they encapsulate. Using to the Photo Moments Telegram Bot, every day you will get a random photos from your collection and remember wonderful moments.
Imagine the delight of stumbling upon a long-lost photograph — a candid shot from that unforgettable road trip, a tender embrace at a family gathering, or the radiant smiles shared among friends. These fragments of time hold the power to rekindle emotions and transport us to places we hold dear.
Features
- Self-hosted
- Get random photos from your library on a schedule using Cron
- Request random photos by sending a message to bot
- Supports various image formats: `jpg`, `png`, `gif`, `webp`, `heic`.
- Automatic compression of photos larger than 6 MB before sending.
- Show info about photo — path, time, camera model, GPS location.
Installation and Usage
Docker
To run from Docker, you need to do the following:
- Install Docker and Docker Compose
- Create your bot and get a token from BotFather
- Get chat_id from userinfobot
- Set mandatory envirmoments in docker-compose.yml
services:
photo-moments-app:
image: trueromancha/photo-moments:latest
volumes:
- /pathToYouPhotoLibrary/:/photoLibrary/
environment:
- FM_ALLOWED_USERS_ID=userId;userId2
- FM_CHAT_ID=chatId
- FM_TG_BOT_TOKEN=botToken
5. Configure the volumes in docker-compose.yml to map your photo folders
You can map multiple folders with photos, for example:
volumes:
- /home/user/photos:/photoLibrary/
- /home/user/photos2:/photoLibrary/
- /home/user/photos3:/photoLibrary/
6. Start bot with run command docker-compose up -d
Synology NAS
For Synology NAS, you can use the Container Manager or Docker package.
From source
You can also run the bot from source code, build Go binary and run it. The bot requires the image process library.
Configuration
- FM_TG_BOT_TOKEN: Your Telegram bot token obtained from BotFather.
- FM_CHAT_ID: The chat ID where the bot sends messages, retrievable from userinfobot.
- FM_ALLOWED_USERS_ID: Telegram user IDs authorized to use the bot, with multiple IDs supported using a separator “,”.
- FM_PHOTO_PATH: Path to your photo library folder.
- FM_PHOTO_COUNT: The number of photos the bot sends per schedule (default: 5, maximum: 10).
- FM_SEND_PHOTO_CRON_SPEC: Cron schedule for sending random photos (default: 0 10 * * *).
Commands
- [number]: Receive a random photo from your library. Specify the desired number for multiple photos.
- /photo [count]: Request random photos with a specific count.
- /paths: Display paths of the last sent photos.
- /info [number]: Explore detailed information about a photo, including its path, time of capture, camera model, and GPS location.
Contributing
Welcome contributions to improve this project and send any idea.
Check at https://github.com/Romancha/photo-moments-telegram-bot