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

# GiveawayWinners

class telegram.GiveawayWinners(chat, giveaway_message_id, winners_selection_date, winner_count, winners, additional_chat_count=None, premium_subscription_month_count=None, unclaimed_prize_count=None, only_new_members=None, was_refunded=None, prize_description=None, *, api_kwargs=None)

  Bases: `telegram.TelegramObject`

  This object represents a message about the completion of a giveaway with public winners.

  Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their `chat`, `giveaway_message_id`, `winners_selection_date`, `winner_count` and `winners` are equal.

  Available In

  - `telegram.ExternalReplyInfo.giveaway_winners`

  - `telegram.Message.giveaway_winners`

  New in version 20.8.

  Parameters:

    - chat (`telegram.Chat`) – The chat that created the giveaway

    - giveaway_message_id (`int`) – Identifier of the message with the giveaway in the chat

    - winners_selection_date (`datetime.datetime`) – Point in time when winners of the giveaway were selected. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    - winner_count (`int`) – Total number of winners in the giveaway

    - winners (Sequence[`telegram.User`]) – List of up to `100` winners of the giveaway

    - additional_chat_count (`int`, optional) – The number of other chats the user had to join in order to be eligible for the giveaway

    - premium_subscription_month_count (`int`, optional) – The number of months the Telegram Premium subscription won from the giveaway will be active for

    - unclaimed_prize_count (`int`, optional) – Number of undistributed prizes

    - only_new_members (`True`, optional) – `True`, if only users who had joined the chats after the giveaway started were eligible to win

    - was_refunded (`True`, optional) – `True`, if the giveaway was canceled because the payment for it was refunded

    - prize_description (`str`, optional) – Description of additional giveaway prize

  chat

    The chat that created the giveaway

    Type:

      `telegram.Chat`

  giveaway_message_id

    Identifier of the message with the giveaway in the chat

    Type:

      `int`

  winners_selection_date

    Point in time when winners of the giveaway were selected. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    Type:

      `datetime.datetime`

  winner_count

    Total number of winners in the giveaway

    Type:

      `int`

  winners

    tuple of up to `100` winners of the giveaway

    Type:

      Tuple[`telegram.User`]

  additional_chat_count

    Optional. The number of other chats the user had to join in order to be eligible for the giveaway

    Type:

      `int`

  premium_subscription_month_count

    Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for

    Type:

      `int`

  unclaimed_prize_count

    Optional. Number of undistributed prizes

    Type:

      `int`

  only_new_members

    Optional. `True`, if only users who had joined the chats after the giveaway started were eligible to win

    Type:

      `True`

  was_refunded

    Optional. `True`, if the giveaway was canceled because the payment for it was refunded

    Type:

      `True`

  prize_description

    Optional. Description of additional giveaway prize

    Type:

      `str`

  classmethod de_json(data, bot)

    See `telegram.TelegramObject.de_json`.