Answer the question
In order to leave comments, you need to log in
Telebot - How to implement receiving messages with callback_data?
Made inline buttons in the telegram bot:
@bot.callback_query_handler(func = lambda call: True)
def print_all_commands(call):
if call.data == 'print_all_commands':
markup = types.InlineKeyboardMarkup()
btn_command = types.InlineKeyboardButton("❗Как тебя зовут?", callback_data="commands")
markup.add(btn_command)
bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text="Выберите действие:", reply_markup=markup)
elif call.data == "kick":
@bot.message_handler(content_types = ["text"])
def kick_text(message):
bot.send_message(message.chat.id, "Введите, то, что вам надо:")
Answer the question
In order to leave comments, you need to log in
Learn how to use register_next_step_handler
Example
Essentially this is an implementation of waiting for input from the user.
Through callback_query_handler you catch the button click, and then you process this click with register_next_step_handler
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question