Answer the question
In order to leave comments, you need to log in
How to abort bot.register_next_step_handler() execution?
Well, it doesn’t work on my own ... (
If I don’t send a comment, the bot is waiting for user input, after pressing the inline button I Confirm ..
input_comment = bot.edit_message_text(chat_id = message.chat.id, message_id = message.message_id, text = f'*{message.chat.last_name} {message.chat.first_name}*,'\
f' Вы подтверждаете заказ (см. выше) на сумму {conn_DB.summ()} руб. ({zakaz[0].lower()})? Напишите и отправьте комментарий (по желанию).', parse_mode = "Markdown", reply_markup = buttons.keyb_finish)
def save_input_comment(message):
print(message.text)
if message.text is not None:
zakaz.append(message.text) #Добавляю комментарий в список zakaz
else: zakaz.append(' ') #для пустого комментария
bot.register_next_step_handler(input_comment, save_input_comment)
if choose_finish == 'Подтверждаю':
insert_Klient = tuple([f'{message.chat.first_name} {message.chat.last_name}', number[0]])
conn_DB.phinish(insert_Klient, tuple(delivery), zakaz)
def send_mess(mess):
bot.edit_message_text(chat_id = message.chat.id, message_id = message.message_id, text = f'Ваш заказ *№ {conn_DB.id_Zakaz()}* сформирован! '
f'{mess}.\n Напишите И отправьте комментарий (по желанию).\n Спасибо за заказ, *ожидайте звонка* \U0001f4de.', parse_mode = "Markdown", reply_markup = '')
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