cjongseok / mtproto

Telegram MTProto and its proxy (over gRPC) in Go (golang). API Layer: 71
Apache License 2.0
151 stars 20 forks source link

A way to obtain file_id from media documents #19

Closed DenisAltruist closed 5 years ago

DenisAltruist commented 5 years ago

Is there a way to recieve file_id from Media types (TypeMessageMedia) to send it through bot API without downloading? For example, in bot API for sharing existing photo required string file_id, but in core API only can be found (TypeFileLocation) fields, like VolumeId, Secret and so on.

cjongseok commented 5 years ago

@DenisAltruist Thanks for your interest in this repository. I am not so sure files would be interoperable between core API and bot API, because their ID system is quite different. Can you let me know if you ever heard of a case sharing files between APIs?

DenisAltruist commented 5 years ago

I don't know such cases. Yes, probably it's impossible to get file_id in core API (Moreover, file_id is different for different bot entities in bot API). The tricky solution is to forward message to particular bot or download file with providing accessible url for Telegram or upload again with bot.