FileBehaviour
Getting the bytes behind a {@see \Telegram\Parts\File}.
A file_path is valid for at least an hour; after that, call getFile again
with the same file_id for a fresh one.
Tags
Table of Contents
Methods
- download() : PromiseInterface<string|int, string>
- Downloads the file.
- getUrl() : string
- The download URL for this file, bot token included - so do not log it.
- save() : PromiseInterface<string|int, string>
- Downloads the file and writes it to disk.
Methods
download()
Downloads the file.
public
download() : PromiseInterface<string|int, string>
Return values
PromiseInterface<string|int, string> —The file's bytes.
getUrl()
The download URL for this file, bot token included - so do not log it.
public
getUrl() : string
Return values
stringsave()
Downloads the file and writes it to disk.
public
save(string $path) : PromiseInterface<string|int, string>
Parameters
- $path : string
-
Where to write. A directory takes the file's own name.
Return values
PromiseInterface<string|int, string> —The path written to.