Answer the question
In order to leave comments, you need to log in
How to fix AttributeError: 'NoneType' object has no attribute 'to_dict'?
Hello. The problem is this:
elif call.data == "1":
keyboard = types.InlineKeyboardMarkup()
rele5 = types.InlineKeyboardButton(text="Оформить", callback_data="e")
backbutton = types.InlineKeyboardButton(text="back", callback_data="mainmenu")
keyboard.add(rele5, backbutton)
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text="Купить:",
reply_markup=keyboard)
elif call.data == "e":
keyboard = types.InlineKeyboardMarkup()
rele1 = types.InlineKeyboarButton(text="Ввести имя пользователя", callback_data="6")
backbutton = types.InlineKeyboardButton(text="back", callback_data="mainmenu")
keyboard.add(rele1, backbutton)
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text="Введите имя пользователя :",
reply_markup=keyboard)
Answer the question
In order to leave comments, you need to log in
We go into the translator and drive in the error there. At the output we get:
AttributeError: 'NoneType' object has no attribute 'to_dict'.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question