fix(client): improved inspection
This commit is contained in:
parent
274a05dc9e
commit
58f73b6709
7 changed files with 16 additions and 8 deletions
|
@ -48,4 +48,4 @@ export class Audio extends RawDocument {
|
|||
}
|
||||
}
|
||||
|
||||
makeInspectable(Audio, ['fileSize', 'dcId'], ['inputMedia'])
|
||||
makeInspectable(Audio, ['fileSize', 'dcId'], ['inputMedia', 'inputDocument'])
|
||||
|
|
|
@ -171,4 +171,4 @@ export class RawDocument extends FileLocation {
|
|||
*/
|
||||
export class Document extends RawDocument {}
|
||||
|
||||
makeInspectable(Document, ['fileSize', 'dcId'], ['inputMedia'])
|
||||
makeInspectable(Document, ['fileSize', 'dcId'], ['inputMedia', 'inputDocument'])
|
||||
|
|
|
@ -112,6 +112,13 @@ export class Sticker extends RawDocument {
|
|||
return this.attr.stickerset._ === 'inputStickerSetID'
|
||||
}
|
||||
|
||||
/**
|
||||
* Input sticker set that it associated with this sticker, if available.
|
||||
*/
|
||||
get inputStickerSet(): tl.TypeInputStickerSet | null {
|
||||
return this.attr.stickerset._ === 'inputStickerSetEmpty' ? null : this.attr.stickerset
|
||||
}
|
||||
|
||||
private _maskPosition?: Sticker.MaskPosition
|
||||
/**
|
||||
* Position where this mask should be placed
|
||||
|
@ -158,4 +165,4 @@ export class Sticker extends RawDocument {
|
|||
}
|
||||
}
|
||||
|
||||
makeInspectable(Sticker, ['fileSize', 'dcId'], ['inputMedia'])
|
||||
makeInspectable(Sticker, ['fileSize', 'dcId'], ['inputMedia', 'inputDocument'])
|
||||
|
|
|
@ -88,4 +88,4 @@ export class Video extends RawDocument {
|
|||
}
|
||||
}
|
||||
|
||||
makeInspectable(Video, ['fileSize', 'dcId'], ['inputMedia'])
|
||||
makeInspectable(Video, ['fileSize', 'dcId'], ['inputMedia', 'inputDocument'])
|
||||
|
|
|
@ -39,4 +39,4 @@ export class Voice extends RawDocument {
|
|||
}
|
||||
}
|
||||
|
||||
makeInspectable(Voice, ['fileSize', 'dcId'], ['inputMedia'])
|
||||
makeInspectable(Voice, ['fileSize', 'dcId'], ['inputMedia', 'inputDocument'])
|
||||
|
|
|
@ -179,4 +179,4 @@ export class ChatPhoto {
|
|||
}
|
||||
}
|
||||
|
||||
makeInspectable(ChatPhoto)
|
||||
makeInspectable(ChatPhoto, [], ['thumb'])
|
||||
|
|
|
@ -56,10 +56,11 @@ export function makeInspectable(
|
|||
getters.forEach((it) => {
|
||||
try {
|
||||
let val = this[it]
|
||||
if (
|
||||
if (Buffer.isBuffer(val)) {
|
||||
val = val.toString('base64')
|
||||
} else if (
|
||||
val &&
|
||||
typeof val === 'object' &&
|
||||
!Buffer.isBuffer(val) &&
|
||||
typeof val.toJSON === 'function'
|
||||
) {
|
||||
val = val.toJSON()
|
||||
|
|
Loading…
Reference in a new issue