telegram.utils.types Module

This module contains custom typing aliases.


Dicts as maintained by the telegram.ext.ConversationHandler.

alias of Dict[Tuple[int, …], Optional[object]]


Generic type for bot method parameters which can have defaults. DVInput[type] is the same as Union[DefaultValue, type].

alias of Union[DefaultValue[DVType], DVType]


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

alias of Union[str, bytes, IO, InputFile, pathlib.Path]


Either an open file handler or a telegram.InputFile.

alias of Union[IO, InputFile]


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

alias of Dict[str, Any]


Generic type for bot method parameters which can have defaults. ODVInput[type] is the same as Optional[Union[DefaultValue, type]].

alias of Optional[Union[DefaultValue[DVType], DVType]]


Single instance or list/tuple of instances.

alias of Union[RT, List[RT], Tuple[RT, …]]