api.telegram.org/botxxxxxx/sendPhoto data = { chat_id: .... } requests.post(url,data=data , files = {"photo": open("photo.jpg","rb")}) this is example complete it with your knowledge
I know that bot API can do it, I wanted to know if MTProto can
wdym by that?
if i remember correctly yes you can you need to create an io to that file and pass that io to functtion
the bot API’s sendPhoto endpoint can take an HTTP URL of a photo and not require me to download it and upload separately. I want to know if Telethon (MTProto) can do that because when I tried it didn’t work
► Ⲉⳳⲁⳑ (in 9s) await client.send_message(event.chat_id, file="https://graph.org/file/da0a4188236f94231c6ed.jpg") ► Ⲟυⲧⲣυⲧ: Success
you can, just pass the url as photo
the thing is I tried it exactly this way and it didn’t work
Maybe there's an issue with your image link. Btw send your code and error to see what's the problem
Обсуждают сегодня