diff --git a/apps/telegram-bot/commands.py b/apps/telegram-bot/commands.py index eed7b09..5fc705b 100644 --- a/apps/telegram-bot/commands.py +++ b/apps/telegram-bot/commands.py @@ -775,10 +775,15 @@ async def _find_user_id_by_username( ctx: ContextTypes.DEFAULT_TYPE, username: str ) -> int | None: """Find user_id by username using Telegram API.""" + import logging + + log = logging.getLogger(__name__) try: chat = await ctx.bot.get_chat(f"@{username}") + log.info(f"Found user {username}: {chat.id}") return chat.id - except Exception: + except Exception as e: + log.error(f"Failed to find user @{username}: {e}") return None