From e7b58e4938056affdc13e60e31cc4c3bdaaa6815 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sat, 13 Aug 2022 23:38:38 +0300 Subject: [PATCH] Added decorations for custom emoji (suppressed on server side) --- aiogram/utils/text_decorations.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index a62c0b94..b7a8ae86 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -182,7 +182,7 @@ class HtmlDecoration(TextDecoration): return html.escape(value, quote=False) def custom_emoji(self, value: str, custom_emoji_id: str) -> str: - return value + return f'{value}' class MarkdownDecoration(TextDecoration): @@ -219,7 +219,7 @@ class MarkdownDecoration(TextDecoration): return re.sub(pattern=self.MARKDOWN_QUOTE_PATTERN, repl=r"\\\1", string=value) def custom_emoji(self, value: str, custom_emoji_id: str) -> str: - return value + return self.link(value=value, link=f"tg://emoji?id={custom_emoji_id}") html_decoration = HtmlDecoration()