Answer the question
In order to leave comments, you need to log in
I sent a photo, how can I delete it and send a new one instead, edit the photo (i.e. change it)?
# К примеру вот такой код
bot.send_photo(chat_id, photo=open('C:/Users/User/Downloads/photo.jpg', 'rb'), caption = "Hello")
bot.send_message(chat_id, "Текст")
time.sleep(1)
bot.edit photo #Здесь мои полномочия заканчиваются
Answer the question
In order to leave comments, you need to log in
There is a method that allows you to edit media messages (editMessageMedia). In the telebot library (pyTelegramBotAPI), it is used like this:
bot.edit_message_media(media, chat_id=None, message_id=None, inline_message_id=None, reply_markup=None)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question