Telegram — Download a message's media
Input
peerId requiredThe conversation's peer id, as returned by get_inbox (e.g. "8591421602" for Saved Messages; negative ids are channels and groups).
messageId requiredThe message carrying the media, as returned by get_conversation or send_message. Must be one of the recently loaded messages in that conversation — get_conversation only loads a recent window, so raise its count until the target is present.
Output
kind requiredWhich bubble shape it was read from: "document" for a file bubble (a filename and size are shown in the chat), "media" for a photo or video bubble.
base64 requiredThe file's bytes, base64-encoded — the exact inverse of send_message's fileBase64, so a file can be round-tripped between conversations. Documents come back byte-for-byte identical to what was sent.
peerId requiredThe peer id that was actually opened, read back from the address bar.
filename requiredThe name Telegram saves the file under, taken from its own download action rather than guessed. For a document this is the original filename; for a photo it is Telegram's generated name (e.g. "5793955541833946033.jpg").
messageId requiredThe message the media came from.
byteLength requiredSize of the returned bytes. For a document this matches the size shown on the bubble; for a photo it is the size of Telegram's re-encoded copy, which will not match the original upload.
verified_on_page requiredTrue when the bytes were actually captured from the app's own download action, rather than the click being assumed to have worked.
mimeType optionalThe MIME type Telegram attached to the blob it saved, or null if it did not set one.
chatTitle optionalThe conversation title from the header — echo this to a human, since a peer id is not recognisable.
