if call.data == 'back5': bot.send_message(call.message.chat.id, text='Выберите категорию товара:', reply_markup=markup2) current_time = datetime.datetime.now() time_deference = current_time - start_time if call.data == 'otm' and time_deference.total_seconds() < 10: bot.send_message(call.message.chat.id, text='Заказ отменен❌', reply_markup=markup3_1) bot.send_message(my_chat_id, text=f'{frname} Отменил заказ...') elif time_deference.total_seconds() >= 10: bot.send_message(call.message.chat.id, text='Извините, но заказ нельзя отменить позднее 10 минут?♂️')
кусочек кода: