mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-06 07:50:32 +00:00
Added decorations for custom emoji (suppressed on server side)
This commit is contained in:
parent
11d2e6f31a
commit
e7b58e4938
1 changed files with 2 additions and 2 deletions
|
|
@ -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'<tg-emoji emoji-id="{custom_emoji_id}">{value}</tg-emoji>'
|
||||
|
||||
|
||||
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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue