Fix registration button handling and add debug logging
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
- Improve btn_registration handler to directly set state instead of creating fake callback
- Add /register command handler for registration
- Add text-based registration triggers ('регистрация', 'регистр', 'register')
- Add debug logging to handle_start to track registration status
- Ensure registration button is shown correctly for unregistered users
This commit is contained in:
@@ -35,6 +35,9 @@ class BotController(IBotController):
|
||||
async def handle_start(self, message: Message):
|
||||
"""Обработать команду /start"""
|
||||
from src.utils.keyboards import get_main_reply_keyboard
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
user = await self.user_service.get_or_create_user(
|
||||
telegram_id=message.from_user.id,
|
||||
@@ -43,6 +46,9 @@ class BotController(IBotController):
|
||||
last_name=message.from_user.last_name
|
||||
)
|
||||
|
||||
# Логирование статуса регистрации
|
||||
logger.info(f"User {message.from_user.id}: is_registered={user.is_registered}, is_admin={self.is_admin(message.from_user.id)}")
|
||||
|
||||
welcome_text = f"👋 Добро пожаловать, {user.first_name or 'дорогой пользователь'}!\n\n"
|
||||
welcome_text += "🎲 Это бот для участия в розыгрышах.\n\n"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user