telegram.utils.types Module

This module contains custom typing aliases.

telegram.utils.types.ConversationDict = typing.Dict[typing.Tuple[int, ...], typing.Union[object, NoneType]]

Dicts as maintained by the telegram.ext.ConversationHandler.

telegram.utils.types.FileInput = typing.Union[str, typing.IO, ForwardRef('InputFile'), pathlib.Path]

Valid input for passing files to Telegram. Either a file id as string, a file like object or a local file path as string or pathlib.Path.

telegram.utils.types.FileLike = typing.Union[typing.IO, ForwardRef('InputFile')]

Either an open file handler or a telegram.InputFile.

telegram.utils.types.HandlerArg = typing.Union[str, ForwardRef('Update')]

The argument that handlers parse for telegram.ext.handler.check_update() etc.

telegram.utils.types.JSONDict = typing.Dict[str, typing.Any]

Dictionary containing response from Telegram or data to send to the API.

telegram.utils.types.SLT = typing.Union[~RT, typing.List[~RT], typing.Tuple[~RT, ...]]

Single instance or list/tuple of instances.