mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
This commit is contained in:
parent
875f37f780
commit
d5bd0b98a3
4 changed files with 4 additions and 3 deletions
1
CHANGES/1782.bugfix.rst
Normal file
1
CHANGES/1782.bugfix.rst
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed ``HtmlDecoration.custom_emoji()`` to use the correct ``emoji-id`` attribute name instead of ``emoji_id`` in the ``<tg-emoji>`` tag, matching the Telegram Bot API specification.
|
||||
|
|
@ -265,7 +265,7 @@ class HtmlDecoration(TextDecoration):
|
|||
return html.escape(value, quote=False)
|
||||
|
||||
def custom_emoji(self, value: str, custom_emoji_id: str) -> str:
|
||||
return self._tag(self.EMOJI_TAG, value, attrs={"emoji_id": custom_emoji_id})
|
||||
return self._tag(self.EMOJI_TAG, value, attrs={"emoji-id": custom_emoji_id})
|
||||
|
||||
def blockquote(self, value: str) -> str:
|
||||
return self._tag(self.BLOCKQUOTE_TAG, value)
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ class TestNode:
|
|||
],
|
||||
[
|
||||
CustomEmoji("test", custom_emoji_id="42"),
|
||||
'<tg-emoji emoji_id="42">test</tg-emoji>',
|
||||
'<tg-emoji emoji-id="42">test</tg-emoji>',
|
||||
],
|
||||
[
|
||||
BlockQuote("test"),
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class TestTextDecoration:
|
|||
[
|
||||
html_decoration,
|
||||
MessageEntity(type="custom_emoji", offset=0, length=5, custom_emoji_id="42"),
|
||||
'<tg-emoji emoji_id="42">test</tg-emoji>',
|
||||
'<tg-emoji emoji-id="42">test</tg-emoji>',
|
||||
],
|
||||
[
|
||||
html_decoration,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue