Telethon/telethon/_misc/hints.py

61 lines
1.3 KiB
Python
Raw Normal View History

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
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]
2022-03-02 14:38:59 +03:00
DialogLike = typing.Union[
Phone,
Username,
PeerID,
_tl.TypePeer,
_tl.TypeInputPeer,
2022-03-02 14:38:59 +03:00
Dialog,
FullDialog
]
2022-03-02 14:56:36 +03:00
DialogsLike = typing.Union[DialogLike, typing.Sequence[DialogLike]]
2021-09-12 17:23:55 +03:00
ButtonLike = typing.Union[_tl.TypeKeyboardButton, _custom.Button]
MarkupLike = typing.Union[
_tl.TypeReplyMarkup,
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]]
LocalPath = str
ExternalUrl = str
BotFileID = str
FileLike = typing.Union[
LocalPath,
ExternalUrl,
BotFileID,
bytes,
typing.BinaryIO,
_tl.TypeMessageMedia,
_tl.TypeInputFile,
_tl.TypeInputFileLocation
]
OutFileLike = typing.Union[
str,
typing.Type[bytes],
typing.BinaryIO
]
MessageLike = typing.Union[str, _tl.Message]
MessageIDLike = typing.Union[int, _tl.Message, _tl.TypeInputMessage]
ProgressCallback = typing.Callable[[int, int], None]