This object represents a chat. https://core.telegram.org/bots/api#chat.
More...
#include <Chat.hpp>
|
| | Chat ()=default |
| |
| | Chat (const nl::json &json) |
| |
| virtual | ~Chat ()=default |
| |
| virtual nl::json | toJson () const |
| | Serializes this object to JSON.
|
| |
| virtual void | fromJson (const nl::json &json) |
| | Deserializes this object from JSON.
|
| |
|
| static std::optional< std::string > | TypeToString (const Type type) noexcept |
| | Converts enum Type to a string.
|
| |
| static std::optional< Type > | StringToType (const std::string &str) noexcept |
| | Converts string to an enum Type.
|
| |
This object represents a chat. https://core.telegram.org/bots/api#chat.
Definition at line 7 of file Chat.hpp.
◆ Type
Enum of possible types of Type.
| Enumerator |
|---|
| Private | |
| Group | |
| Supergroup | |
| Channel | |
Definition at line 19 of file Chat.hpp.
◆ Chat() [1/2]
◆ Chat() [2/2]
| tgbotxx::Chat::Chat |
( |
const nl::json & |
json | ) |
|
|
explicit |
◆ ~Chat()
| virtual tgbotxx::Chat::~Chat |
( |
| ) |
|
|
virtualdefault |
◆ fromJson()
| virtual void tgbotxx::Chat::fromJson |
( |
const nl::json & |
json | ) |
|
|
virtual |
◆ StringToType()
| static std::optional< Type > tgbotxx::Chat::StringToType |
( |
const std::string & |
str | ) |
|
|
staticnoexcept |
Converts string to an enum Type.
◆ toJson()
| virtual nl::json tgbotxx::Chat::toJson |
( |
| ) |
const |
|
virtual |
Serializes this object to JSON.
- Returns
- JSON representation of this object
Reimplemented in tgbotxx::ChatFullInfo.
◆ TypeToString()
| static std::optional< std::string > tgbotxx::Chat::TypeToString |
( |
const Type |
type | ) |
|
|
staticnoexcept |
Converts enum Type to a string.
◆ firstName
| std::string tgbotxx::Chat::firstName |
Optional. First name of the other party in a private chat.
Definition at line 40 of file Chat.hpp.
◆ id
| std::int64_t tgbotxx::Chat::id {} |
Unique identifier for this chat.
- Note
- This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Definition at line 16 of file Chat.hpp.
◆ isDirectMessages
| bool tgbotxx::Chat::isDirectMessages {} |
◆ isForum
| bool tgbotxx::Chat::isForum {} |
◆ lastName
| std::string tgbotxx::Chat::lastName |
Optional. Last name of the other party in a private chat.
Definition at line 43 of file Chat.hpp.
◆ title
| std::string tgbotxx::Chat::title |
Optional. Title, for supergroups, channels and group chats.
Definition at line 34 of file Chat.hpp.
◆ type
| Type tgbotxx::Chat::type {} |
Type of chat, can be either “private”, “group”, “supergroup” or “channel”
Definition at line 31 of file Chat.hpp.
◆ username
| std::string tgbotxx::Chat::username |
Optional. Username, for private chats, supergroups and channels if available.
Definition at line 37 of file Chat.hpp.
The documentation for this struct was generated from the following file: