-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About download messageSender's file #107
Comments
when you listen updates, you can get catch updateType "updateNewMessage", update new message has Message.Content. Message Content has a few types: messageText, messagePhoto and so on. MessagePhoto has Photo. This is your file |
they are the basis info, not the body bytes |
Have you tried |
yes, this return the *File which containes only basis info, no |
// Represents a file
type File struct {
meta
// Unique file identifier
Id int32 `json:"id"`
// File size, in bytes; 0 if unknown
Size int64 `json:"size"`
// Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress
ExpectedSize int64 `json:"expected_size"`
// Information about the local copy of the file
Local *LocalFile `json:"local"`
// Information about the remote copy of the file
Remote *RemoteFile `json:"remote"`
}
// Represents a local file
type LocalFile struct {
meta
// Local path to the locally available file part; may be empty
Path string `json:"path"`
// True, if it is possible to download or generate the file
CanBeDownloaded bool `json:"can_be_downloaded"`
// True, if the file can be deleted
CanBeDeleted bool `json:"can_be_deleted"`
// True, if the file is currently being downloaded (or a local copy is being generated by some other means)
IsDownloadingActive bool `json:"is_downloading_active"`
// True, if the local copy is fully available
IsDownloadingCompleted bool `json:"is_downloading_completed"`
// Download will be started from this offset. downloaded_prefix_size is calculated from this offset
DownloadOffset int64 `json:"download_offset"`
// If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes
DownloadedPrefixSize int64 `json:"downloaded_prefix_size"`
// Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage
DownloadedSize int64 `json:"downloaded_size"`
} we have |
look @af913337456
file.Local.Path - it's your path file. It's located here |
I am looking for how to download the images in the picture message sent to me by the other party. As for the voice in the voice message. I looked at the function and it doesn't seem to be present. Currently, the "ReadFilePart" function can download its own files. But it seems that the sender cannot download it. Did I miss it? Can you give me some guidance, thank you.
@dezi
The text was updated successfully, but these errors were encountered: