@dp.message_handler(state=GetUserInfo.waiting_for_user_idd, content_types=types.ContentTypes.TEXT)
async def surname_handler(message: types.Message, state: FSMContext):
d = message.text
for i in corr:
if i['number'] == d:
news = f"<b>{i['date']}</b>\n" \
f"{i['judge']}\n" \
f"{i['forma']}\n" \
f"{i['number']}\n" \
f"<b>{i['involved']}</b>\n" \
f"{i['description']}\n"
await bot.send_message(message.from_user.id, news)
await state.finish()
for i in corr:
if i['number'] == d:
news = f"<b>{i['date']}</b>\n" \
f"{i['judge']}\n" \
f"{i['forma']}\n" \
f"{i['number']}\n" \
f"<b>{i['involved']}</b>\n" \
f"{i['description']}\n"
await bot.send_message(message.from_user.id, news)
await state.finish()
break
else:
# не совпадают