Add missing shortcuts, new enums, reworked old stuff (#1070)

* Render shortcuts

* Render docs

* Added enumerations

* Added docs

* Use enums, removed Helper

* Bump butcher

* Added InputMediaType enum

* Added MaskPositionPoint, InlineQueryResultType enums

* Update texts

* Added StickerType enum

* Cover tests

* Update docs

* Fixed imports

* Re-enabled all pre-commit hooks
This commit is contained in:
Alex Root Junior 2022-12-04 03:05:49 +02:00 committed by GitHub
parent 3438d2446d
commit 3ea73fbbbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
370 changed files with 19735 additions and 8380 deletions

View file

@ -175,10 +175,6 @@ T = TypeVar("T")
class Bot(ContextInstanceMixin["Bot"]):
"""
Bot class
"""
def __init__(
self,
token: str,
@ -186,6 +182,8 @@ class Bot(ContextInstanceMixin["Bot"]):
parse_mode: Optional[str] = None,
) -> None:
"""
Bot class
:param token: Telegram Bot token `Obtained from @BotFather <https://t.me/BotFather>`_
:param session: HTTP Client session (For example AiohttpSession).
If not specified it will be automatically created.
@ -234,6 +232,11 @@ class Bot(ContextInstanceMixin["Bot"]):
self.reset_current(token)
async def me(self) -> User:
"""
Cached alias for getMe method
:return:
"""
if self._me is None: # pragma: no cover
self._me = await self.get_me()
return self._me