Answer the question
In order to leave comments, you need to log in
PyTelegrabBotAPI error when editing photo?
tell me where I'm not doing the
id photo correctly, I checked it.
import telebot
from telebot import types
bot = telebot.TeleBot('*************')
foto_1='AgACAgIAAxkBAAIJi16cNHdOWxDWIzTPwdkXZM9Odbn7AAJRrjEb3ZvhSDDlmHwPDBzMuZ3CDwAEAQADAgADeAADhOIGAAEYBA'
foto_2='AgACAgIAAxkBAAIJjF6cNNI-ezbWBWgvj0_aAjggpbrkAAJSrjEb3ZvhSBTYOFlaDaTq1XoAAZIuAAMBAAMCAAN4AAPCawACGAQ'
@bot.message_handler(commands=['start'])
def start(message):
myrep = types.InlineKeyboardMarkup()
button = types.InlineKeyboardButton(text='изменить фото', callback_data='opa')
myrep.add(button)
bot.send_photo(message.chat.id, foto_1, reply_markup=myrep)
@bot.callback_query_handler(func=lambda call: True)
def sddvsd(call):
if call.data =='opa':
bot.edit_message_media(media=foto_2, chat_id=call.message.chat.id, message_id=call.message.message_id ) ####
bot.polling(none_stop=True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question