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:
+1
-2
@@ -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"]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user