From cc56f11f8093fb491536188ec4b9e04a65753bf6 Mon Sep 17 00:00:00 2001 From: Verum Date: Sun, 2 Mar 2025 22:42:55 +0700 Subject: [PATCH] =?UTF-8?q?1.8=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D0=B2=D1=81=D1=82=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D1=8F=D1=82=D1=8C=20=D1=81=D1=81=D1=8B=D0=BB=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20=D0=B8=D0=BC=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BotLibrary/validators/username.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BotLibrary/validators/username.py b/BotLibrary/validators/username.py index 47faf8a..96c0dd3 100644 --- a/BotLibrary/validators/username.py +++ b/BotLibrary/validators/username.py @@ -4,7 +4,7 @@ from aiogram.types import Message # Настройка экспорта из модуля -__all__ = ("username",) +__all__ = ("username", "username_to_text") # Функция получения юзера или ID пользователя def username(message: Message) -> str: @@ -17,3 +17,8 @@ def username(message: Message) -> str: if message.from_user: return f"@{message.from_user.username}" if message.from_user.username else f"@{message.from_user.id}" return "@Unknown_User" # Если from_user отсутствует + + +# Функция получение имени пользователя + ссылка на него +def username_to_text(message: Message) -> str: + return f'{message.from_user.full_name}'