feat(client): expose info about premium users and media
This commit is contained in:
parent
2c3529870a
commit
1ac0cd8530
2 changed files with 17 additions and 0 deletions
|
@ -437,6 +437,18 @@ export class Message {
|
||||||
return this._media!
|
return this._media!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this is a premium media
|
||||||
|
* (e.g. >2gb file or fullscreen sticker)
|
||||||
|
*/
|
||||||
|
get isPremiumMedia(): boolean {
|
||||||
|
return (
|
||||||
|
this.raw._ === 'message' &&
|
||||||
|
this.raw.media?._ === 'messageMediaDocument' &&
|
||||||
|
this.raw.media.nopremium!
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
private _markup?: ReplyMarkup | null
|
private _markup?: ReplyMarkup | null
|
||||||
/**
|
/**
|
||||||
* Reply markup provided with this message, if any.
|
* Reply markup provided with this message, if any.
|
||||||
|
|
|
@ -105,6 +105,11 @@ export class User {
|
||||||
return this.raw.support!
|
return this.raw.support!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Whether this user has Premium subscription */
|
||||||
|
get isPremium(): boolean {
|
||||||
|
return this.raw.premium!
|
||||||
|
}
|
||||||
|
|
||||||
/** User's or bot's first name */
|
/** User's or bot's first name */
|
||||||
get firstName(): string {
|
get firstName(): string {
|
||||||
return this.raw.firstName ?? 'Deleted Account'
|
return this.raw.firstName ?? 'Deleted Account'
|
||||||
|
|
Loading…
Reference in a new issue