R
R
Ruslan Mordovanech2021-11-24 22:14:23
Python
Ruslan Mordovanech, 2021-11-24 22:14:23

If the entered data does not match the base True or False?

@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()


How can I check if the data doesn't match?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-11-24
@Hery1

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:
        # не совпадают

Is this what is meant

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question