@dp.message_handler(state=di.stavka)
async def stavka_money(message: types.Message, state: FSMContext):
if is_number(message.text) and message.text != '0' and type(message.text) != 'str':
answer = message.text
await state.update_data(stavka = answer)
data = await state.get_data()
ss = data.get('stavka')
db.create_stavka(message.from_user.id, answer)
if int(db.user_balance(message.from_user.id))<int(db.check_stavka(message.from_user.id)):
await bot.send_message(message.from_user.id,'Недостаточно средств',reply_markup = nav.playy)
await state.finish()
await bot.send_message(message.from_user.id, f'Твоя ставка -- {db.check_stavka(message.from_user.id)}. Играем!\n\n Я начинаю)',reply_markup = ReplyKeyboardRemove())
if int(db.user_balance(message.from_user.id)):
await bot.send_message(message.from_user.id,'Недостаточно средств',reply_markup = nav.playy)
return
await state.finish()
await bot.send_message(message.from_user.id, f'Твоя ставка -- {db.check_stavka(message.from_user.id)}. Играем!\n\n Я начинаю)',reply_markup = ReplyKeyboardRemove())
if int(db.user_balance(message.from_user.id)):
await bot.send_message(message.from_user.id,'Недостаточно средств',reply_markup = nav.playy)
else:
await state.finish()
await bot.send_message(message.from_user.id, f'Твоя ставка -- {db.check_stavka(message.from_user.id)}. Играем!\n\n Я начинаю)',reply_markup = ReplyKeyboardRemove())