Похожие чаты

Is it possible to send a photo using the URL

of it with Telethon (MTProto)? The file option in send_message does accept a string, but it doesn’t seem to work with URLs

10 ответов

6 просмотров

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

Gegham-Zakaryan Автор вопроса
تایرد
api.telegram.org/botxxxxxx/sendPhoto data = { cha...

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

Gegham-Zakaryan Автор вопроса
Ryn
wdym by that?

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

Gegham-Zakaryan Автор вопроса
Gegham Zakaryan
the thing is I tried it exactly this way and it di...

Maybe there's an issue with your image link. Btw send your code and error to see what's the problem

Похожие вопросы

Обсуждают сегодня

Есть какой-нибудь для Delphi/FPC T*Compression(Decompression)Stream на базе LZ4/Zstd/любой другой быстрый(и хорошо сжимающий) алгоритм А ещё лучше в pure pascal А ещё лучше од...
notme
32
А чем вам питонисты не угодили?😂
.
79
Hey guys, did you see the new announcement about $Fun? 🔥
Filip Murphy
55
Язык Си можно выучить за день? По книжке ANSI C на 230 страниц
Vincent Vegan
29
Привет, запускаю werf в dind в k8s, получаю ошибку на этапе build/beforeSetup: /.werf/stapel/embedded/bin/bash: /.werf/scripts/5898bdfe5214357d3706b879cc8d3d78460fb379607cbd...
florius0
7
Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
75
пацаны, как-нибудь можно панель задач заблюрить, что она была похожа на kde или винду 7, 11?
В
16
or do they all have 240?
Ilnur Zaripov
9
HI. Just reviewd Planck website which looks undercooked and some menu is not leading to correct section of site. Also, the vesting is shown to be for 20 months starting next y...
Neo517
4
Дорогие любители Прекрасной Джулии! Есть кто-то имеющий практический опыт построения ML для Систем Управления? Нам нужно сделать нейросеть для автоматической подстройки пара...
Roman Timo
4
Карта сайта