9 explicit Chat(
const nl::json& json);
19 enum class Type : std::uint8_t {
28 static std::optional<Type>
StringToType(
const std::string& str)
noexcept;
55 [[nodiscard]]
virtual nl::json
toJson()
const;
61 void _fromJson(
const nl::json& json);
This object represents a chat. https://core.telegram.org/bots/api#chat.
static std::optional< std::string > TypeToString(const Type type) noexcept
Converts enum Type to a string.
std::string username
Optional. Username, for private chats, supergroups and channels if available.
Type
Enum of possible types of Type.
static std::optional< Type > StringToType(const std::string &str) noexcept
Converts string to an enum Type.
bool isForum
Optional. True, if the supergroup chat is a forum (has topics enabled) https://telegram....
bool isDirectMessages
Optional. True, if the supergroup chat is a forum (has topics enabled) https://telegram....
std::string lastName
Optional. Last name of the other party in a private chat.
Chat(const nl::json &json)
Type type
Type of chat, can be either “private”, “group”, “supergroup” or “channel”
std::string firstName
Optional. First name of the other party in a private chat.
std::string title
Optional. Title, for supergroups, channels and group chats.
virtual void fromJson(const nl::json &json)
Deserializes this object from JSON.
virtual nl::json toJson() const
Serializes this object to JSON.