downloads images from your Telegram chat in selected MongoDB collections and saves them locally. Plus, it provides different remote commands for different operations.
-
!all
: shows all images saved in set collection -
!set <collection>
: select a collection to save your images to. for ex.!set myCollection
-
!getLast
: provides last saved image in selected collection -
!get <imageName>
: get a specific image from selected collection. for ex.!get img_hdcf45...
finds saved image which contains provided image name -
!deleteAll"
: deletes all images from database -
!info
: shows current selected collection
- check
.env.examples
:
# Mongo DB connection
MONGODB_CONNECTION_STRING=mongodb://localhost:27017
MONGODB_DATABASE_STRING=saver-database
# Telegram connection
# How to get a Bot Token? -> https://core.telegram.org/bots#how-do-i-create-a-bot
TELEGRAM_API_TOKEN=<TELEGRAM_API_TOKEN>
# How to get a Chat ID? -> https://stackoverflow.com/a/38388851
# https://api.telegram.org/bot<TOKEN>/getUpdates
TELEGRAM_CHAT_ID=<TELEGRAM_CHAT_ID>
# Some salt to save images with xyz ending
SALT=xyz
- create MongoDB
docker-compose up -d
- start app with
go run main.go
- build app with
go build
- don't forget to run
docker-compose up -d
to create a mongo database - use
docker exec -it mongodb bash
to connect to mongodb-container - use
mongosh
to use the mongodb-shell and then runuse saver-database
- check collection
saver-collection
with inserted docs:db["saver-collection"].find()
db["saver-collection"].deleteMany({})