Skip to content
/ saver Public

downloads images from your Telegram chat in selected MongoDB collections and saves them locally. Plus, it provides different remote commands for different operations.

Notifications You must be signed in to change notification settings

maikpro/saver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Saver

Description

downloads images from your Telegram chat in selected MongoDB collections and saves them locally. Plus, it provides different remote commands for different operations.

current Telegram commands

  • !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

environment variables

  • 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

Start & Build

  • create MongoDB docker-compose up -d
  • start app with go run main.go
  • build app with go build

MongoDB with Mongosh

  • 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 run use saver-database

Read all entires

  • check collection saver-collection with inserted docs: db["saver-collection"].find()

Delete all entries

  • db["saver-collection"].deleteMany({})

About

downloads images from your Telegram chat in selected MongoDB collections and saves them locally. Plus, it provides different remote commands for different operations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages