Skip to content

Commit

Permalink
Added decorations for custom emoji (suppressed on server side)
Browse files Browse the repository at this point in the history
  • Loading branch information
JrooTJunior committed Aug 13, 2022
1 parent 11d2e6f commit e7b58e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aiogram/utils/text_decorations.py
Expand Up @@ -182,7 +182,7 @@ def quote(self, value: str) -> str:
return html.escape(value, quote=False)

def custom_emoji(self, value: str, custom_emoji_id: str) -> str:
return value
return f'<tg-emoji emoji-id="{custom_emoji_id}">{value}</tg-emoji>'


class MarkdownDecoration(TextDecoration):
Expand Down Expand Up @@ -219,7 +219,7 @@ def quote(self, value: str) -> str:
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()
Expand Down

0 comments on commit e7b58e4

Please sign in to comment.