File¶
- class bale.File(file_type, file_id, file_size, mime_type, bot, **kwargs)¶
Bases:
object
This object shows a Base File Class.
Note
You can get more information from the file with extra.
- 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:
- property type¶
a Shortcut for use
bale.File.file_type
- Type: