Refactor captcha response handling in check_captcha function

- Removed the deletion of the original message upon correct captcha response.
- Changed the method of sending the captcha text and markup from edit_text to answer for better user experience.
This commit is contained in:
Zakhar Izmaylov
2025-01-20 22:31:14 +03:00
parent a9e111bd4f
commit 1459bdacfa
+1 -2
View File
@@ -64,13 +64,12 @@ async def check_captcha(
if selected_emoji == correct_emoji:
logger.info(f"Пользователь {callback.message.chat.id} успешно прошел капчу")
await callback.message.delete()
await start_command(callback.message, state, session, admin)
else:
logger.warning(
f"Пользователь {callback.message.chat.id} неверно ответил на капчу"
)
captcha = await generate_captcha(state)
await callback.message.edit_text(
await callback.message.answer(
text=captcha["text"], reply_markup=captcha["markup"]
)