Can't get content from method upload.getFile using inputPhotoFileLocation, getting exeption FILE_REFERENCE_EXPIRED, readed lots of forums but cant get answer I'm using MTProto client on js
this.call('upload.getFile', {
location: {
_: 'inputPhotoFileLocation',
id: message.media.photo.id,
access_hash: message.media.photo.access_hash,
file_reference: message.media.photo.file_reference, //tried
//Buffer.from(message.media.photo.file_reference.toString('hex'), 'hex'),
//[...message.media.photo.file_reference] and others
thumb_size: JSON.stringify(message.media.photo.sizes.find(size => size._ == 'photoSizeProgressive'))
},
offset: 0,
limit: 1024 * 1024
})
https://core.telegram.org/constructor/inputPhotoFileLocation
You must pass
type
frommessage.media.photo.sizes
in thethumb_size
fieldThat is, instead of
JSON.stringify(message.media.photo.sizes.find(size => size._ == 'photoSizeProgressive'))
you need to specifymessage.media.photo.sizes.find(size => size._ == 'photoSizeProgressive').type