diff --git a/aiogram/utils/text_decorations.py b/aiogram/utils/text_decorations.py index b7a8ae86..00686f7a 100644 --- a/aiogram/utils/text_decorations.py +++ b/aiogram/utils/text_decorations.py @@ -137,6 +137,10 @@ class TextDecoration(ABC): def underline(self, value: str) -> str: # pragma: no cover pass + @abstractmethod + def underline(self, value: str) -> str: # pragma: no cover + pass + @abstractmethod def strikethrough(self, value: str) -> str: # pragma: no cover pass @@ -145,6 +149,10 @@ class TextDecoration(ABC): def quote(self, value: str) -> str: # pragma: no cover pass + @abstractmethod + def blockquote(self, value: str) -> str: #pragma: no cover + return f"
{value}" + @abstractmethod def custom_emoji(self, value: str, custom_emoji_id: str) -> str: # pragma: no cover pass @@ -178,6 +186,9 @@ class HtmlDecoration(TextDecoration): def strikethrough(self, value: str) -> str: return f"
{value}" + def quote(self, value: str) -> str: return html.escape(value, quote=False) @@ -215,6 +226,9 @@ class MarkdownDecoration(TextDecoration): def strikethrough(self, value: str) -> str: return f"~{value}~" + def blockquote(self, value: str) -> str: + return f">{value}" + def quote(self, value: str) -> str: return re.sub(pattern=self.MARKDOWN_QUOTE_PATTERN, repl=r"\\\1", string=value)