Skip to content

dzarlax/Document2Telegram

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Document to Telegram

About

This docker container checks if a new file is created on a folder and sends it to a person/group/channel using Telegram Messenger.

Setup

Docker Compose

doc2tg:
    image: gabrielrf/document2telegram
    environment:
        - BOT_TOKEN=
        - FOLDER=/
        - EXTENSION=
        - DESTINATION=
    restart: always
    volumes:
        - host_folder:container_folder

BOT_TOKEN: Token given by @BotFather on Telegram.

FOLDER: Folder that will be monitored by the script. In case of a folder tree, set the top-level folder.

EXTENSION (optional): The extension of the file that should be sent. Usually mp4 is the case.

DESTINATION: To whom the message will be sent.

volumes: The same folder used on FOLDER:Some folder that exists on the container. Suggested: /mnt

Python

First, run

pip install inotify
pip install pytelegrambotapi

to install the libraries needed. Then, open file2gif.py and make the necessary adjustments on BOT_TOKEN, FOLDER, EXTENSION and DESTINATION as listed above.

Run the Python Script.

python doc2tg.py

Contribute

Pull requests and issues are welcome!

Contact me

GabRF.com

@GabrielRF on Telegram.

About

Watches a folder. If new file, sends it using Telegram Messenger.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.9%
  • Dockerfile 17.1%