InputFile¶
- class litegram.types.input_file.InputFile(filename: str | None = None, chunk_size: int = 65536)[исходный код]¶
This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.
Source: https://core.telegram.org/bots/api#inputfile
- abstractmethod async read(bot: Bot) AsyncGenerator[bytes][исходный код]¶
- class litegram.types.input_file.BufferedInputFile(file: bytes, filename: str, chunk_size: int = 65536)[исходный код]¶
- classmethod from_file(path: str | Path, filename: str | None = None, chunk_size: int = 65536) BufferedInputFile[исходный код]¶
Create buffer from file
- Параметры:
path – Path to file
filename – Filename to be propagated to telegram. By default, will be parsed from path
chunk_size – Uploading chunk size
- Результат:
instance of
BufferedInputFile
- async read(bot: Bot) AsyncGenerator[bytes][исходный код]¶
- class litegram.types.input_file.FSInputFile(path: str | Path, filename: str | None = None, chunk_size: int = 65536)[исходный код]¶
- async read(bot: Bot) AsyncGenerator[bytes][исходный код]¶