diff --git a/README.md b/README.md index 374e98b40..8e9fd5e98 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@
A simple, but extensible Python implementation for the Telegram Bot API.
Both synchronous and asynchronous.
-##Supported Bot API version:
+##
. + + Telegram documentation: https://core.telegram.org/bots/api#richblockparagraph + + :param type: Type of the block, always “paragraph” + :type type: :obj:`str` + + :param text: Text of the block + :type text: :class:`RichText` + + :return: Instance of the class + :rtype: :class:`RichBlockParagraph` + """ + def __init__(self, text: RichText, **kwargs): + super().__init__(type='paragraph', **kwargs) + self.text: RichText = text + + @classmethod + def de_json(cls, json_string): + if json_string is None: return None + obj = cls.check_json(json_string) + obj['text'] = RichText.de_json(obj['text']) + return cls(**obj) + + +class RichBlockSectionHeading(RichBlock): + """ + A section heading, corresponding to the HTML tags
and .
+
+ Telegram documentation: https://core.telegram.org/bots/api#richblockpreformatted
+
+ :param type: Type of the block, always “pre”
+ :type type: :obj:`str`
+
+ :param text: Text of the block
+ :type text: :class:`RichText`
+
+ :param language: Optional. The programming language of the text
+ :type language: :obj:`str`
+
+ :return: Instance of the class
+ :rtype: :class:`RichBlockPreformatted`
+ """
+ def __init__(self, text: RichText, language: Optional[str] = None, **kwargs):
+ super().__init__(type='pre', **kwargs)
+ self.text: RichText = text
+ self.language: Optional[str] = language
+
+ @classmethod
+ def de_json(cls, json_string):
+ if json_string is None: return None
+ obj = cls.check_json(json_string)
+ obj['text'] = RichText.de_json(obj['text'])
+ return cls(**obj)
+
+
+class RichBlockFooter(RichBlock):
+ """
+ A footer, corresponding to the HTML tag