@dp.message_handler(state=filterimg.photo, content_types="document")
async def edit(msg: types.Message, state: FSMContext):
async with state.proxy() as edits_photo:
edits_photo["photo"]=msg.document.file_id
os.chdir("bot/edit_photo")
file_id=edits_photo["photo"]
k=(await bot.download_file_by_id(file_id))
img = Image.open(k)
img = img.filter(ImageFilter.CONTOUR)
img.save(str(num) + ".jpg")
img.show()
await state.finish()
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])