GiveawayWinners constructor

const GiveawayWinners({
  1. @JsonKey(name: 'chat') required Chat chat,
  2. @JsonKey(name: 'giveaway_message_id') required int giveawayMessageId,
  3. @JsonKey(name: 'winners_selection_date') required int winnersSelectionDate,
  4. @JsonKey(name: 'winner_count') required int winnerCount,
  5. @JsonKey(name: 'winners') required List<User> winners,
  6. @JsonKey(name: 'additional_chat_count') int? additionalChatCount,
  7. @JsonKey(name: 'premium_subscription_month_count') int? premiumSubscriptionMonthCount,
  8. @JsonKey(name: 'unclaimed_prize_count') int? unclaimedPrizeCount,
  9. @JsonKey(name: 'only_new_members') bool? onlyNewMembers,
  10. @JsonKey(name: 'was_refunded') bool? wasRefunded,
  11. @JsonKey(name: 'prize_description') String? prizeDescription,
  12. @JsonKey(name: 'prize_star_count') int? prizeStarCount,
})

Constructor

Implementation

const factory GiveawayWinners({
  /// The chat that created the giveaway
  @JsonKey(name: 'chat') required Chat chat,

  /// Identifier of the messsage with the giveaway in the chat
  @JsonKey(name: 'giveaway_message_id') required int giveawayMessageId,

  /// Point in time (Unix timestamp) when winners of the giveaway were
  /// selected
  @JsonKey(name: 'winners_selection_date') required int winnersSelectionDate,

  /// Total number of winners in the giveaway
  @JsonKey(name: 'winner_count') required int winnerCount,

  /// List of up to 100 winners of the giveaway
  @JsonKey(name: 'winners') required List<User> winners,

  /// The number of other chats the user had to join in order to be eligible
  /// for the giveaway
  @JsonKey(name: 'additional_chat_count') int? additionalChatCount,

  /// The number of months the Telegram Premium subscription won from the
  /// giveaway will be active for
  @JsonKey(name: 'premium_subscription_month_count')
  int? premiumSubscriptionMonthCount,

  /// Number of undistributed prizes
  @JsonKey(name: 'unclaimed_prize_count') int? unclaimedPrizeCount,

  /// True, if only users who had joined the chats after the giveaway started
  /// were eligible to win
  @JsonKey(name: 'only_new_members') bool? onlyNewMembers,

  /// True, if the giveaway was canceled because the payment for it was
  /// refunded
  @JsonKey(name: 'was_refunded') bool? wasRefunded,

  /// Description of additional giveaway prize
  @JsonKey(name: 'prize_description') String? prizeDescription,

  /// Optional. The number of Telegram Stars to be split between giveaway
  /// winners; for Telegram Star giveaways only
  @JsonKey(name: 'prize_star_count') int? prizeStarCount,
}) = _GiveawayWinners;