mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Beta 3 (#884)
* Rework middlewares, separate management to `MiddlewareManager` class * Rework middlewares * Added changes description for redis * Added changes description for redis * Fixed tests with Redis // aioredis replacement * Changed msg.<html/md>_text attributes behaviour * Added changelog for spoilers * Added possibility to get command magic result as handler arguments
This commit is contained in:
parent
930bca0876
commit
286cf39c8a
51 changed files with 1380 additions and 804 deletions
|
|
@ -71,7 +71,7 @@ if TYPE_CHECKING:
|
|||
from .voice_chat_started import VoiceChatStarted
|
||||
|
||||
|
||||
class Message(TelegramObject):
|
||||
class _BaseMessage(TelegramObject):
|
||||
"""
|
||||
This object represents a message.
|
||||
|
||||
|
|
@ -195,6 +195,8 @@ class Message(TelegramObject):
|
|||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons."""
|
||||
|
||||
|
||||
class Message(_BaseMessage):
|
||||
@property
|
||||
def content_type(self) -> str:
|
||||
if self.text:
|
||||
|
|
@ -265,11 +267,8 @@ class Message(TelegramObject):
|
|||
return ContentType.UNKNOWN
|
||||
|
||||
def _unparse_entities(self, text_decoration: TextDecoration) -> str:
|
||||
text = self.text or self.caption
|
||||
if text is None:
|
||||
raise TypeError("This message doesn't have any text.")
|
||||
|
||||
entities = self.entities or self.caption_entities
|
||||
text = self.text or self.caption or ""
|
||||
entities = self.entities or self.caption_entities or []
|
||||
return text_decoration.unparse(text=text, entities=entities)
|
||||
|
||||
@property
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue