tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
tgbotxx::MessageOrigin Struct Reference

This object describes the origin of a message. It can be one of: More...

#include <MessageOrigin.hpp>

Inheritance diagram for tgbotxx::MessageOrigin:
tgbotxx::MessageOriginChannel tgbotxx::MessageOriginChat tgbotxx::MessageOriginHiddenUser tgbotxx::MessageOriginUser

Public Member Functions

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

Public Attributes

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.
 

Detailed Description

This object describes the origin of a message. It can be one of:

Definition at line 13 of file MessageOrigin.hpp.

Constructor & Destructor Documentation

◆ MessageOrigin() [1/2]

tgbotxx::MessageOrigin::MessageOrigin ( )
default

◆ MessageOrigin() [2/2]

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

Definition at line 15 of file MessageOrigin.hpp.

◆ ~MessageOrigin()

virtual tgbotxx::MessageOrigin::~MessageOrigin ( )
virtualdefault

Member Function Documentation

◆ fromJson()

virtual void tgbotxx::MessageOrigin::fromJson ( const nl::json &  json)
inlinevirtual

Deserializes this object from JSON.

Reimplemented in tgbotxx::MessageOriginUser, tgbotxx::MessageOriginHiddenUser, tgbotxx::MessageOriginChat, and tgbotxx::MessageOriginChannel.

Definition at line 36 of file MessageOrigin.hpp.

◆ toJson()

virtual nl::json tgbotxx::MessageOrigin::toJson ( ) const
inlinevirtual

Serializes this object to JSON.

Returns
JSON representation of this object

Reimplemented in tgbotxx::MessageOriginUser, tgbotxx::MessageOriginHiddenUser, tgbotxx::MessageOriginChat, and tgbotxx::MessageOriginChannel.

Definition at line 28 of file MessageOrigin.hpp.

Member Data Documentation

◆ date

std::time_t tgbotxx::MessageOrigin::date {}

Date the message was sent originally in Unix time.

Definition at line 24 of file MessageOrigin.hpp.

◆ type

std::string tgbotxx::MessageOrigin::type

Type of the message origin, one of "user", "hidden_user", "chat" or "channel".

Definition at line 21 of file MessageOrigin.hpp.


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