feat(client): inputPhoto getter for Photo

This commit is contained in:
teidesu 2021-07-02 17:10:57 +03:00
parent 23bc4b5e30
commit 14d2f9ff08

View file

@ -156,6 +156,18 @@ export class Photo extends FileLocation {
return this._uniqueFileId
}
/**
* Input photo generated from this object.
*/
get inputPhoto(): tl.TypeInputPhoto {
return {
_: 'inputPhoto',
id: this.raw.id,
accessHash: this.raw.accessHash,
fileReference: this.raw.fileReference,
}
}
/**
* Input media generated from this object,
* to be used in {@link InputMediaLike} and
@ -164,12 +176,7 @@ export class Photo extends FileLocation {
get inputMedia(): tl.TypeInputMedia {
return {
_: 'inputMediaPhoto',
id: {
_: 'inputPhoto',
id: this.raw.id,
accessHash: this.raw.accessHash,
fileReference: this.raw.fileReference,
},
id: this.inputPhoto
}
}
}