tgbotxx  1.1.6.9
Telegram Bot C++ Library
tgbotxx::Sticker Struct Reference

This object represents a sticker. https://core.telegram.org/bots/api#sticker. More...

#include <Sticker.hpp>

Public Types

enum class  Type : std::uint8_t { Regular = 0 , Mask , CustomEmoji }
 Enum of possible types of a Sticker. More...
 

Public Member Functions

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

Static Public Member Functions

static constexpr Type Str2Type (const std::string &str)
 

Public Attributes

std::string fileId
 Identifier for this file, which can be used to download or reuse the file. More...
 
std::string fileUniqueId
 Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. More...
 
Type type {}
 Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. More...
 
std::int32_t width {}
 Sticker width. More...
 
std::int32_t height {}
 Sticker height. More...
 
bool isAnimated {}
 True, if the sticker is animated. More...
 
bool isVideo {}
 True, if the sticker is a video sticker. More...
 
Ptr< PhotoSizethumbnail
 Optional. Sticker thumbnail in the .WEBP or .JPG format. More...
 
std::string emoji
 Optional. Emoji associated with the sticker. More...
 
std::string setName
 Optional. Name of the sticker set to which the sticker belongs. More...
 
Ptr< FilepremiumAnimation
 Optional. For premium regular stickers, premium animation for the sticker. More...
 
Ptr< MaskPositionmaskPosition
 Optional. For mask stickers, the position where the mask should be placed. More...
 
std::string customEmojiId
 Optional. For custom emoji stickers, unique identifier of the custom emoji. More...
 
bool needsRepainting {}
 Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places. More...
 
std::int64_t fileSize {}
 Optional. File size in bytes. More...
 

Static Public Attributes

static constexpr const char * Type2Str [] = {"regular", "mask", "custom_emoji"}
 

Detailed Description

This object represents a sticker. https://core.telegram.org/bots/api#sticker.

Definition at line 10 of file Sticker.hpp.

Member Enumeration Documentation

◆ Type

enum tgbotxx::Sticker::Type : std::uint8_t
strong

Enum of possible types of a Sticker.

Enumerator
Regular 
Mask 
CustomEmoji 

Definition at line 24 of file Sticker.hpp.

Constructor & Destructor Documentation

◆ Sticker() [1/2]

tgbotxx::Sticker::Sticker ( )
default

◆ Sticker() [2/2]

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

Definition at line 12 of file Sticker.hpp.

Member Function Documentation

◆ fromJson()

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

Deserializes this object from JSON.

Definition at line 105 of file Sticker.hpp.

◆ Str2Type()

static constexpr Type tgbotxx::Sticker::Str2Type ( const std::string &  str)
inlinestaticconstexpr

Definition at line 30 of file Sticker.hpp.

◆ toJson()

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

Serializes this object to JSON.

Returns
JSON representation of this object

Definition at line 84 of file Sticker.hpp.

Member Data Documentation

◆ customEmojiId

std::string tgbotxx::Sticker::customEmojiId

Optional. For custom emoji stickers, unique identifier of the custom emoji.

Definition at line 71 of file Sticker.hpp.

◆ emoji

std::string tgbotxx::Sticker::emoji

Optional. Emoji associated with the sticker.

Definition at line 59 of file Sticker.hpp.

◆ fileId

std::string tgbotxx::Sticker::fileId

Identifier for this file, which can be used to download or reuse the file.

Definition at line 17 of file Sticker.hpp.

◆ fileSize

std::int64_t tgbotxx::Sticker::fileSize {}

Optional. File size in bytes.

Definition at line 79 of file Sticker.hpp.

◆ fileUniqueId

std::string tgbotxx::Sticker::fileUniqueId

Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

Definition at line 21 of file Sticker.hpp.

◆ height

std::int32_t tgbotxx::Sticker::height {}

Sticker height.

Definition at line 47 of file Sticker.hpp.

◆ isAnimated

bool tgbotxx::Sticker::isAnimated {}

True, if the sticker is animated.

Definition at line 50 of file Sticker.hpp.

◆ isVideo

bool tgbotxx::Sticker::isVideo {}

True, if the sticker is a video sticker.

Definition at line 53 of file Sticker.hpp.

◆ maskPosition

Ptr<MaskPosition> tgbotxx::Sticker::maskPosition

Optional. For mask stickers, the position where the mask should be placed.

Definition at line 68 of file Sticker.hpp.

◆ needsRepainting

bool tgbotxx::Sticker::needsRepainting {}

Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places.

Definition at line 76 of file Sticker.hpp.

◆ premiumAnimation

Ptr<File> tgbotxx::Sticker::premiumAnimation

Optional. For premium regular stickers, premium animation for the sticker.

Definition at line 65 of file Sticker.hpp.

◆ setName

std::string tgbotxx::Sticker::setName

Optional. Name of the sticker set to which the sticker belongs.

Definition at line 62 of file Sticker.hpp.

◆ thumbnail

Ptr<PhotoSize> tgbotxx::Sticker::thumbnail

Optional. Sticker thumbnail in the .WEBP or .JPG format.

Definition at line 56 of file Sticker.hpp.

◆ type

Type tgbotxx::Sticker::type {}

Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.

Definition at line 41 of file Sticker.hpp.

◆ Type2Str

constexpr const char* tgbotxx::Sticker::Type2Str[] = {"regular", "mask", "custom_emoji"}
inlinestaticconstexpr

Definition at line 29 of file Sticker.hpp.

◆ width

std::int32_t tgbotxx::Sticker::width {}

Sticker width.

Definition at line 44 of file Sticker.hpp.


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