Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# ChatBoostSource

New in version 20.8.

class telegram.ChatBoostSource(source, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  Base class for Telegram ChatBoostSource objects. It can be one of:

  - `telegram.ChatBoostSourcePremium`

  - `telegram.ChatBoostSourceGiftCode`

  - `telegram.ChatBoostSourceGiveaway`

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `source` is equal.

  Available In

  - `telegram.ChatBoost.source`

  - `telegram.ChatBoostRemoved.source`

  New in version 20.8.

  Parameters:

    source (`str`) – The source of the chat boost. Can be one of: `PREMIUM`, `GIFT_CODE`, or `GIVEAWAY`.

  source

    The source of the chat boost. Can be one of: `PREMIUM`, `GIFT_CODE`, or `GIVEAWAY`.

    Type:

      `str`

  GIFT_CODE = 'gift_code'

    `telegram.constants.ChatBoostSources.GIFT_CODE`

  GIVEAWAY = 'giveaway'

    `telegram.constants.ChatBoostSources.GIVEAWAY`

  PREMIUM = 'premium'

    `telegram.constants.ChatBoostSources.PREMIUM`

  classmethod de_json(data, bot)

    See `telegram.TelegramObject.de_json()`.