Base File¶
- class bale.BaseFile(file_id, file_unique_id, file_size, **kwargs)¶
Bases:
BaleObject
This object shows a Base File Class.
- file_unique_id¶
Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.
- Type:
Note
You can get more information from the file with
BaseFile.kwargs_data
.- async get()¶
For the documentation of the arguments, please see
bale.Bot.get_file()
.
- async save_to_memory(out)¶
Download this file into memory. out needs to be supplied with a
io.BufferedIOBase
, the file contents will be saved to that object using theio.BufferedIOBase.write()
method.- Parameters:
out (
io.BinaryIO
) – A file-like object. Must be opened for writing in binary mode.
- to_input_file()¶
Converts the file to a standard object for sending/uploading it. This object is require in the file sending methods.
- Returns:
The
bale.InputFile
Object for send.- Return type: