Skip to content

Commit 71c90af

Browse files
feat: FormattedText.__str__
Closes #300
1 parent 1af91b1 commit 71c90af

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

pyrogram/types/messages_and_media/formatted_text.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020

2121
import pyrogram
2222
from pyrogram import enums, raw, types, utils
23-
24-
from ..object import Object
2523
from pyrogram.types.messages_and_media.message import Str
2624

25+
from ..object import Object
2726

2827

2928
class FormattedText(Object):
@@ -43,7 +42,7 @@ class FormattedText(Object):
4342
def __init__(
4443
self,
4544
*,
46-
text: str,
45+
text: Str,
4746
parse_mode: Optional["enums.ParseMode"] = None,
4847
entities: Optional[List["types.MessageEntity"]] = None,
4948
):
@@ -53,6 +52,9 @@ def __init__(
5352
self.parse_mode = parse_mode
5453
self.entities = entities
5554

55+
def __str__(self) -> str:
56+
return self.text
57+
5658
@staticmethod
5759
def _parse(client: "pyrogram.Client", text: "raw.types.TextWithEntities") -> "FormattedText":
5860
if not isinstance(text, raw.types.TextWithEntities):

0 commit comments

Comments
 (0)