From b50eb1bafb31aeee6cff6e7781ba5e7c7bfbbf1a Mon Sep 17 00:00:00 2001 From: EskiSlav Date: Fri, 17 Jul 2020 13:43:45 +0300 Subject: [PATCH] Added nested entities from Bot API 4.5 --- telebot/types.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/telebot/types.py b/telebot/types.py index cb98b9f..7660b80 100644 --- a/telebot/types.py +++ b/telebot/types.py @@ -479,8 +479,11 @@ class Message(JsonDeserializable): "pre" : "
{text}
", "code" : "{text}", #"url" : "{text}", # @badiboy plain URLs have no text and do not need tags - "text_link": "{text}" - } + "text_link": "{text}", + "strikethrough": "{text}", + "underline": "{text}" + } + if hasattr(self, "custom_subs"): for key, value in self.custom_subs.items(): _subs[key] = value @@ -511,8 +514,7 @@ class Message(JsonDeserializable): html_text += func(utf16_text[offset * 2 : (offset + entity.length) * 2], entity.type, entity.url, entity.user) offset += entity.length else: - # TODO: process nested entities from Bot API 4.5 - # Now ignoring them + # For future entities pass if offset * 2 < len(utf16_text): html_text += func(utf16_text[offset * 2:])