Raw.PremiumSubscriptionOption

Raw.PremiumSubscriptionOption

Describes a telegram premium subscription option

premiumSubscriptionOption#5f2d1df2 flags:# current:flags.1?true can_purchase_upgrade:flags.2?true transaction:flags.3?string months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumSubscriptionOption;
export namespace Raw {
  export class PremiumSubscriptionOption {
    constructor(params: {
      current?: boolean;
      canPurchaseUpgrade?: boolean;
      transaction?: string;
      months: number;
      currency: string;
      amount: bigint;
      botUrl: string;
      storeProduct?: string;
    }) {}
  }
}
🚫

This is a types constructor, you can’t use it as method when call invoke.

Layer: 185
Constructor ID: 0x5f2d1df2

Property

  • current : boolean or undefined

    Whether this subscription option is currently in use.

  • canPurchaseUpgrade : boolean or undefined

    Whether this subscription option can be used to upgrade the existing telegram premium subscription. when upgrading telegram premium subscriptions bought through stores, make sure that the store transaction id is equal to transaction, to avoid upgrading someone else’s account, if the client is currently logged into multiple accounts.

  • transaction : string or undefined

    Identifier of the last in-store transaction for the currently used subscription on the current account.

  • months : number

    Duration of subscription in months

  • currency : string

    Three-letter iso 4217 currency code

  • amount : bigint

    Total price in the smallest units of the currency (integer, not float/double). for example, for a price of us 1.45 pass amount = 145. see the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

  • botUrl : string

    Deep link used to initiate payment

  • storeProduct : string or undefined

    Store product id, only for official apps