@bot.message_handler(content_types=["text"])
def handle_text(message):
keyboardmain = types.InlineKeyboardMarkup(row_width=2)
first_button = types.InlineKeyboardButton(text="Youtube", callback_data="first")
second_button = types.InlineKeyboardButton(text="Twitter", callback_data="second")
keyboardmain.add(first_button, second_button)
bot.send_message(message.chat.id, "Select ", reply_markup=keyboardmain)
@bot.callback_query_handler(func=lambda call: True)
def handle_text(call, message=None):
if call.data == "first":
keyboard = types.InlineKeyboardMarkup()
rele1 = types.InlineKeyboardButton(text="Оставьте отзыв", callback_data="3")
backbutton = types.InlineKeyboardButton(text="back", callback_data="a")
keyboard.add(rele1, backbutton)
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id,
text="Текст",
reply_markup=keyboard)
msg = "Пользователь {} написал \"{}\".".format(message.chat.id, message.messag_id)
bot.send_message('-100000000000', msg)
Выдает ошибку:
File "C:/Users/99455/PycharmProjects/untitled3/main.py", line 67, in handle_text
msg = "Пользователь {} написал \"{}\".".format(message.chat.id, message.messag_id)
AttributeError: 'NoneType' object has no attribute 'chat'