@bot.callback_query_handler(func=lambda callback: callback.data == "перейти1")
def callback_message(callback):
with open("w.jpg", 'rb') as f:
media = types.InputMediaPhoto(types.InputFile(f))
bot.edit_message_media(media=media, chat_id=callback.message.chat.id, message_id=callback.message.message_id)
bot.edit_message_caption(chat_id=callback.message.chat.id, message_id=callback.message.message_id, caption="grggegregegergferg")
def callback_message(callback):
with open("w.jpg", 'rb') as f:
media1 = types.InputMediaPhoto(f)
bot.edit_message_media(media=media1, chat_id=callback.message.chat.id,message_id=callback.message.message_id, reply_markup=None)
bot.edit_message_caption(chat_id=callback.message.chat.id, message_id=callback.message.message_id, caption="grggegregegergferg", reply_markup=None)