tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
User.hpp
Go to the documentation of this file.
1#pragma once
3
4namespace tgbotxx {
7 struct User {
8 User() = default;
9 explicit User(const nl::json& json);
10
15 std::int64_t id{};
16
18 bool isBot{};
19
21 std::string firstName;
22
24 std::string lastName;
25
27 std::string username;
28
31 std::string languageCode;
32
34 bool isPremium{};
35
38
41
44
47
50
53
56 [[nodiscard]] nl::json toJson() const;
57
59 void fromJson(const nl::json& json);
60 };
61}
This object represents a Telegram user or bot. https://core.telegram.org/bots/api#user.
Definition User.hpp:7
std::string lastName
Optional. User's or bot's last name.
Definition User.hpp:24
std::string languageCode
Optional. IETF language tag of the user's language https://en.wikipedia.org/wiki/IETF_language_tag.
Definition User.hpp:31
void fromJson(const nl::json &json)
Deserializes this object from JSON.
bool isBot
True, if this user is a bot.
Definition User.hpp:18
bool addedToAttachmentMenu
Optional. True, if this user added the bot to the attachment menu.
Definition User.hpp:37
bool canConnectToBusiness
Optional. True, if the bot can be connected to a Telegram Business account to receive its messages....
Definition User.hpp:49
std::string firstName
User's or bot's first name.
Definition User.hpp:21
bool canReadAllGroupMessages
Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
Definition User.hpp:43
User()=default
bool hasMainWebApp
Optional. True, if the bot has a main Web App. Returned only in getMe.
Definition User.hpp:52
User(const nl::json &json)
bool supportsInlineQueries
Optional. True, if the bot supports inline queries. Returned only in getMe.
Definition User.hpp:46
bool isPremium
Optional. True, if this user is a Telegram Premium user.
Definition User.hpp:34
std::string username
Optional. User's or bot's username.
Definition User.hpp:27
nl::json toJson() const
Serializes this object to JSON.
bool canJoinGroups
Optional. True, if the bot can be invited to groups. Returned only in getMe.
Definition User.hpp:40