tgbotxx
1.2.9.5
Telegram Bot C++ Library
Loading...
Searching...
No Matches
InputProfilePhoto.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
tgbotxx/objects/Object.hpp
>
3
4
namespace
tgbotxx
{
5
8
struct
InputProfilePhoto
{
9
InputProfilePhoto
() =
default
;
10
explicit
InputProfilePhoto
(
const
nl::json&
json
) {
11
InputProfilePhoto::fromJson
(
json
);
12
}
13
virtual
~InputProfilePhoto
() =
default
;
14
16
std::string
type
;
17
18
virtual
nl::json
toJson
()
const
{
19
nl::json
json
= nl::json::object();
20
OBJECT_SERIALIZE_FIELD
(
json
,
"type"
,
type
);
21
return
json
;
22
}
23
24
virtual
void
fromJson
(
const
nl::json&
json
) {
25
OBJECT_DESERIALIZE_FIELD
(
json
,
"type"
,
type
,
""
,
false
);
26
}
27
};
28
31
struct
InputProfilePhotoStatic
:
InputProfilePhoto
{
32
InputProfilePhotoStatic
() {
33
type
=
"static"
;
34
}
35
explicit
InputProfilePhotoStatic
(
const
nl::json&
json
) {
36
InputProfilePhotoStatic::fromJson
(
json
);
37
}
38
41
std::string
photo
;
42
45
nl::json
toJson
()
const override
{
46
nl::json
json
=
InputProfilePhoto::toJson
();
47
OBJECT_SERIALIZE_FIELD
(
json
,
"photo"
,
photo
);
48
return
json
;
49
}
50
52
void
fromJson
(
const
nl::json&
json
)
override
{
53
InputProfilePhoto::fromJson
(
json
);
54
OBJECT_DESERIALIZE_FIELD
(
json
,
"photo"
,
photo
,
""
,
false
);
55
}
56
};
57
60
struct
InputProfilePhotoAnimated
:
InputProfilePhoto
{
61
InputProfilePhotoAnimated
() {
62
type
=
"animated"
;
63
}
64
explicit
InputProfilePhotoAnimated
(
const
nl::json&
json
) {
65
InputProfilePhotoAnimated::fromJson
(
json
);
66
}
67
68
71
std::string
animation
;
72
74
double
mainFrameTimestamp
{0.0};
75
78
nl::json
toJson
()
const override
{
79
nl::json
json
=
InputProfilePhoto::toJson
();
80
OBJECT_SERIALIZE_FIELD
(
json
,
"animation"
,
animation
);
81
OBJECT_SERIALIZE_FIELD
(
json
,
"main_frame_timestamp"
,
mainFrameTimestamp
);
82
return
json
;
83
}
84
86
void
fromJson
(
const
nl::json&
json
)
override
{
87
InputProfilePhoto::fromJson
(
json
);
88
OBJECT_DESERIALIZE_FIELD
(
json
,
"animation"
,
animation
,
""
,
false
);
89
OBJECT_DESERIALIZE_FIELD
(
json
,
"main_frame_timestamp"
,
mainFrameTimestamp
, 0.0,
true
);
90
}
91
};
92
93
}
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::InputProfilePhotoAnimated
An animated profile photo in the MPEG4 format https://core.telegram.org/bots/api#inputprofilephotoani...
Definition
InputProfilePhoto.hpp:60
tgbotxx::InputProfilePhotoAnimated::toJson
nl::json toJson() const override
Serializes this object to JSON.
Definition
InputProfilePhoto.hpp:78
tgbotxx::InputProfilePhotoAnimated::InputProfilePhotoAnimated
InputProfilePhotoAnimated(const nl::json &json)
Definition
InputProfilePhoto.hpp:64
tgbotxx::InputProfilePhotoAnimated::fromJson
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
Definition
InputProfilePhoto.hpp:86
tgbotxx::InputProfilePhotoAnimated::InputProfilePhotoAnimated
InputProfilePhotoAnimated()
Definition
InputProfilePhoto.hpp:61
tgbotxx::InputProfilePhotoAnimated::mainFrameTimestamp
double mainFrameTimestamp
Optional. Timestamp in seconds of the frame that will be used as the static profile photo....
Definition
InputProfilePhoto.hpp:74
tgbotxx::InputProfilePhotoAnimated::animation
std::string animation
The animated profile photo. Profile photos can't be reused and can only be uploaded as a new file,...
Definition
InputProfilePhoto.hpp:71
tgbotxx::InputProfilePhoto
Base class for profile photos to set https://core.telegram.org/bots/api#inputprofilephoto.
Definition
InputProfilePhoto.hpp:8
tgbotxx::InputProfilePhoto::type
std::string type
Type of the profile photo.
Definition
InputProfilePhoto.hpp:16
tgbotxx::InputProfilePhoto::~InputProfilePhoto
virtual ~InputProfilePhoto()=default
tgbotxx::InputProfilePhoto::InputProfilePhoto
InputProfilePhoto()=default
tgbotxx::InputProfilePhoto::InputProfilePhoto
InputProfilePhoto(const nl::json &json)
Definition
InputProfilePhoto.hpp:10
tgbotxx::InputProfilePhoto::toJson
virtual nl::json toJson() const
Definition
InputProfilePhoto.hpp:18
tgbotxx::InputProfilePhoto::fromJson
virtual void fromJson(const nl::json &json)
Definition
InputProfilePhoto.hpp:24
tgbotxx::InputProfilePhotoStatic
A static profile photo in the .JPG format https://core.telegram.org/bots/api#inputprofilephotostatic.
Definition
InputProfilePhoto.hpp:31
tgbotxx::InputProfilePhotoStatic::photo
std::string photo
The static profile photo. Profile photos can't be reused and can only be uploaded as a new file,...
Definition
InputProfilePhoto.hpp:41
tgbotxx::InputProfilePhotoStatic::InputProfilePhotoStatic
InputProfilePhotoStatic()
Definition
InputProfilePhoto.hpp:32
tgbotxx::InputProfilePhotoStatic::toJson
nl::json toJson() const override
Serializes this object to JSON.
Definition
InputProfilePhoto.hpp:45
tgbotxx::InputProfilePhotoStatic::InputProfilePhotoStatic
InputProfilePhotoStatic(const nl::json &json)
Definition
InputProfilePhoto.hpp:35
tgbotxx::InputProfilePhotoStatic::fromJson
void fromJson(const nl::json &json) override
Deserializes this object from JSON.
Definition
InputProfilePhoto.hpp:52
include
tgbotxx
objects
InputProfilePhoto.hpp
Generated on Sun Mar 22 2026 21:33:30 for tgbotxx by
1.9.8