24 enum class Type : std::uint8_t {
29 inline static constexpr
const char *
Type2Str[] = {
"regular",
"mask",
"custom_emoji"};
34 return static_cast<Type>(i);
37 throw Exception(
"Could not convert Sticker type string \"" + str +
"\" to enum Type");
85 nl::json json = nl::json::object();
#define OBJECT_SERIALIZE_FIELD_PTR(json, json_field, field)
#define OBJECT_DESERIALIZE_FIELD_PTR(json, json_field, field, optional)
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
This object represents a sticker. https://core.telegram.org/bots/api#sticker.
Type type
Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is i...
static constexpr const char * Type2Str[]
std::string emoji
Optional. Emoji associated with the sticker.
bool isVideo
True, if the sticker is a video sticker.
std::string fileUniqueId
Unique identifier for this file, which is supposed to be the same over time and for different bots....
Sticker(const nl::json &json)
Type
Enum of possible types of a Sticker.
std::int64_t fileSize
Optional. File size in bytes.
std::int32_t height
Sticker height.
bool needsRepainting
Optional. True, if the sticker must be repainted to a text color in messages, the color of the Telegr...
static constexpr Type Str2Type(const std::string &str)
void fromJson(const nl::json &json)
Deserializes this object from JSON.
std::string customEmojiId
Optional. For custom emoji stickers, unique identifier of the custom emoji.
std::string setName
Optional. Name of the sticker set to which the sticker belongs.
std::int32_t width
Sticker width.
Ptr< File > premiumAnimation
Optional. For premium regular stickers, premium animation for the sticker.
nl::json toJson() const
Serializes this object to JSON.
std::string fileId
Identifier for this file, which can be used to download or reuse the file.
Ptr< MaskPosition > maskPosition
Optional. For mask stickers, the position where the mask should be placed.
bool isAnimated
True, if the sticker is animated.
Ptr< PhotoSize > thumbnail
Optional. Sticker thumbnail in the .WEBP or .JPG format.