Repository navigation
Replies: 5 comments 3 replies
|
Hi. Do you get any specific error message? If yes, please show the traceback. |
no , nothing i think it's just about telegram :( |
|
Hey, BadRequest: Wrong type of the web page content I’m using an image URL. Strangely, when I switch the image from JPG to PNG format, it works perfectly. Thanks in advance! |
This comment was marked as spam.
This comment was marked as spam.
|
Hi! Yes, there are a few restrictions when sending photos by URL using Telegram's Bot API fetches the image from the URL, so some links may fail even if they open in your browser. Common reasons include:
I'd recommend adding error handling to identify which URLs fail: import logging
from telegram.error import TelegramError
logger = logging.getLogger(__name__)
for url in urls:
try:
context.bot.send_photo(
chat_id=update.effective_chat.id,
photo=url
)
except TelegramError as e:
logger.warning("Failed to send %s: %s", url, e)Check the error message for each failed URL. You can also download the image yourself and pass the file to For GIF URLs, use The key is to inspect the actual Telegram API error for each failed link; that will tell you whether it's a URL, format, or file-size issue. Official reference: https://core.telegram.org/bots/api#sendphoto |
Uh oh!
There was an error while loading. Please reload this page.
hi !
I have a problem that has eaten my nerves
pls help me
problem:
i want to send photo by URL using "send_photo"
I have a list of links that I want to send but not all links are sent and I do not know what to do
Were there any restrictions on sending photos?
EX:
this my code and not all links are sent
🗡️
All reactions