2019-05-04 11:21:21 +03:00
|
|
|
import datetime
|
|
|
|
import typing
|
|
|
|
|
2021-09-12 14:27:13 +03:00
|
|
|
from . import helpers
|
|
|
|
from .. import _tl
|
2021-09-12 17:23:55 +03:00
|
|
|
from ..types import _custom
|
2019-05-04 11:21:21 +03:00
|
|
|
|
|
|
|
Phone = str
|
|
|
|
Username = str
|
|
|
|
PeerID = int
|
2022-03-02 14:38:59 +03:00
|
|
|
Dialog = typing.Union[_tl.User, _tl.Chat, _tl.Channel]
|
|
|
|
FullDialog = typing.Union[_tl.UserFull, _tl.messages.ChatFull, _tl.ChatFull, _tl.ChannelFull]
|
2019-05-04 11:21:21 +03:00
|
|
|
|
2022-03-02 14:38:59 +03:00
|
|
|
DialogLike = typing.Union[
|
2019-05-04 11:21:21 +03:00
|
|
|
Phone,
|
|
|
|
Username,
|
|
|
|
PeerID,
|
2021-09-12 13:16:02 +03:00
|
|
|
_tl.TypePeer,
|
|
|
|
_tl.TypeInputPeer,
|
2022-03-02 14:38:59 +03:00
|
|
|
Dialog,
|
|
|
|
FullDialog
|
2019-05-04 11:21:21 +03:00
|
|
|
]
|
2022-03-02 14:56:36 +03:00
|
|
|
DialogsLike = typing.Union[DialogLike, typing.Sequence[DialogLike]]
|
2019-05-04 11:21:21 +03:00
|
|
|
|
2021-09-12 17:23:55 +03:00
|
|
|
ButtonLike = typing.Union[_tl.TypeKeyboardButton, _custom.Button]
|
2019-05-04 11:21:21 +03:00
|
|
|
MarkupLike = typing.Union[
|
2021-09-12 13:16:02 +03:00
|
|
|
_tl.TypeReplyMarkup,
|
2019-05-04 11:21:21 +03:00
|
|
|
ButtonLike,
|
|
|
|
typing.Sequence[ButtonLike],
|
|
|
|
typing.Sequence[typing.Sequence[ButtonLike]]
|
|
|
|
]
|
|
|
|
|
|
|
|
TotalList = helpers.TotalList
|
|
|
|
|
2019-05-04 13:39:48 +03:00
|
|
|
DateLike = typing.Optional[typing.Union[float, datetime.datetime, datetime.date, datetime.timedelta]]
|
2019-05-04 11:21:21 +03:00
|
|
|
|
|
|
|
LocalPath = str
|
|
|
|
ExternalUrl = str
|
|
|
|
BotFileID = str
|
|
|
|
FileLike = typing.Union[
|
|
|
|
LocalPath,
|
|
|
|
ExternalUrl,
|
|
|
|
BotFileID,
|
|
|
|
bytes,
|
2019-05-12 14:07:07 +03:00
|
|
|
typing.BinaryIO,
|
2021-09-12 13:16:02 +03:00
|
|
|
_tl.TypeMessageMedia,
|
|
|
|
_tl.TypeInputFile,
|
|
|
|
_tl.TypeInputFileLocation
|
2019-05-04 11:21:21 +03:00
|
|
|
]
|
|
|
|
|
2022-01-09 15:00:45 +03:00
|
|
|
OutFileLike = typing.Union[
|
|
|
|
str,
|
|
|
|
typing.Type[bytes],
|
|
|
|
typing.BinaryIO
|
|
|
|
]
|
2019-05-04 11:21:21 +03:00
|
|
|
|
2021-09-12 13:16:02 +03:00
|
|
|
MessageLike = typing.Union[str, _tl.Message]
|
|
|
|
MessageIDLike = typing.Union[int, _tl.Message, _tl.TypeInputMessage]
|
2019-05-04 11:21:21 +03:00
|
|
|
|
|
|
|
ProgressCallback = typing.Callable[[int, int], None]
|