English | Русский
The Photo Moments Telegram Bot delivers serendipitous snapshots from your personal collection straight to Telegram, enabling you to fondly reminisce about cherished memories.
- Get random photos from your library on a schedule using Cron.
- Request random photos by sending a message with a number or using the
/photo [count]
command. Maximum 10 photos per request. - 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.
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
env docker-compose.yml:
FM_ALLOWED_USERS_ID
,FM_CHAT_ID
,FM_TG_BOT_TOKEN
.photo-moments-telegram-bot/docker/docker-compose.yml
Lines 1 to 10 in f2cf105
- Configure the volumes in
docker-compose.yml
to map your photo folders. - Run command
docker-compose up -d
.
You can map multiple folders with photos, for example:
volumes:
- /home/user/photos:/photoLibrary/
- /home/user/photos2:/photoLibrary/
- /home/user/photos3:/photoLibrary/
For Synology NAS, you can use the Container manager or Docker package.
You can also run the bot from source code, build Go binary and run it. The bot requires the image process library libvips.
Param | Description |
---|---|
FM_TG_BOT_TOKEN | Telegram bot token, take from @BotFather |
FM_CHAT_ID | Chat ID where the bot will send messages. @userinfobot Can help to get chat id |
FM_ALLOWED_USERS_ID | Telegram user IDs that can use the bot. You can specify multiple id with separator ; |
FM_PHOTO_PATH | Path to the photo library folder |
FM_PHOTO_COUNT | The number of photos that the bot will send according to the schedule. Default 5 , maximum 10 |
FM_SEND_PHOTOS_BY_NUMBER | Send photos by number. Default true |
FM_SEND_PHOTO_CRON_SPEC | Cron to send random photos. Default 0 10 * * * |
Command | Description |
---|---|
[number] | Send random photo from library. number - count of photos |
/photo [count] | Send random photo from library. count - count of photos |
/paths | Show paths of last sent photos |
/info [number] | Show info about photo - path, time, camera, GPS location. number - sequence number of last sent photos |
We welcome contributions to improve this project.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.