Add type hints to all public methods in the client

This commit is contained in:
Lonami Exo
2019-05-03 21:37:27 +02:00
parent c0e506e568
commit cd4b915522
16 changed files with 393 additions and 159 deletions

View File

@@ -1,11 +1,18 @@
import typing
from .updates import UpdateMethods
from .. import utils, hints
from ..tl import types, custom
from .. import utils, events
if typing.TYPE_CHECKING:
from .telegramclient import TelegramClient
class ButtonMethods(UpdateMethods):
@staticmethod
def build_reply_markup(buttons, inline_only=False):
def build_reply_markup(
self: 'TelegramClient',
buttons: typing.Optional[hints.MarkupLike],
inline_only: bool = False) -> typing.Optional[types.TypeReplyMarkup]:
"""
Builds a :tl`ReplyInlineMarkup` or :tl:`ReplyKeyboardMarkup` for
the given buttons, or does nothing if either no buttons are