tgbotxx 1.1.9.2
Telegram Bot C++ Library
Loading...
Searching...
No Matches
InlineQueryResult.hpp
Go to the documentation of this file.
1#pragma once
6
7namespace tgbotxx {
33 InlineQueryResult() = default;
34 explicit InlineQueryResult(const nl::json& json) {
35 _fromJson(json);
36 }
37 virtual ~InlineQueryResult() = default;
38
40 std::string type;
41
43 std::string id;
44
47
48 virtual nl::json toJson() const {
49 nl::json json = nl::json::object();
50 OBJECT_SERIALIZE_FIELD(json, "type", type);
51 OBJECT_SERIALIZE_FIELD(json, "id", id);
52 OBJECT_SERIALIZE_FIELD_PTR(json, "reply_markup", replyMarkup);
53 return json;
54 }
55
56 virtual void fromJson(const nl::json& json) {
57 OBJECT_DESERIALIZE_FIELD(json, "type", type, "", false);
58 OBJECT_DESERIALIZE_FIELD(json, "id", id, "", false);
59 OBJECT_DESERIALIZE_FIELD_PTR(json, "reply_markup", replyMarkup, true);
60 }
61
62 private:
63 void _fromJson(const nl::json& json) { // to avoid calling virtual method fromJson() from constructor
64 fromJson(json);
65 }
66 };
67
68
75 explicit InlineQueryResultArticle(const nl::json& json) : InlineQueryResult(json) {
76 InlineQueryResult::type = "article";
77 }
78
80 std::string title;
81
84
86 std::string url;
87
89 bool hideUrl{};
90
92 std::string description;
93
95 std::string thumbnailUrl;
96
98 std::int32_t thumbnailWidth{};
99
101 std::int32_t thumbnailHeight{};
102
103 nl::json toJson() const override {
104 nl::json json = InlineQueryResult::toJson();
105 OBJECT_SERIALIZE_FIELD(json, "title", title);
106 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
107 OBJECT_SERIALIZE_FIELD(json, "url", url);
108 OBJECT_SERIALIZE_FIELD(json, "hide_url", hideUrl);
109 OBJECT_SERIALIZE_FIELD(json, "description", description);
110 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
111 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
112 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
113 return json;
114 }
115
116 void fromJson(const nl::json& json) override {
118 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
119 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, false);
120 OBJECT_DESERIALIZE_FIELD(json, "url", url, "", true);
121 OBJECT_DESERIALIZE_FIELD(json, "hide_url", hideUrl, false, true);
122 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
123 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
124 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
125 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
126 }
127 };
128
136 explicit InlineQueryResultPhoto(const nl::json& json) : InlineQueryResult(json) {
137 InlineQueryResult::type = "photo";
138 }
139
141 std::string photoUrl;
142
144 std::string thumbnailUrl;
145
147 std::int32_t photoWidth{};
148
150 std::int32_t photoHeight{};
151
153 std::string title;
154
156 std::string description;
157
159 std::string caption;
160
162 std::string parseMode;
163
165 std::vector<Ptr<MessageEntity>> captionEntities;
166
169
170 nl::json toJson() const override {
171 nl::json json = InlineQueryResult::toJson();
172 OBJECT_SERIALIZE_FIELD(json, "photo_url", photoUrl);
173 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
174 OBJECT_SERIALIZE_FIELD(json, "photo_width", photoWidth);
175 OBJECT_SERIALIZE_FIELD(json, "photo_height", photoHeight);
176 OBJECT_SERIALIZE_FIELD(json, "title", title);
177 OBJECT_SERIALIZE_FIELD(json, "description", description);
178 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
179 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
180 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
181 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
182 return json;
183 }
184
185 void fromJson(const nl::json& json) override {
187 OBJECT_DESERIALIZE_FIELD(json, "photo_url", photoUrl, "", false);
188 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
189 OBJECT_DESERIALIZE_FIELD(json, "photo_width", photoWidth, 0, true);
190 OBJECT_DESERIALIZE_FIELD(json, "photo_height", photoHeight, 0, true);
191 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
192 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
193 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
194 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
195 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
196 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
197 }
198 };
199
207 explicit InlineQueryResultGif(const nl::json& json) : InlineQueryResult(json) {
209 }
210
212 std::string gifUrl;
213
215 std::int32_t gifWidth{};
216
218 std::int32_t gifHeight{};
219
221 std::int32_t gifDuration{};
222
224 std::string thumbnailUrl;
225
227 std::string thumbnailMimeType;
228
230 std::string title;
231
233 std::string caption;
234
236 std::string parseMode;
237
239 std::vector<Ptr<MessageEntity>> captionEntities;
240
243
244 nl::json toJson() const override {
245 nl::json json = InlineQueryResult::toJson();
246 OBJECT_SERIALIZE_FIELD(json, "gif_url", gifUrl);
247 OBJECT_SERIALIZE_FIELD(json, "gif_width", gifWidth);
248 OBJECT_SERIALIZE_FIELD(json, "gif_height", gifHeight);
249 OBJECT_SERIALIZE_FIELD(json, "gif_duration", gifDuration);
250 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
251 OBJECT_SERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType);
252 OBJECT_SERIALIZE_FIELD(json, "title", title);
253 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
254 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
255 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
256 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
257 return json;
258 }
259
260 void fromJson(const nl::json& json) override {
262 OBJECT_DESERIALIZE_FIELD(json, "gif_url", gifUrl, "", false);
263 OBJECT_DESERIALIZE_FIELD(json, "gif_width", gifWidth, 0, true);
264 OBJECT_DESERIALIZE_FIELD(json, "gif_height", gifHeight, 0, true);
265 OBJECT_DESERIALIZE_FIELD(json, "gif_duration", gifDuration, 0, true);
266 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
267 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType, "", true);
268 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
269 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
270 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
271 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
272 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
273 }
274 };
275
284 explicit InlineQueryResultMpeg4Gif(const nl::json& json) : InlineQueryResult(json) {
285 InlineQueryResult::type = "mpeg4_gif";
286 }
287
289 std::string mpeg4Url;
290
292 std::int32_t mpeg4Width{};
293
295 std::int32_t mpeg4Height{};
296
298 std::int32_t mpeg4Duration{};
299
301 std::string thumbnailUrl;
302
304 std::string thumbnailMimeType;
305
307 std::string title;
308
310 std::string caption;
311
313 std::string parseMode;
314
316 std::vector<Ptr<MessageEntity>> captionEntities;
317
320
321 nl::json toJson() const override {
322 nl::json json = InlineQueryResult::toJson();
323 OBJECT_SERIALIZE_FIELD(json, "mpeg4_url", mpeg4Url);
324 OBJECT_SERIALIZE_FIELD(json, "mpeg4_width", mpeg4Width);
325 OBJECT_SERIALIZE_FIELD(json, "mpeg4_height", mpeg4Height);
326 OBJECT_SERIALIZE_FIELD(json, "mpeg4_duration", mpeg4Duration);
327 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
328 OBJECT_SERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType);
329 OBJECT_SERIALIZE_FIELD(json, "title", title);
330 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
331 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
332 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
333 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
334 return json;
335 }
336
337 void fromJson(const nl::json& json) override {
339 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_url", mpeg4Url, "", false);
340 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_width", mpeg4Width, 0, true);
341 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_height", mpeg4Height, 0, true);
342 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_duration", mpeg4Duration, 0, true);
343 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
344 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType, "", true);
345 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
346 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
347 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
348 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
349 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
350 }
351 };
352
353
363 explicit InlineQueryResultVideo(const nl::json& json) : InlineQueryResult(json) {
364 InlineQueryResult::type = "video";
365 }
366
368 std::string videoUrl;
369
371 std::string mimeType;
372
374 std::string title;
375
377 std::string thumbnailUrl;
378
380 std::string caption;
381
383 std::string parseMode;
384
386 std::vector<Ptr<MessageEntity>> captionEntities;
387
389 std::int32_t videoWidth{};
390
392 std::int32_t videoHeight{};
393
395 std::int32_t videoDuration{};
396
398 std::string description;
399
403
404 nl::json toJson() const override {
405 nl::json json = InlineQueryResult::toJson();
406 OBJECT_SERIALIZE_FIELD(json, "video_url", videoUrl);
407 OBJECT_SERIALIZE_FIELD(json, "mime_type", mimeType);
408 OBJECT_SERIALIZE_FIELD(json, "title", title);
409 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
410 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
411 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
412 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
413 OBJECT_SERIALIZE_FIELD(json, "video_width", videoWidth);
414 OBJECT_SERIALIZE_FIELD(json, "video_height", videoHeight);
415 OBJECT_SERIALIZE_FIELD(json, "video_duration", videoDuration);
416 OBJECT_SERIALIZE_FIELD(json, "description", description);
417 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
418 return json;
419 }
420
421 void fromJson(const nl::json& json) override {
423 OBJECT_DESERIALIZE_FIELD(json, "video_url", videoUrl, "", false);
424 OBJECT_DESERIALIZE_FIELD(json, "mime_type", mimeType, "", false);
425 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
426 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
427 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
428 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
429 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
430 OBJECT_DESERIALIZE_FIELD(json, "video_width", videoWidth, 0, true);
431 OBJECT_DESERIALIZE_FIELD(json, "video_height", videoHeight, 0, true);
432 OBJECT_DESERIALIZE_FIELD(json, "video_duration", videoDuration, 0, true);
433 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
434 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
435 }
436 };
437
438
446 explicit InlineQueryResultAudio(const nl::json& json) : InlineQueryResult(json) {
447 InlineQueryResult::type = "audio";
448 }
449
451 std::string audioUrl;
452
454 std::string title;
455
457 std::string caption;
458
460 std::string parseMode;
461
463 std::vector<Ptr<MessageEntity>> captionEntities;
464
466 std::string performer;
467
469 std::int32_t audioDuration{};
470
474
475 nl::json toJson() const override {
476 nl::json json = InlineQueryResult::toJson();
477 OBJECT_SERIALIZE_FIELD(json, "audio_url", audioUrl);
478 OBJECT_SERIALIZE_FIELD(json, "title", title);
479 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
480 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
481 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
482 OBJECT_SERIALIZE_FIELD(json, "performer", performer);
483 OBJECT_SERIALIZE_FIELD(json, "audio_duration", audioDuration);
484 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
485 return json;
486 }
487
488 void fromJson(const nl::json& json) override {
490 OBJECT_DESERIALIZE_FIELD(json, "audio_url", audioUrl, "", false);
491 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
492 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
493 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
494 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
495 OBJECT_DESERIALIZE_FIELD(json, "performer", performer, "", true);
496 OBJECT_DESERIALIZE_FIELD(json, "audio_duration", audioDuration, 0, true);
497 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
498 }
499 };
500
501
510 explicit InlineQueryResultVoice(const nl::json& json) : InlineQueryResult(json) {
511 InlineQueryResult::type = "voice";
512 }
513
515 std::string voiceUrl;
516
518 std::string title;
519
521 std::string caption;
522
524 std::string parseMode;
525
527 std::vector<Ptr<MessageEntity>> captionEntities;
528
530 std::string performer;
531
533 std::int32_t voiceDuration{};
534
538
539 nl::json toJson() const override {
540 nl::json json = InlineQueryResult::toJson();
541 OBJECT_SERIALIZE_FIELD(json, "voice_url", voiceUrl);
542 OBJECT_SERIALIZE_FIELD(json, "title", title);
543 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
544 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
545 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
546 OBJECT_SERIALIZE_FIELD(json, "performer", performer);
547 OBJECT_SERIALIZE_FIELD(json, "voice_duration", voiceDuration);
548 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
549 return json;
550 }
551
552 void fromJson(const nl::json& json) override {
554 OBJECT_DESERIALIZE_FIELD(json, "audio_url", voiceUrl, "", false);
555 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
556 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
557 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
558 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
559 OBJECT_DESERIALIZE_FIELD(json, "performer", performer, "", true);
560 OBJECT_DESERIALIZE_FIELD(json, "voice_duration", voiceDuration, 0, true);
561 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
562 }
563 };
564
573 explicit InlineQueryResultDocument(const nl::json& json) : InlineQueryResult(json) {
574 InlineQueryResult::type = "document";
575 }
576
578 std::string title;
579
581 std::string caption;
582
584 std::string parseMode;
585
587 std::vector<Ptr<MessageEntity>> captionEntities;
588
590 std::string documentUrl;
591
593 std::string mimeType;
594
596 std::string description;
597
601
603 std::string thumbnailUrl;
604
606 std::int32_t thumbnailWidth{};
607
609 std::int32_t thumbnailHeight{};
610
611 nl::json toJson() const override {
612 nl::json json = InlineQueryResult::toJson();
613 OBJECT_SERIALIZE_FIELD(json, "title", title);
614 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
615 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
616 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
617 OBJECT_SERIALIZE_FIELD(json, "document_url", documentUrl);
618 OBJECT_SERIALIZE_FIELD(json, "mime_type", mimeType);
619 OBJECT_SERIALIZE_FIELD(json, "description", description);
620 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
621 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
622 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
623 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
624 return json;
625 }
626
627 void fromJson(const nl::json& json) override {
629 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
630 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
631 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
632 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
633 OBJECT_DESERIALIZE_FIELD(json, "document_url", documentUrl, "", false);
634 OBJECT_DESERIALIZE_FIELD(json, "mime_type", mimeType, "", false);
635 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
636 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
637 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
638 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
639 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
640 }
641 };
642
650 explicit InlineQueryResultLocation(const nl::json& json) : InlineQueryResult(json) {
651 InlineQueryResult::type = "location";
652 }
653
655 float latitude{};
656
658 float longitude{};
659
661 std::string title;
662
665
667 std::int32_t livePeriod{};
668
670 std::int32_t heading{};
671
674 std::int32_t proximityAlertRadius{};
675
678
680 std::string thumbnailUrl;
681
683 std::int32_t thumbnailWidth{};
684
686 std::int32_t thumbnailHeight{};
687
688 nl::json toJson() const override {
689 nl::json json = InlineQueryResult::toJson();
690 OBJECT_SERIALIZE_FIELD(json, "latitude", latitude);
691 OBJECT_SERIALIZE_FIELD(json, "longitude", longitude);
692 OBJECT_SERIALIZE_FIELD(json, "title", title);
693 OBJECT_SERIALIZE_FIELD(json, "horizontal_accuracy", horizontalAccuracy);
694 OBJECT_SERIALIZE_FIELD(json, "live_period", livePeriod);
695 OBJECT_SERIALIZE_FIELD(json, "heading", heading);
696 OBJECT_SERIALIZE_FIELD(json, "proximity_alert_radius", proximityAlertRadius);
697 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
698 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
699 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
700 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
701 return json;
702 }
703
704 void fromJson(const nl::json& json) override {
706 OBJECT_DESERIALIZE_FIELD(json, "latitude", latitude, 0.0f, false);
707 OBJECT_DESERIALIZE_FIELD(json, "longitude", longitude, 0.0f, false);
708 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
709 OBJECT_DESERIALIZE_FIELD(json, "horizontal_accuracy", horizontalAccuracy, 0.0f, true);
710 OBJECT_DESERIALIZE_FIELD(json, "live_period", livePeriod, 0, true);
711 OBJECT_DESERIALIZE_FIELD(json, "heading", heading, 0, true);
712 OBJECT_DESERIALIZE_FIELD(json, "proximity_alert_radius", proximityAlertRadius, 0, true);
713 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
714 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
715 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
716 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
717 }
718 };
719
726 explicit InlineQueryResultVenue(const nl::json& json) : InlineQueryResult(json) {
727 InlineQueryResult::type = "venue";
728 }
729
731 float latitude{};
732
734 float longitude{};
735
737 std::string title;
738
740 std::string address;
741
743 std::string foursquareId;
744
747 std::string foursquareType;
748
750 std::string googlePlaceId;
751
753 std::string googlePlaceType;
754
757
759 std::string thumbnailUrl;
760
762 std::int32_t thumbnailWidth{};
763
765 std::int32_t thumbnailHeight{};
766
767 nl::json toJson() const override {
768 nl::json json = InlineQueryResult::toJson();
769 OBJECT_SERIALIZE_FIELD(json, "latitude", latitude);
770 OBJECT_SERIALIZE_FIELD(json, "longitude", longitude);
771 OBJECT_SERIALIZE_FIELD(json, "title", title);
772 OBJECT_SERIALIZE_FIELD(json, "address", address);
773 OBJECT_SERIALIZE_FIELD(json, "foursquare_id", foursquareId);
774 OBJECT_SERIALIZE_FIELD(json, "foursquare_type", foursquareType);
775 OBJECT_SERIALIZE_FIELD(json, "google_place_id", googlePlaceId);
776 OBJECT_SERIALIZE_FIELD(json, "google_place_type", googlePlaceType);
777 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
778 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
779 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
780 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
781 return json;
782 }
783
784 void fromJson(const nl::json& json) override {
786 OBJECT_DESERIALIZE_FIELD(json, "latitude", latitude, 0.0f, false);
787 OBJECT_DESERIALIZE_FIELD(json, "longitude", longitude, 0.0f, false);
788 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
789 OBJECT_DESERIALIZE_FIELD(json, "address", address, "", false);
790 OBJECT_DESERIALIZE_FIELD(json, "foursquare_id", foursquareId, "", true);
791 OBJECT_DESERIALIZE_FIELD(json, "foursquare_type", foursquareType, "", true);
792 OBJECT_DESERIALIZE_FIELD(json, "google_place_id", googlePlaceId, "", true);
793 OBJECT_DESERIALIZE_FIELD(json, "google_place_type", googlePlaceType, "", true);
794 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
795 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
796 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
797 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
798 }
799 };
800
801
808 explicit InlineQueryResultContact(const nl::json& json) : InlineQueryResult(json) {
809 InlineQueryResult::type = "contact";
810 }
811
813 std::string phoneNumber;
814
816 std::string firstName;
817
819 std::string lastName;
820
822 std::string vcard;
823
826
828 std::string thumbnailUrl;
829
831 std::int32_t thumbnailWidth{};
832
834 std::int32_t thumbnailHeight{};
835
836 nl::json toJson() const override {
837 nl::json json = InlineQueryResult::toJson();
838 OBJECT_SERIALIZE_FIELD(json, "phone_number", phoneNumber);
839 OBJECT_SERIALIZE_FIELD(json, "first_name", firstName);
840 OBJECT_SERIALIZE_FIELD(json, "last_name", lastName);
841 OBJECT_SERIALIZE_FIELD(json, "vcard", vcard);
842 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
843 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
844 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
845 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
846 return json;
847 }
848
849 void fromJson(const nl::json& json) override {
851 OBJECT_DESERIALIZE_FIELD(json, "phone_number", phoneNumber, "", false);
852 OBJECT_DESERIALIZE_FIELD(json, "first_name", firstName, "", false);
853 OBJECT_DESERIALIZE_FIELD(json, "last_name", lastName, "", true);
854 OBJECT_DESERIALIZE_FIELD(json, "vcard", vcard, "", true);
855 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
856 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
857 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
858 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
859 }
860 };
861
862
869 explicit InlineQueryResultGame(const nl::json& json) : InlineQueryResult(json) {
871 }
872
874 std::string gameShortName;
875
876 nl::json toJson() const override {
877 nl::json json = InlineQueryResult::toJson();
878 OBJECT_SERIALIZE_FIELD(json, "game_short_name", gameShortName);
879 return json;
880 }
881
882 void fromJson(const nl::json& json) override {
884 OBJECT_DESERIALIZE_FIELD(json, "game_short_name", gameShortName, "", false);
885 }
886 };
887
888
895 explicit InlineQueryResultCachedPhoto(const nl::json& json) : InlineQueryResult(json) {
896 InlineQueryResult::type = "photo";
897 }
898
900 std::string photoFileId;
901
903 std::string title;
904
906 std::string description;
907
909 std::string caption;
910
912 std::string parseMode;
913
915 std::vector<Ptr<MessageEntity>> captionEntities;
916
919
920
921 nl::json toJson() const override {
922 nl::json json = InlineQueryResult::toJson();
923 OBJECT_SERIALIZE_FIELD(json, "photo_file_id", photoFileId);
924 OBJECT_SERIALIZE_FIELD(json, "title", title);
925 OBJECT_SERIALIZE_FIELD(json, "description", description);
926 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
927 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
928 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
929 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
930 return json;
931 }
932
933 void fromJson(const nl::json& json) override {
935 OBJECT_DESERIALIZE_FIELD(json, "photo_file_id", photoFileId, "", false);
936 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
937 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
938 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
939 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
940 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
941 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
942 }
943 };
944
945
953 explicit InlineQueryResultCachedGif(const nl::json& json) : InlineQueryResult(json) {
955 }
956
958 std::string gifFileId;
959
961 std::string title;
962
964 std::string caption;
965
967 std::string parseMode;
968
970 std::vector<Ptr<MessageEntity>> captionEntities;
971
974
975
976 nl::json toJson() const override {
977 nl::json json = InlineQueryResult::toJson();
978 OBJECT_SERIALIZE_FIELD(json, "gif_file_id", gifFileId);
979 OBJECT_SERIALIZE_FIELD(json, "title", title);
980 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
981 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
982 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
983 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
984 return json;
985 }
986
987 void fromJson(const nl::json& json) override {
989 OBJECT_DESERIALIZE_FIELD(json, "gif_file_id", gifFileId, "", false);
990 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
991 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
992 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
993 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
994 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
995 }
996 };
997
1005 explicit InlineQueryResultCachedMpeg4Gif(const nl::json& json) : InlineQueryResult(json) {
1006 InlineQueryResult::type = "mpeg4_gif";
1007 }
1008
1010 std::string mpeg4FileId;
1011
1013 std::string title;
1014
1016 std::string caption;
1017
1019 std::string parseMode;
1020
1022 std::vector<Ptr<MessageEntity>> captionEntities;
1023
1026
1027
1028 nl::json toJson() const override {
1029 nl::json json = InlineQueryResult::toJson();
1030 OBJECT_SERIALIZE_FIELD(json, "mpeg4_file_id", mpeg4FileId);
1031 OBJECT_SERIALIZE_FIELD(json, "title", title);
1032 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1033 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1034 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1035 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1036 return json;
1037 }
1038
1039 void fromJson(const nl::json& json) override {
1041 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_file_id", mpeg4FileId, "", false);
1042 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
1043 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1044 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1045 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1046 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1047 }
1048 };
1049
1058 explicit InlineQueryResultCachedSticker(const nl::json& json) : InlineQueryResult(json) {
1059 InlineQueryResult::type = "sticker";
1060 }
1061
1063 std::string stickerFileId;
1064
1067
1068
1069 nl::json toJson() const override {
1070 nl::json json = InlineQueryResult::toJson();
1071 OBJECT_SERIALIZE_FIELD(json, "sticker_file_id", stickerFileId);
1072 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1073 return json;
1074 }
1075
1076 void fromJson(const nl::json& json) override {
1078 OBJECT_DESERIALIZE_FIELD(json, "sticker_file_id", stickerFileId, "", false);
1079 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1080 }
1081 };
1082
1083
1092 explicit InlineQueryResultCachedDocument(const nl::json& json) : InlineQueryResult(json) {
1093 InlineQueryResult::type = "document";
1094 }
1095
1097 std::string title;
1098
1100 std::string documentFileId;
1101
1103 std::string description;
1104
1106 std::string caption;
1107
1109 std::string parseMode;
1110
1112 std::vector<Ptr<MessageEntity>> captionEntities;
1113
1116
1117
1118 nl::json toJson() const override {
1119 nl::json json = InlineQueryResult::toJson();
1120 OBJECT_SERIALIZE_FIELD(json, "title", title);
1121 OBJECT_SERIALIZE_FIELD(json, "document_file_id", documentFileId);
1122 OBJECT_SERIALIZE_FIELD(json, "description", description);
1123 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1124 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1125 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1126 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1127 return json;
1128 }
1129
1130 void fromJson(const nl::json& json) override {
1132 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1133 OBJECT_DESERIALIZE_FIELD(json, "document_file_id", documentFileId, "", false);
1134 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1135 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1136 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1137 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1138 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1139 }
1140 };
1141
1142
1149 explicit InlineQueryResultCachedVideo(const nl::json& json) : InlineQueryResult(json) {
1150 InlineQueryResult::type = "video";
1151 }
1152
1154 std::string videoFileId;
1155
1157 std::string title;
1158
1160 std::string description;
1161
1163 std::string caption;
1164
1166 std::string parseMode;
1167
1169 std::vector<Ptr<MessageEntity>> captionEntities;
1170
1173
1174
1175 nl::json toJson() const override {
1176 nl::json json = InlineQueryResult::toJson();
1177 OBJECT_SERIALIZE_FIELD(json, "video_file_id", videoFileId);
1178 OBJECT_SERIALIZE_FIELD(json, "title", title);
1179 OBJECT_SERIALIZE_FIELD(json, "description", description);
1180 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1181 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1182 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1183 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1184 return json;
1185 }
1186
1187 void fromJson(const nl::json& json) override {
1189 OBJECT_DESERIALIZE_FIELD(json, "video_file_id", videoFileId, "", false);
1190 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1191 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1192 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1193 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1194 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1195 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1196 }
1197 };
1198
1199
1207 explicit InlineQueryResultCachedVoice(const nl::json& json) : InlineQueryResult(json) {
1208 InlineQueryResult::type = "voice";
1209 }
1210
1212 std::string voiceFileId;
1213
1215 std::string title;
1216
1218 std::string description;
1219
1221 std::string caption;
1222
1224 std::string parseMode;
1225
1227 std::vector<Ptr<MessageEntity>> captionEntities;
1228
1231
1232
1233 nl::json toJson() const override {
1234 nl::json json = InlineQueryResult::toJson();
1235 OBJECT_SERIALIZE_FIELD(json, "voice_file_id", voiceFileId);
1236 OBJECT_SERIALIZE_FIELD(json, "title", title);
1237 OBJECT_SERIALIZE_FIELD(json, "description", description);
1238 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1239 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1240 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1241 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1242 return json;
1243 }
1244
1245 void fromJson(const nl::json& json) override {
1247 OBJECT_DESERIALIZE_FIELD(json, "voice_file_id", voiceFileId, "", false);
1248 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1249 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1250 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1251 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1252 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1253 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1254 }
1255 };
1256
1257
1265 explicit InlineQueryResultCachedAudio(const nl::json& json) : InlineQueryResult(json) {
1266 InlineQueryResult::type = "audio";
1267 }
1268
1270 std::string audioFileId;
1271
1273 std::string caption;
1274
1276 std::string parseMode;
1277
1279 std::vector<Ptr<MessageEntity>> captionEntities;
1280
1283
1284
1285 nl::json toJson() const override {
1286 nl::json json = InlineQueryResult::toJson();
1287 OBJECT_SERIALIZE_FIELD(json, "audio_file_id", audioFileId);
1288 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1289 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1290 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1291 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1292 return json;
1293 }
1294
1295 void fromJson(const nl::json& json) override {
1297 OBJECT_DESERIALIZE_FIELD(json, "audio_file_id", audioFileId, "", false);
1298 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1299 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1300 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1301 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1302 }
1303 };
1304
1305}
#define OBJECT_SERIALIZE_FIELD_PTR(json, json_field, field)
Definition Object.hpp:22
#define OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field)
Definition Object.hpp:27
#define OBJECT_DESERIALIZE_FIELD_PTR(json, json_field, field, optional)
Definition Object.hpp:72
#define OBJECT_SERIALIZE_FIELD(json, json_field, field)
Available objects: https://core.telegram.org/bots/api#available-types.
Definition Object.hpp:19
#define OBJECT_DESERIALIZE_FIELD(json, json_field, field, default_value, optional)
Deserialize.
Definition Object.hpp:46
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field, optional)
Definition Object.hpp:89
std::shared_ptr< T > Ptr
Definition Ptr.hpp:6
Represents a link to an article or web page. https://core.telegram.org/bots/api#inlinequeryresultarti...
void fromJson(const nl::json &json) override
std::string thumbnailUrl
Optional. Url of the thumbnail for the result.
bool hideUrl
Optional. Pass True if you don't want the URL to be shown in the message.
InlineQueryResultArticle()
std::string description
Optional. Short description of the result.
std::int32_t thumbnailWidth
Optional. Thumbnail width.
std::int32_t thumbnailHeight
Optional. Thumbnail height.
Ptr< InputMessageContent > inputMessageContent
Content of the message to be sent.
nl::json toJson() const override
std::string url
Optional. URL of the result.
InlineQueryResultArticle(const nl::json &json)
std::string title
Title of the result.
Represents a link to an MP3 audio file. By default, this audio file will be sent by the user....
std::string performer
Optional. Performer.
void fromJson(const nl::json &json) override
std::string parseMode
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video. This field is required if InlineQue...
std::int32_t audioDuration
Optional. Audio duration in seconds.
InlineQueryResultAudio(const nl::json &json)
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string caption
Optional. Caption, 0-1024 characters after entities parsing.
std::string audioUrl
A valid URL for the audio file.
nl::json toJson() const override
Represents a link to an MP3 audio file stored on the Telegram servers. By default,...
std::string parseMode
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
void fromJson(const nl::json &json) override
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the voice caption, which can be specified instead o...
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the audio.
std::string caption
Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing.
std::string audioFileId
A valid file identifier for the audio file.
Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the...
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the document.
std::string caption
Optional. Caption of the document to be sent, 0-1024 characters after entities parsing.
std::string title
Title for the result.
void fromJson(const nl::json &json) override
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string description
Optional. Short description of the result.
std::string documentFileId
A valid file identifier for the file.
std::string parseMode
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
Represents a link to an animated GIF file stored on the Telegram servers. By default,...
std::string parseMode
Optional. Mode for parsing entities in the GIF caption. See formatting options for more details.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the GIF.
void fromJson(const nl::json &json) override
std::string gifFileId
A valid file identifier for the GIF file.
std::string title
Optional. Title for the result.
std::string caption
Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing.
InlineQueryResultCachedGif(const nl::json &json)
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram ...
std::string parseMode
Optional. Mode for parsing entities in the MPEG-4 caption. See formatting options for more details.
std::string title
Optional. Title for the result.
std::string mpeg4FileId
A valid file identifier for the MPEG4 file.
Ptr< InputMessageContent > inputMessageContent
Optional. Optional. Content of the message to be sent instead of the video animation.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string caption
Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing.
void fromJson(const nl::json &json) override
Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by t...
void fromJson(const nl::json &json) override
std::string photoFileId
A valid file identifier of the photo.
std::string caption
Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the photo.
std::string description
Optional. Short description of the result.
std::string parseMode
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
std::string title
Optional. Title for the result.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent ...
void fromJson(const nl::json &json) override
Ptr< InputMessageContent > inputMessageContent
Optional. Optional. Content of the message to be sent instead of the sticker.
std::string stickerFileId
A valid file identifier of the sticker.
Represents a link to a video file stored on the Telegram servers. By default, this video file will be...
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the video caption, which can be specified instead o...
std::string videoFileId
A valid file identifier for the video file.
std::string description
Optional. Short description of the result.
void fromJson(const nl::json &json) override
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video.
std::string title
Title for the result.
std::string parseMode
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
std::string caption
Optional. Caption of the video to be sent, 0-1024 characters after entities parsing.
Represents a link to a voice message stored on the Telegram servers. By default, this voice message w...
std::string parseMode
Optional. Mode for parsing entities in the voice caption. See formatting options for more details.
std::string voiceFileId
A valid file identifier for the voice message.
std::string title
Voice message title.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the voice caption, which can be specified instead o...
std::string caption
Optional. Caption of the voice to be sent, 0-1024 characters after entities parsing.
std::string description
Optional. Short description of the result.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the voice.
void fromJson(const nl::json &json) override
Represents a venue. By default, the venue will be sent by the user. Alternatively,...
InlineQueryResultContact(const nl::json &json)
std::string firstName
Contact's first name.
std::int32_t thumbnailHeight
Optional. Thumbnail height;.
std::string vcard
Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes.
std::string phoneNumber
Contact's phone number.
std::int32_t thumbnailWidth
Optional. Thumbnail width;.
std::string thumbnailUrl
Optional. Url of the thumbnail for the result.
std::string lastName
Optional. Contact's last name.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the contact.
void fromJson(const nl::json &json) override
Represents a link to a file. By default, this file will be sent by the user with an optional caption....
std::string documentUrl
A valid URL for the file.
std::string parseMode
Optional. Mode for parsing entities in the document caption. See formatting options for more details.
std::int32_t thumbnailHeight
Optional. Thumbnail height;.
void fromJson(const nl::json &json) override
std::int32_t thumbnailWidth
Optional. Thumbnail width;.
std::string description
Optional. Short description of the result.
std::string thumbnailUrl
Optional. URL of the thumbnail (JPEG only) for the file.
InlineQueryResultDocument(const nl::json &json)
std::string caption
Optional. Caption of the document to be sent, 0-1024 characters after entities parsing.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video. This field is required if InlineQue...
std::string title
Title for the result.
std::string mimeType
MIME type of the content of the file, either “application/pdf” or “application/zip”
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
InlineQueryResultGame(const nl::json &json)
nl::json toJson() const override
void fromJson(const nl::json &json) override
std::string gameShortName
Short name of the game.
Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the use...
std::string parseMode
Optional. Mode for parsing entities in the caption. See formatting options for more details.
std::string title
Optional. Title for the result.
std::string caption
Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing.
std::string gifUrl
A valid URL for the GIF file. File size must not exceed 1MB.
std::int32_t gifWidth
Optional. Width of the GIF.
void fromJson(const nl::json &json) override
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string thumbnailUrl
URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
std::int32_t gifHeight
Optional. Height of the GIF.
std::int32_t gifDuration
Optional. Duration of the GIF in seconds.
InlineQueryResultGif(const nl::json &json)
std::string thumbnailMimeType
Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”....
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the GIF animation.
nl::json toJson() const override
Base class of all inline query results This object represents one result of an inline query....
InlineQueryResult(const nl::json &json)
std::string type
Type of the result.
virtual nl::json toJson() const
virtual void fromJson(const nl::json &json)
Ptr< InlineKeyboardMarkup > replyMarkup
Optional. Inline keyboard attached to the message.
virtual ~InlineQueryResult()=default
std::string id
Unique identifier for this result, 1-64 bytes.
Represents a location on a map. By default, the location will be sent by the user....
InlineQueryResultLocation(const nl::json &json)
std::int32_t livePeriod
Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
void fromJson(const nl::json &json) override
std::int32_t heading
Optional. For live locations, a direction in which the user is moving, in degrees....
std::string thumbnailUrl
Optional. URL of the thumbnail (JPEG only) for the file.
float latitude
Location latitude in degrees.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the location.
std::int32_t thumbnailHeight
Optional. Thumbnail height;.
std::int32_t proximityAlertRadius
Optional. For live locations, a maximum distance for proximity alerts about approaching another chat ...
float horizontalAccuracy
Optional. The radius of uncertainty for the location, measured in meters; 0-1500.
std::int32_t thumbnailWidth
Optional. Thumbnail width;.
float longitude
Location longitude in degrees.
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default,...
std::int32_t mpeg4Width
Optional. Video width.
std::string thumbnailUrl
URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
std::int32_t mpeg4Duration
Optional. Video duration in seconds.
std::string mpeg4Url
A valid URL for the MPEG4 file. File size must not exceed 1MB.
std::string parseMode
Optional. Mode for parsing entities in the caption. See formatting options for more details.
InlineQueryResultMpeg4Gif(const nl::json &json)
std::string caption
Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing.
std::int32_t mpeg4Height
Optional. Video height.
std::string thumbnailMimeType
Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”....
void fromJson(const nl::json &json) override
std::string title
Optional. Title for the result.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video animation.
Represents a link to a photo. By default, this photo will be sent by the user with optional caption....
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the photo.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
InlineQueryResultPhoto(const nl::json &json)
std::string title
Optional. Title for the result.
void fromJson(const nl::json &json) override
std::string photoUrl
A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB.
std::string caption
Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing.
std::int32_t photoHeight
Optional. Height of the photo.
std::string thumbnailUrl
URL of the thumbnail for the photo.
nl::json toJson() const override
std::string parseMode
Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
std::string description
Optional. Short description of the result.
std::int32_t photoWidth
Optional. Width of the photo.
Represents a venue. By default, the venue will be sent by the user. Alternatively,...
std::string title
Title of the venue.
std::string googlePlaceId
Optional. Google Places identifier of the venue.
float longitude
Longitude of the venue location in degrees.
std::string foursquareType
Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”,...
std::int32_t thumbnailHeight
Optional. Thumbnail height;.
std::string address
Address of the venue.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the venue.
nl::json toJson() const override
float latitude
Latitude of the venue location in degrees.
std::string googlePlaceType
Optional. Google Places type of the venue. (See supported types.)
std::string foursquareId
Optional. Foursquare identifier of the venue if known.
std::int32_t thumbnailWidth
Optional. Thumbnail width;.
InlineQueryResultVenue(const nl::json &json)
void fromJson(const nl::json &json) override
std::string thumbnailUrl
Optional. URL of the thumbnail (JPEG only) for the file.
Represents a link to a page containing an embedded video player or a video file. By default,...
std::string title
Optional. Title for the result.
std::int32_t videoWidth
Optional. Video width.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
std::string mimeType
MIME type of the content of the video URL, “text/html” or “video/mp4”
std::string parseMode
Optional. Mode for parsing entities in the video caption. See formatting options for more details.
std::string caption
Optional. Caption of the video to be sent, 0-1024 characters after entities parsing.
std::string description
Optional. Short description of the result.
std::string thumbnailUrl
URL of the thumbnail (JPEG only) for the video.
std::int32_t videoHeight
Optional. Video height.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video. This field is required if InlineQue...
InlineQueryResultVideo(const nl::json &json)
std::string videoUrl
A valid URL for the embedded video player or video file.
nl::json toJson() const override
void fromJson(const nl::json &json) override
std::int32_t videoDuration
Optional. Video duration in seconds.
Represents a link to a voice recording in an .OGG container encoded with OPUS. By default,...
std::string parseMode
Optional. Mode for parsing entities in the voice caption. See formatting options for more details.
std::vector< Ptr< MessageEntity > > captionEntities
Optional. List of special entities that appear in the caption, which can be specified instead of pars...
nl::json toJson() const override
std::string title
Recording title.
std::string voiceUrl
A valid URL for the voice recording.
std::string performer
Optional. Performer.
std::string caption
Optional. Caption, 0-1024 characters after entities parsing.
Ptr< InputMessageContent > inputMessageContent
Optional. Content of the message to be sent instead of the video. This field is required if InlineQue...
void fromJson(const nl::json &json) override
InlineQueryResultVoice(const nl::json &json)
std::int32_t voiceDuration
Optional. Recording duration in seconds.