def qiwi_to_uzcard_check_rubl(message): lang = template[MemberInfo(message.chat.id).get_lang()] key = inline_keyboard_creator(message, ['pay_cancel']) if message.text.strip().isdigit() and 100 <= float( message.text.strip()) and float(message.text.strip()) <= 7000: rubl = float(message.text) sum = round(rubl * float(rates[1]), 1) data = MemberInfo(message.chat.id, rubl=rubl, sum=sum) data.add_summa_rubl_uzs() return True elif message.text.strip().isdigit() and float(message.text.strip()) < 100: msg = bot.send_message(message.chat.id, lang['min_rubl_error'], reply_markup=key, parse_mode='html') bot.register_next_step_handler(msg, after_qiwi_to_uzcard_from_qiwi) elif message.text.strip().isdigit() and float(message.text.strip()) > 7000: msg = bot.send_message(message.chat.id, lang['max_rubl_error'], reply_markup=key, parse_mode='html') bot.register_next_step_handler(msg, after_qiwi_to_uzcard_from_qiwi) else: msg = bot.send_message(message.chat.id, lang['rubl_error'], reply_markup=key, parse_mode='html') bot.register_next_step_handler(msg, after_qiwi_to_uzcard_from_qiwi)
def uzcard_to_qiwi_check_sum(message): lang = template[MemberInfo(message.chat.id).get_lang()] key = inline_keyboard_creator(message, ['pay_cancel']) if message.text.strip().isdigit() and 15000 <= int( message.text.strip()) and int(message.text.strip()) <= 1000000: sum = int(message.text) rubl = round(sum / float(rates[0]), 1) data = MemberInfo(message.chat.id, rubl=rubl, sum=sum) data.add_summa_rubl_uzs() return True elif message.text.strip().isdigit() and int(message.text.strip()) < 15000: msg = bot.send_message(message.chat.id, lang['min_sum_error'], reply_markup=key, parse_mode='html') bot.register_next_step_handler(msg, after_uzcard_to_qiwi_from_uzcard) elif message.text.strip().isdigit() and int( message.text.strip()) > 1000000: msg = bot.send_message(message.chat.id, lang['max_sum_error'], reply_markup=key, parse_mode='html') bot.register_next_step_handler(msg, after_uzcard_to_qiwi_from_uzcard) else: msg = bot.send_message(message.chat.id, lang['sum_error'], reply_markup=key, parse_mode='html') bot.register_next_step_handler(msg, after_uzcard_to_qiwi_from_uzcard)