29 nl::json json = nl::json::object();
42 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 message was originally sent to a channel chat. https://core.telegram.org/bots/api#messageoriginch...
Ptr< Chat > chat
Channel chat to which the message was originally sent.
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
std::string authorSignature
Optional. Signature of the original post author.
std::int32_t messageId
Unique message identifier inside the chat.
nl::json toJson() const override
Serializes this object to JSON.
MessageOriginChannel(const nl::json &json)
The message was originally sent on behalf of a chat to a group chat. https://core....
Ptr< Chat > senderChat
Chat that sent the message originally.
MessageOriginChat(const nl::json &json)
nl::json toJson() const override
Serializes this object to JSON.
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
std::string authorSignature
Optional. For messages originally sent by an anonymous chat administrator, original message author si...
The message was originally sent by an unknown user. https://core.telegram.org/bots/api#messageoriginh...
nl::json toJson() const override
Serializes this object to JSON.
MessageOriginHiddenUser(const nl::json &json)
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
std::string senderUserName
Name of the user that sent the message originally.
MessageOriginHiddenUser()
This object describes the origin of a message. It can be one of:
std::string type
Type of the message origin, one of "user", "hidden_user", "chat" or "channel".
std::time_t date
Date the message was sent originally in Unix time.
virtual ~MessageOrigin()=default
virtual void fromJson(const nl::json &json)
Deserializes this object from JSON.
virtual nl::json toJson() const
Serializes this object to JSON.
MessageOrigin(const nl::json &json)
The message was originally sent by a known user. https://core.telegram.org/bots/api#messageoriginuser...
nl::json toJson() const override
Serializes this object to JSON.
Ptr< User > senderUser
User that sent the message originally.
MessageOriginUser(const nl::json &json)
void fromJson(const nl::json &json) override
Deserializes this object from JSON.