async def next_find_questionnaire(message: types.Message, state: FSMContext):
if message.text == like.text:
async with state.proxy() as data:
if is_liked(message.from_user.id, data['user']):
await bot.send_message(message.from_user.id, f'{tfind1}')
else:
add_to_like_list(message.from_user.id, message.from_user.username, data['user'])
await bot.send_message(data['user'], f'{tfind2}')
related_users = get_related_users(message.from_user.id)
user_questionnaire = random.choice(related_users)
data['user'] = user_questionnaire.user_id
await bot.send_photo(
message.chat.id,
user_questionnaire.photo,
caption=f'''{user_questionnaire.about}''',
reply_markup=fbuttons)
if message.text == like_with_message.text:
async with state.proxy() as data:
if is_liked(message.from_user.id, data['user']):
await bot.send_message(message.from_user.id, f'{tfind1}')
else:
await FSMFind.next()
await bot.send_message(
message.from_user.id,
f'{tfind3}',
reply_markup=ReplyKeyboardRemove()
)
if message.text == dislike.text:
related_users = get_related_users(message.from_user.id)
user_questionnaire = random.choice(related_users)
async with state.proxy() as data:
data['user'] = user_questionnaire.user_id
await bot.send_photo(
message.chat.id,
user_questionnaire.photo,
caption=f'''{user_questionnaire.about}''',
reply_markup=fbuttons)
if message.text == complain.text:
await bot.send_message(message.from_user.id, f'{tfind4}')
related_users = get_related_users(message.from_user.id)
user_questionnaire = random.choice(related_users)
async with state.proxy() as data:
await send_report(data["user"], message.from_user.username)
data['user'] = user_questionnaire.user_id
await bot.send_photo(
message.chat.id,
user_questionnaire.photo,
caption=f'''{user_questionnaire.about}''',
reply_markup=fbuttons)
if message.text == exit_query.text:
await state.finish()
await FSMMenu.status.set()
await bot.send_message(message.from_user.id, f'{tfind5}', reply_markup=main_manu_buttons)