async def list_orders(message):
cur.execute("SELECT * FROM orders WHERE userId=?", (message.from_user.id,))
user = cur.fetchone()
if user:
await message.answer(text=f'Order #{user[2]}\n'
'Open!\n\n'
f'{user[3]}')
async def list_orders(message):
cur.execute("SELECT * FROM orders WHERE userId=?", (message.from_user.id,))
users = cur.fetchall()
if users != list():
return await message.answer("Ничего нет")
text = '\n'.join([f'Order #{user[2}\nOpen!\n\n{user[3]}' for user in users])
return await message.answer(text=text)