pytg icon indicating copy to clipboard operation
pytg copied to clipboard

How to save a file which is sent to me?

Open poustchi opened this issue 9 years ago • 2 comments

Hi, Thanks for great API.Can you tell me how can I save a file which is sent to me on my computer using pytg. I don't know If I should use "load_photo" ? I Couldnt find proper way to use load_photo. Please advise me.

Thx

poustchi avatar Mar 06 '15 02:03 poustchi

At the moment, pytg does not handle downloading photo & document. It'd be a nice feature to add. To handle this properly, we will need another method, say called "load_photo" in Telegram class (in init.py) which will execute that load_photo command and save it to filesystem (typically it'll be in $HOME/.telegram/downloads). I'll be glad to accept patch to include this feature.

On Fri, Mar 6, 2015 at 10:12 AM poustchi [email protected] wrote:

Hi, Thanks for great API.Can you tell me how can I save a file which is sent to me on my computer using pytg. I don't know If I should use "load_photo" ? I Couldnt find proper way to use load_photo. Please advise me.

Thx

— Reply to this email directly or view it on GitHub https://github.com/efaisal/pytg/issues/12.

efaisal avatar Mar 07 '15 03:03 efaisal

you can now use

sender.load_photo(message_id)

It should return a path. More infos about the huge update today in the readme file.

luckydonald avatar May 18 '15 11:05 luckydonald