K
K
keeksiik2021-08-17 21:36:50
Python
keeksiik, 2021-08-17 21:36:50

How to send image from imgur to Telegram Bot Python?

I use this code

bot.send_photo(message.chat.id, get('https://imgur.com/yaBianG').content)


Gives an error
(__init__.py:647 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: IMAGE_PROCESS_FAILED"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SKEPTIC, 2021-08-17
@keeksiik

Because the link is an html page, not a photo. Gotta do it like this

bot.send_photo(message.chat.id, get('https://i.imgur.com/yaBianG.jpeg').content)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question