Answer the question
In order to leave comments, you need to log in
How to understand where the command came from in the telegram bot?
Hello everyone, I couldn't find the answer in Google, so I came here.
Bottom line: I'm trying to create a bot for an online store using tlebot. Screwed the keyboard to the product:
def last_choise():
choise_key = types.InlineKeyboardMarkup(row_width=1)
c1 = types.InlineKeyboardButton(text='Добавить в корзину', callback_data='add_in_basket')
c2 = types.InlineKeyboardButton(text='Корзина', callback_data='basket')
c3 = types.InlineKeyboardButton(text='Назад', callback_data='back1')
choise_key.add(c1, c2, c3)
return choise_key
elif call.data == 'add_in_basket':
bot.answer_callback_query(callback_query_id=call.id,
text="Товар добавлен в корзину", show_alert=True)
bot.delete_message(call.message.chat.id, call.message.message_id, timeout=10)
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