25 nl::json json = nl::json::object();
35 void _fromJson(
const nl::json& json) {
#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.
The background is taken directly from a built-in chat theme. https://core.telegram....
void fromJson(const nl::json &json) override
nl::json toJson() const override
std::string themeName
Name of the chat theme, which is usually an emoji.
BackgroundTypeChatTheme()
BackgroundTypeChatTheme(const nl::json &json)
The background is automatically filled based on the selected colors. https://core....
Ptr< BackgroundFill > fill
The background fill.
std::int32_t darkThemeDimming
Dimming of the background in dark themes, as a percentage; 0-100.
void fromJson(const nl::json &json) override
nl::json toJson() const override
BackgroundTypeFill(const nl::json &json)
This object describes the type of a background. It can be one of:
virtual void fromJson(const nl::json &json)
virtual nl::json toJson() const
BackgroundType(const nl::json &json)
virtual ~BackgroundType()=default
std::string type
Type of the background, one of "fill", "wallpaper", "pattern", "chat_theme".
The background is a PNG or TGV pattern combined with a fill. https://core.telegram....
Ptr< Document > document
Document with the pattern.
bool isMoving
Optional. True, if the background moves slightly when the device is tilted.
void fromJson(const nl::json &json) override
Ptr< BackgroundFill > fill
The background fill that is combined with the pattern.
nl::json toJson() const override
BackgroundTypePattern(const nl::json &json)
std::int32_t intensity
Intensity of the pattern when it is shown above the filled background; 0-100.
bool isInverted
Optional. True, if the background fill must be applied only to the pattern itself....
The background is a wallpaper in JPEG format. https://core.telegram.org/bots/api#backgroundtypewallpa...
bool isMoving
Optional. True, if the background moves slightly when the device is tilted.
BackgroundTypeWallpaper()
void fromJson(const nl::json &json) override
std::int32_t darkThemeDimming
Dimming of the background in dark themes, as a percentage; 0-100.
nl::json toJson() const override
bool isBlurred
Optional. True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with r...
Ptr< Document > document
Document with the wallpaper.
BackgroundTypeWallpaper(const nl::json &json)