upload.getFile 处的 FILE_REFERENCE_EXPIRED 与 inputPhotoFileLocation
无法使用 inputPhotoFileLocation 从方法 upload.getFile 获取内容,获取异常 FILE_REFERENCE_EXPIRED,阅读了很多论坛但无法得到答案 我在 js 上使用 MTProto 客户端
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
})
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
})
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
https://core.telegram.org/constructor/inputPhotoFileLocation
您必须在
thumb_size
字段中传递来自message.media.photo.sizes
的type
也就是说,您需要指定
message.media,而不是
JSON.stringify(message.media.photo.sizes.find(size => size._ == 'photoSizeProgressive'))
.photo.sizes.find(size => size._ == 'photoSizeProgressive').typehttps://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