tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
tgbotxx::Giveaway Struct Reference

This object represents a message about a scheduled giveaway. https://core.telegram.org/bots/api#giveaway. More...

#include <Giveaway.hpp>

Public Member Functions

 Giveaway ()=default
 
 Giveaway (const nl::json &json)
 
nl::json toJson () const
 Serializes this object to JSON.
 
void fromJson (const nl::json &json)
 Deserializes this object from JSON.
 

Public Attributes

std::vector< Ptr< Chat > > chats
 The list of chats which the user must join to participate in the giveaway.
 
std::time_t winnersSelectionDate {}
 Point in time (Unix timestamp) when winners of the giveaway will be selected.
 
std::int32_t winnerCount {}
 The number of users which are supposed to be selected as winners of the giveaway.
 
bool onlyNewMembers {}
 Optional. True, if only users who join the chats after the giveaway started should be eligible to win.
 
bool hasPublicWinners {}
 Optional. True, if the list of giveaway winners will be visible to everyone.
 
std::string prizeDescription
 Optional. Description of additional giveaway prize.
 
std::vector< std::string > countryCodes
 Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. 3166-1 alpha-2: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 .
 
std::int64_t prizeStarCount {}
 Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only.
 
std::int32_t premiumSubscriptionMonthCount {}
 Optional. The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only.
 

Detailed Description

This object represents a message about a scheduled giveaway. https://core.telegram.org/bots/api#giveaway.

Definition at line 8 of file Giveaway.hpp.

Constructor & Destructor Documentation

◆ Giveaway() [1/2]

tgbotxx::Giveaway::Giveaway ( )
default

◆ Giveaway() [2/2]

tgbotxx::Giveaway::Giveaway ( const nl::json &  json)
inlineexplicit

Definition at line 10 of file Giveaway.hpp.

Member Function Documentation

◆ fromJson()

void tgbotxx::Giveaway::fromJson ( const nl::json &  json)
inline

Deserializes this object from JSON.

Definition at line 61 of file Giveaway.hpp.

◆ toJson()

nl::json tgbotxx::Giveaway::toJson ( ) const
inline

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 46 of file Giveaway.hpp.

Member Data Documentation

◆ chats

std::vector<Ptr<Chat> > tgbotxx::Giveaway::chats

The list of chats which the user must join to participate in the giveaway.

Definition at line 15 of file Giveaway.hpp.

◆ countryCodes

std::vector<std::string> tgbotxx::Giveaway::countryCodes

Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways. 3166-1 alpha-2: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 .

Definition at line 36 of file Giveaway.hpp.

◆ hasPublicWinners

bool tgbotxx::Giveaway::hasPublicWinners {}

Optional. True, if the list of giveaway winners will be visible to everyone.

Definition at line 27 of file Giveaway.hpp.

◆ onlyNewMembers

bool tgbotxx::Giveaway::onlyNewMembers {}

Optional. True, if only users who join the chats after the giveaway started should be eligible to win.

Definition at line 24 of file Giveaway.hpp.

◆ premiumSubscriptionMonthCount

std::int32_t tgbotxx::Giveaway::premiumSubscriptionMonthCount {}

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

Definition at line 42 of file Giveaway.hpp.

◆ prizeDescription

std::string tgbotxx::Giveaway::prizeDescription

Optional. Description of additional giveaway prize.

Definition at line 30 of file Giveaway.hpp.

◆ prizeStarCount

std::int64_t tgbotxx::Giveaway::prizeStarCount {}

Optional. The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only.

Definition at line 39 of file Giveaway.hpp.

◆ winnerCount

std::int32_t tgbotxx::Giveaway::winnerCount {}

The number of users which are supposed to be selected as winners of the giveaway.

Definition at line 21 of file Giveaway.hpp.

◆ winnersSelectionDate

std::time_t tgbotxx::Giveaway::winnersSelectionDate {}

Point in time (Unix timestamp) when winners of the giveaway will be selected.

Definition at line 18 of file Giveaway.hpp.


The documentation for this struct was generated from the following file: