InputInvoicePremiumGiftCode

class pyrogram.raw.types.InputInvoicePremiumGiftCode

Used if the user wishes to start a channel/supergroup giveaway or send some giftcodes to members of a channel/supergroup, in exchange for boosts.

Constructor of InputInvoice.

Details:
  • Layer: 223

  • ID: 98986C0D

Parameters:
  • purpose (InputStorePaymentPurpose) – Should be populated with inputStorePaymentPremiumGiveaway for giveaways and inputStorePaymentPremiumGiftCode for gifts.

  • option (PremiumGiftCodeOption) – Should be populated with one of the giveaway options returned by payments.getPremiumGiftCodeOptions, see the giveaways » documentation for more info.

TL Schema

inputInvoicePremiumGiftCode#98986c0d
purpose:InputStorePaymentPurpose
option:PremiumGiftCodeOption

= InputInvoice

Parameter Tree

InputInvoicePremiumGiftCode
├── purposeInputStorePaymentPurpose
│ │ ├── restoretrue (optional)
│ │ └── upgradetrue (optional)
│ │ ├── user_idInputUser
│ │ │ ├── InputUserEmpty
│ │ │ ├── InputUserSelf
│ │ │ ├── InputUser
│ │ │ └── InputUserFromMessage
│ │ ├── currencystring
│ │ └── amountlong
│ │ ├── usersVector < InputUser >
│ │ │ ├── InputUserEmpty
│ │ │ ├── InputUserSelf
│ │ │ ├── InputUser
│ │ │ │ ├── user_idlong
│ │ │ │ └── access_hashlong
│ │ │ └── InputUserFromMessage
│ │ │ ├── peerInputPeer
│ │ │ │ ├── InputPeerEmpty
│ │ │ │ ├── InputPeerSelf
│ │ │ │ ├── InputPeerChat
│ │ │ │ ├── InputPeerUser
│ │ │ │ ├── InputPeerChannel
│ │ │ │ ├── InputPeerUserFromMessage
│ │ │ │ └── InputPeerChannelFromMessage
│ │ │ ├── msg_idint
│ │ │ └── user_idlong
│ │ ├── boost_peerInputPeer (optional)
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── currencystring
│ │ ├── amountlong
│ │ └── messageTextWithEntities (optional)
│ │ └── TextWithEntities
│ │ ├── textstring
│ │ └── entitiesVector < MessageEntity >
│ │ ├── MessageEntityUnknown
│ │ ├── MessageEntityMention
│ │ ├── MessageEntityHashtag
│ │ ├── MessageEntityBotCommand
│ │ ├── MessageEntityUrl
│ │ ├── MessageEntityEmail
│ │ ├── MessageEntityBold
│ │ ├── MessageEntityItalic
│ │ ├── MessageEntityCode
│ │ ├── MessageEntityPre
│ │ ├── MessageEntityTextUrl
│ │ ├── MessageEntityMentionName
│ │ ├── MessageEntityPhone
│ │ ├── MessageEntityCashtag
│ │ ├── MessageEntityUnderline
│ │ ├── MessageEntityStrike
│ │ ├── MessageEntityBankCard
│ │ ├── MessageEntitySpoiler
│ │ ├── MessageEntityCustomEmoji
│ │ ├── MessageEntityBlockquote
│ │ └── MessageEntityFormattedDate
│ │ ├── only_new_subscriberstrue (optional)
│ │ ├── winners_are_visibletrue (optional)
│ │ ├── boost_peerInputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── additional_peersVector < InputPeer > (optional)
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ │ ├── user_idlong
│ │ │ │ └── access_hashlong
│ │ │ ├── InputPeerChannel
│ │ │ │ ├── channel_idlong
│ │ │ │ └── access_hashlong
│ │ │ ├── InputPeerUserFromMessage
│ │ │ │ ├── peerInputPeer
│ │ │ │ │ ├── InputPeerEmpty
│ │ │ │ │ ├── InputPeerSelf
│ │ │ │ │ ├── InputPeerChat
│ │ │ │ │ ├── InputPeerUser
│ │ │ │ │ ├── InputPeerChannel
│ │ │ │ │ ├── InputPeerUserFromMessage
│ │ │ │ │ └── InputPeerChannelFromMessage
│ │ │ │ ├── msg_idint
│ │ │ │ └── user_idlong
│ │ │ └── InputPeerChannelFromMessage
│ │ │ ├── peerInputPeer
│ │ │ │ ├── InputPeerEmpty
│ │ │ │ ├── InputPeerSelf
│ │ │ │ ├── InputPeerChat
│ │ │ │ ├── InputPeerUser
│ │ │ │ ├── InputPeerChannel
│ │ │ │ ├── InputPeerUserFromMessage
│ │ │ │ └── InputPeerChannelFromMessage
│ │ │ ├── msg_idint
│ │ │ └── channel_idlong
│ │ ├── countries_iso2Vector < string > (optional)
│ │ ├── prize_descriptionstring (optional)
│ │ ├── random_idlong
│ │ ├── until_dateint
│ │ ├── currencystring
│ │ └── amountlong
│ │ ├── starslong
│ │ ├── currencystring
│ │ ├── amountlong
│ │ └── spend_purpose_peerInputPeer (optional)
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ │ ├── user_idInputUser
│ │ │ ├── InputUserEmpty
│ │ │ ├── InputUserSelf
│ │ │ ├── InputUser
│ │ │ └── InputUserFromMessage
│ │ ├── starslong
│ │ ├── currencystring
│ │ └── amountlong
│ │ ├── only_new_subscriberstrue (optional)
│ │ ├── winners_are_visibletrue (optional)
│ │ ├── starslong
│ │ ├── boost_peerInputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── additional_peersVector < InputPeer > (optional)
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ │ ├── user_idlong
│ │ │ │ └── access_hashlong
│ │ │ ├── InputPeerChannel
│ │ │ │ ├── channel_idlong
│ │ │ │ └── access_hashlong
│ │ │ ├── InputPeerUserFromMessage
│ │ │ │ ├── peerInputPeer
│ │ │ │ │ ├── InputPeerEmpty
│ │ │ │ │ ├── InputPeerSelf
│ │ │ │ │ ├── InputPeerChat
│ │ │ │ │ ├── InputPeerUser
│ │ │ │ │ ├── InputPeerChannel
│ │ │ │ │ ├── InputPeerUserFromMessage
│ │ │ │ │ └── InputPeerChannelFromMessage
│ │ │ │ ├── msg_idint
│ │ │ │ └── user_idlong
│ │ │ └── InputPeerChannelFromMessage
│ │ │ ├── peerInputPeer
│ │ │ │ ├── InputPeerEmpty
│ │ │ │ ├── InputPeerSelf
│ │ │ │ ├── InputPeerChat
│ │ │ │ ├── InputPeerUser
│ │ │ │ ├── InputPeerChannel
│ │ │ │ ├── InputPeerUserFromMessage
│ │ │ │ └── InputPeerChannelFromMessage
│ │ │ ├── msg_idint
│ │ │ └── channel_idlong
│ │ ├── countries_iso2Vector < string > (optional)
│ │ ├── prize_descriptionstring (optional)
│ │ ├── random_idlong
│ │ ├── until_dateint
│ │ ├── currencystring
│ │ ├── amountlong
│ │ └── usersint
│ ├── restoretrue (optional)
│ ├── phone_numberstring
│ ├── phone_code_hashstring
│ ├── currencystring
│ └── amountlong
└── optionPremiumGiftCodeOption
├── usersint
├── monthsint
├── store_productstring (optional)
├── store_quantityint (optional)
├── currencystring
└── amountlong

Example

InputInvoicePremiumGiftCode(
    purpose=InputStorePaymentPremiumSubscription(),
    option=PremiumGiftCodeOption(
        users=0,
        months=0,
        currency="text",
        amount=0
    ),
)