@dp.message_handler(commands=['n'])
async def cmd_start(message: types.Message, state: FSMContext):
c.execute(f"""SELECT * FROM all_category WHERE rowid > 0""")
items = c.fetchall()
for el in items:
await message.answer(el[0])
async def users_data(msg: types.Message):
conn=sql.connect('bot/db/usersBot.db')
cursor=conn.cursor()
user = msg.from_user
cursor.execute("SELECT * FROM users WHERE user_id=?", (user.id,))
data = cursor.fetchone()
return data
А если нужно вывести то сделайте так
data=await users_data(msg)
await msg.answer(data[0])