async def kypit(message : types.Message):
a = await sqlite_db2.pok1()
b = await sqlite_db2.pok2()
if a - b < 0:
await bot.send_message(message.from_user.id, f'Недостаточно средств')
Из БД:
async def pok1():
return cur.execute('SELECT money FROM users').fetchall()
async def pok2():
return cur.execute('SELECT SUM(price) FROM korzina').fetchall()