More features for my Telegram bot
I have a Telegram bot to save files to my zettelkasten. It’s always there, waiting for my muses to visit.
Currently, it only supports text files. When I write a message, it adds them to a new file or a file changed in the last 30 minutes to make multi-paragraph inputs easier.
I need some more features to make it more useful.
I want to make it to save audio and image files to my inbox as well. I want to run Xvc pipelines on these files to convert my audio notes to text and make images searchable, using OCR or tagging.
The first step to achieve this is to understand what kind of files Telegram can upload and download. I want to track these files with Xvc not to bloat the Git repository. I have a script that processes these files but currently it only commits changes to Git. I want to know if a file is should go to Xvc or Git.
I skimmed the Telegram API documentation and found that it supports a wide range of file types. This made me to change my approach, that tracking only .txt
and .md
files with Git and tracking all other files with Xvc.
In the future, I plan to add a --binary-only
option to xvc file track
to track binary files only. This will help me to track only the files that are not text when using globs as targets. Maybe I’ll extend this to a general predicate to decide which files to track by their size, modification time or other properties.