tgbotxx
1.2.9.5
Telegram Bot C++ Library
Loading...
Searching...
No Matches
KeyboardButtonRequestUsers.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
tgbotxx/objects/Object.hpp
>
3
4
namespace
tgbotxx
{
9
struct
KeyboardButtonRequestUsers
{
10
KeyboardButtonRequestUsers
() =
default
;
11
explicit
KeyboardButtonRequestUsers
(
const
nl::json&
json
) {
12
fromJson
(
json
);
13
}
14
18
std::int32_t
requestId
{};
19
21
bool
userIsBot
{};
22
24
bool
userIsPremium
{};
25
27
std::int32_t
maxQuantity
{1};
28
30
bool
requestName
{};
31
33
bool
requestUsername
{};
34
36
bool
requestPhoto
{};
37
38
41
nl::json
toJson
()
const
{
42
nl::json
json
= nl::json::object();
43
OBJECT_SERIALIZE_FIELD
(
json
,
"request_id"
,
requestId
);
44
OBJECT_SERIALIZE_FIELD
(
json
,
"user_is_bot"
,
userIsBot
);
45
OBJECT_SERIALIZE_FIELD
(
json
,
"user_is_premium"
,
userIsPremium
);
46
OBJECT_SERIALIZE_FIELD
(
json
,
"max_quantity"
,
maxQuantity
);
47
OBJECT_SERIALIZE_FIELD
(
json
,
"request_name"
,
requestName
);
48
OBJECT_SERIALIZE_FIELD
(
json
,
"request_username"
,
requestUsername
);
49
OBJECT_SERIALIZE_FIELD
(
json
,
"request_photo"
,
requestPhoto
);
50
return
json
;
51
}
52
54
void
fromJson
(
const
nl::json&
json
) {
55
OBJECT_DESERIALIZE_FIELD
(
json
,
"request_id"
,
requestId
, 0,
false
);
56
OBJECT_DESERIALIZE_FIELD
(
json
,
"user_is_bot"
,
userIsBot
,
false
,
true
);
57
OBJECT_DESERIALIZE_FIELD
(
json
,
"user_is_premium"
,
userIsPremium
,
false
,
true
);
58
OBJECT_DESERIALIZE_FIELD
(
json
,
"max_quantity"
,
maxQuantity
, 1,
true
);
59
OBJECT_DESERIALIZE_FIELD
(
json
,
"request_name"
,
requestName
,
false
,
true
);
60
OBJECT_DESERIALIZE_FIELD
(
json
,
"request_username"
,
requestUsername
,
false
,
true
);
61
OBJECT_DESERIALIZE_FIELD
(
json
,
"request_photo"
,
requestPhoto
,
false
,
true
);
62
}
63
};
64
}
Object.hpp
OBJECT_SERIALIZE_FIELD
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Serialize.
Definition
Object.hpp:27
OBJECT_DESERIALIZE_FIELD
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
Definition
Object.hpp:64
tgbotxx
Definition
Api.hpp:11
tgbotxx::Ptr
std::shared_ptr< T > Ptr
Definition
Ptr.hpp:6
tgbotxx::KeyboardButtonRequestUsers
TThis object defines the criteria used to request suitable users. Information about the selected user...
Definition
KeyboardButtonRequestUsers.hpp:9
tgbotxx::KeyboardButtonRequestUsers::userIsPremium
bool userIsPremium
Optional. Pass True to request a premium user, pass False to request a non-premium user....
Definition
KeyboardButtonRequestUsers.hpp:24
tgbotxx::KeyboardButtonRequestUsers::requestUsername
bool requestUsername
Optional. Pass True to request the users' usernames.
Definition
KeyboardButtonRequestUsers.hpp:33
tgbotxx::KeyboardButtonRequestUsers::userIsBot
bool userIsBot
Optional. Pass True to request a bot, pass False to request a regular user. If not specified,...
Definition
KeyboardButtonRequestUsers.hpp:21
tgbotxx::KeyboardButtonRequestUsers::requestId
std::int32_t requestId
Signed 32-bit identifier of the request, which will be received back in the UsersShared object....
Definition
KeyboardButtonRequestUsers.hpp:18
tgbotxx::KeyboardButtonRequestUsers::fromJson
void fromJson(const nl::json &json)
Deserializes this object from JSON.
Definition
KeyboardButtonRequestUsers.hpp:54
tgbotxx::KeyboardButtonRequestUsers::maxQuantity
std::int32_t maxQuantity
Optional. The maximum number of users to be selected; 1-10. Defaults to 1.
Definition
KeyboardButtonRequestUsers.hpp:27
tgbotxx::KeyboardButtonRequestUsers::KeyboardButtonRequestUsers
KeyboardButtonRequestUsers()=default
tgbotxx::KeyboardButtonRequestUsers::requestName
bool requestName
Optional. Pass True to request the users' first and last names.
Definition
KeyboardButtonRequestUsers.hpp:30
tgbotxx::KeyboardButtonRequestUsers::toJson
nl::json toJson() const
Serializes this object to JSON.
Definition
KeyboardButtonRequestUsers.hpp:41
tgbotxx::KeyboardButtonRequestUsers::requestPhoto
bool requestPhoto
Optional. Pass True to request the users' photos.
Definition
KeyboardButtonRequestUsers.hpp:36
tgbotxx::KeyboardButtonRequestUsers::KeyboardButtonRequestUsers
KeyboardButtonRequestUsers(const nl::json &json)
Definition
KeyboardButtonRequestUsers.hpp:11
include
tgbotxx
objects
KeyboardButtonRequestUsers.hpp
Generated on Sun Mar 22 2026 21:33:30 for tgbotxx by
1.9.8