Answer the question
In order to leave comments, you need to log in
telebot. How to send a message after clicking a button?
Let's say this code:
def start(message):
markup = types.InlineKeyboardMarkup()
button1 = types.InlineKeyboardButton(text="Самара", callback_data="Самара")
button2 = types.InlineKeyboardButton(text="Москва", callback_data="Москва")
markup.add(button1, button2)
bot.send_message(chat_id=message.chat.id, text="Хде погоду узнать хош?", reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def longname(call):
if call.data == "Самара":
bot.send_message(chat_id=message.chat.id, text="/Нетакважно/")
Answer the question
In order to leave comments, you need to log in
if call.data == 'Город':
bot.send_message(call.message.chat.id, 'тепло там')
And read the trace?
Before throwing a decorator under or over, read what it is and why it is needed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question