tgbotxx 1.2.9.5
Telegram Bot C++ Library
Loading...
Searching...
No Matches
ForumTopicCreated.hpp
Go to the documentation of this file.
1#pragma once
3
4namespace tgbotxx {
8 ForumTopicCreated() = default;
9 explicit ForumTopicCreated(const nl::json& json) {
11 }
12
14 std::string name;
15
17 std::int32_t iconColor{};
18
20 std::string iconCustomEmojiId;
21
24
25
28 nl::json toJson() const {
29 nl::json json = nl::json::object();
32 OBJECT_SERIALIZE_FIELD(json, "icon_custom_emoji_id", iconCustomEmojiId);
33 OBJECT_SERIALIZE_FIELD(json, "is_name_implicit", isNameImplicit);
34 return json;
35 }
36
38 void fromJson(const nl::json& json) {
39 OBJECT_DESERIALIZE_FIELD(json, "name", name, "", false);
40 OBJECT_DESERIALIZE_FIELD(json, "icon_color", iconColor, 0, false);
41 OBJECT_DESERIALIZE_FIELD(json, "icon_custom_emoji_id", iconCustomEmojiId, "", true);
42 OBJECT_DESERIALIZE_FIELD(json, "is_name_implicit", isNameImplicit, false, true);
43 }
44 };
45}
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Serialize.
Definition Object.hpp:27
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
Definition Object.hpp:64
std::shared_ptr< T > Ptr
Definition Ptr.hpp:6
This object represents a service message about a new forum topic created in the chat....
std::string iconCustomEmojiId
Optional. Unique identifier of the custom emoji shown as the topic icon.
bool isNameImplicit
Optional. True, if the name of the topic wasn't specified explicitly by its creator and likely needs ...
nl::json toJson() const
Serializes this object to JSON.
std::string name
Name of the topic.
void fromJson(const nl::json &json)
Deserializes this object from JSON.
ForumTopicCreated(const nl::json &json)
std::int32_t iconColor
Color of the topic icon in RGB format.