hussamh10
hussamh10

Reputation: 139

Photos not being sent by telegram bot

I have been trying to send photos through my telegram bot but they never make to the user (text messages are sending just fine). I am using python and telepot as the framework.

bot.sendMessage(chat_id, 'Hello')
bot.sendPhoto(chat_id, open('k.png', 'rb'))

The bot is able to send the text message but not the photo.

Is there some problem with my code or telegram servers?

Upvotes: 2

Views: 894

Answers (1)

Seyfi
Seyfi

Reputation: 1980

Because of my reputation I couldnt send this answer as a comment , so accept my apologies.

I am not familiar with telepot framework that you mention but i think it may work in a same way with crude coding. In telegram protocol you MUST first upload image to telegram server for the first time, then Telegram Server would give you a unique id for that image and then every time you like to resend it to someone you should send that id instead of image. so if telepot is not working you can use crude coding for that part.

Upvotes: 1

Related Questions