diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index ae9af7d4..b162109f 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -147,6 +147,9 @@ class TextDecoration(ABC): class HtmlDecoration(TextDecoration): def link(self, value: str, link: str) -> str: return f'{value}' + + def user_link(self, value: str, user_id: int) -> str: + return link(value, f"tg://openmessage?user_id={user_id}") def bold(self, value: str) -> str: return f"{value}" @@ -181,6 +184,9 @@ class MarkdownDecoration(TextDecoration): def link(self, value: str, link: str) -> str: return f"[{value}]({link})" + + def user_link(self, value: str, user_id: int) -> str: + return link(value, f"tg://openmessage?user_id={user_id}") def bold(self, value: str) -> str: return f"*{value}*"