tgbotxx 1.2.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) {
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();
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
63
68 type = "article";
69 }
73
75 std::string title;
76
79
81 std::string url;
82
84 bool hideUrl{};
85
87 std::string description;
88
90 std::string thumbnailUrl;
91
93 std::int32_t thumbnailWidth{};
94
96 std::int32_t thumbnailHeight{};
97
98 nl::json toJson() const override {
101 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
103 OBJECT_SERIALIZE_FIELD(json, "hide_url", hideUrl);
104 OBJECT_SERIALIZE_FIELD(json, "description", description);
105 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
106 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
107 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
108 return json;
109 }
110
111 void fromJson(const nl::json& json) override {
113 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
114 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, false);
115 OBJECT_DESERIALIZE_FIELD(json, "url", url, "", true);
116 OBJECT_DESERIALIZE_FIELD(json, "hide_url", hideUrl, false, true);
117 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
118 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
119 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
120 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
121 }
122 };
123
129 type = "photo";
130 }
131 explicit InlineQueryResultPhoto(const nl::json& json) {
133 }
134
136 std::string photoUrl;
137
139 std::string thumbnailUrl;
140
142 std::int32_t photoWidth{};
143
145 std::int32_t photoHeight{};
146
148 std::string title;
149
151 std::string description;
152
154 std::string caption;
155
157 std::string parseMode;
158
160 std::vector<Ptr<MessageEntity>> captionEntities;
161
164
165 nl::json toJson() const override {
166 nl::json json = InlineQueryResult::toJson();
167 OBJECT_SERIALIZE_FIELD(json, "photo_url", photoUrl);
168 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
169 OBJECT_SERIALIZE_FIELD(json, "photo_width", photoWidth);
170 OBJECT_SERIALIZE_FIELD(json, "photo_height", photoHeight);
172 OBJECT_SERIALIZE_FIELD(json, "description", description);
174 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
176 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
177 return json;
178 }
179
180 void fromJson(const nl::json& json) override {
182 OBJECT_DESERIALIZE_FIELD(json, "photo_url", photoUrl, "", false);
183 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
184 OBJECT_DESERIALIZE_FIELD(json, "photo_width", photoWidth, 0, true);
185 OBJECT_DESERIALIZE_FIELD(json, "photo_height", photoHeight, 0, true);
186 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
187 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
188 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
189 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
190 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
191 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
192 }
193 };
194
200 type = "gif";
201 }
202 explicit InlineQueryResultGif(const nl::json& json) {
204 }
205
207 std::string gifUrl;
208
210 std::int32_t gifWidth{};
211
213 std::int32_t gifHeight{};
214
216 std::int32_t gifDuration{};
217
219 std::string thumbnailUrl;
220
222 std::string thumbnailMimeType;
223
225 std::string title;
226
228 std::string caption;
229
231 std::string parseMode;
232
234 std::vector<Ptr<MessageEntity>> captionEntities;
235
238
239 nl::json toJson() const override {
240 nl::json json = InlineQueryResult::toJson();
242 OBJECT_SERIALIZE_FIELD(json, "gif_width", gifWidth);
243 OBJECT_SERIALIZE_FIELD(json, "gif_height", gifHeight);
244 OBJECT_SERIALIZE_FIELD(json, "gif_duration", gifDuration);
245 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
246 OBJECT_SERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType);
249 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
251 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
252 return json;
253 }
254
255 void fromJson(const nl::json& json) override {
257 OBJECT_DESERIALIZE_FIELD(json, "gif_url", gifUrl, "", false);
258 OBJECT_DESERIALIZE_FIELD(json, "gif_width", gifWidth, 0, true);
259 OBJECT_DESERIALIZE_FIELD(json, "gif_height", gifHeight, 0, true);
260 OBJECT_DESERIALIZE_FIELD(json, "gif_duration", gifDuration, 0, true);
261 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
262 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType, "", true);
263 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
264 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
265 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
266 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
267 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
268 }
269 };
270
277 type = "mpeg4_gif";
278 }
282
284 std::string mpeg4Url;
285
287 std::int32_t mpeg4Width{};
288
290 std::int32_t mpeg4Height{};
291
293 std::int32_t mpeg4Duration{};
294
296 std::string thumbnailUrl;
297
299 std::string thumbnailMimeType;
300
302 std::string title;
303
305 std::string caption;
306
308 std::string parseMode;
309
311 std::vector<Ptr<MessageEntity>> captionEntities;
312
315
316 nl::json toJson() const override {
317 nl::json json = InlineQueryResult::toJson();
318 OBJECT_SERIALIZE_FIELD(json, "mpeg4_url", mpeg4Url);
319 OBJECT_SERIALIZE_FIELD(json, "mpeg4_width", mpeg4Width);
320 OBJECT_SERIALIZE_FIELD(json, "mpeg4_height", mpeg4Height);
321 OBJECT_SERIALIZE_FIELD(json, "mpeg4_duration", mpeg4Duration);
322 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
323 OBJECT_SERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType);
326 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
328 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
329 return json;
330 }
331
332 void fromJson(const nl::json& json) override {
334 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_url", mpeg4Url, "", false);
335 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_width", mpeg4Width, 0, true);
336 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_height", mpeg4Height, 0, true);
337 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_duration", mpeg4Duration, 0, true);
338 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
339 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType, "", true);
340 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
341 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
342 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
343 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
344 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
345 }
346 };
347
348
356 type = "video";
357 }
358 explicit InlineQueryResultVideo(const nl::json& json) {
360 }
361
363 std::string videoUrl;
364
366 std::string mimeType;
367
369 std::string title;
370
372 std::string thumbnailUrl;
373
375 std::string caption;
376
378 std::string parseMode;
379
381 std::vector<Ptr<MessageEntity>> captionEntities;
382
384 std::int32_t videoWidth{};
385
387 std::int32_t videoHeight{};
388
390 std::int32_t videoDuration{};
391
393 std::string description;
394
398
399 nl::json toJson() const override {
400 nl::json json = InlineQueryResult::toJson();
401 OBJECT_SERIALIZE_FIELD(json, "video_url", videoUrl);
402 OBJECT_SERIALIZE_FIELD(json, "mime_type", mimeType);
404 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
406 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
408 OBJECT_SERIALIZE_FIELD(json, "video_width", videoWidth);
409 OBJECT_SERIALIZE_FIELD(json, "video_height", videoHeight);
410 OBJECT_SERIALIZE_FIELD(json, "video_duration", videoDuration);
411 OBJECT_SERIALIZE_FIELD(json, "description", description);
412 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
413 return json;
414 }
415
416 void fromJson(const nl::json& json) override {
418 OBJECT_DESERIALIZE_FIELD(json, "video_url", videoUrl, "", false);
419 OBJECT_DESERIALIZE_FIELD(json, "mime_type", mimeType, "", false);
420 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
421 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
422 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
423 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
424 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
425 OBJECT_DESERIALIZE_FIELD(json, "video_width", videoWidth, 0, true);
426 OBJECT_DESERIALIZE_FIELD(json, "video_height", videoHeight, 0, true);
427 OBJECT_DESERIALIZE_FIELD(json, "video_duration", videoDuration, 0, true);
428 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
429 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
430 }
431 };
432
433
439 type = "audio";
440 }
441 explicit InlineQueryResultAudio(const nl::json& json) {
443 }
444
446 std::string audioUrl;
447
449 std::string title;
450
452 std::string caption;
453
455 std::string parseMode;
456
458 std::vector<Ptr<MessageEntity>> captionEntities;
459
461 std::string performer;
462
464 std::int32_t audioDuration{};
465
469
470 nl::json toJson() const override {
471 nl::json json = InlineQueryResult::toJson();
472 OBJECT_SERIALIZE_FIELD(json, "audio_url", audioUrl);
475 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
478 OBJECT_SERIALIZE_FIELD(json, "audio_duration", audioDuration);
479 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
480 return json;
481 }
482
483 void fromJson(const nl::json& json) override {
485 OBJECT_DESERIALIZE_FIELD(json, "audio_url", audioUrl, "", false);
486 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
487 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
488 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
489 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
490 OBJECT_DESERIALIZE_FIELD(json, "performer", performer, "", true);
491 OBJECT_DESERIALIZE_FIELD(json, "audio_duration", audioDuration, 0, true);
492 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
493 }
494 };
495
496
503 type = "voice";
504 }
505 explicit InlineQueryResultVoice(const nl::json& json) {
507 }
508
510 std::string voiceUrl;
511
513 std::string title;
514
516 std::string caption;
517
519 std::string parseMode;
520
522 std::vector<Ptr<MessageEntity>> captionEntities;
523
525 std::string performer;
526
528 std::int32_t voiceDuration{};
529
533
534 nl::json toJson() const override {
535 nl::json json = InlineQueryResult::toJson();
536 OBJECT_SERIALIZE_FIELD(json, "voice_url", voiceUrl);
539 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
542 OBJECT_SERIALIZE_FIELD(json, "voice_duration", voiceDuration);
543 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
544 return json;
545 }
546
547 void fromJson(const nl::json& json) override {
549 OBJECT_DESERIALIZE_FIELD(json, "audio_url", voiceUrl, "", false);
550 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
551 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
552 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
553 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
554 OBJECT_DESERIALIZE_FIELD(json, "performer", performer, "", true);
555 OBJECT_DESERIALIZE_FIELD(json, "voice_duration", voiceDuration, 0, true);
556 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
557 }
558 };
559
566 type = "document";
567 }
571
573 std::string title;
574
576 std::string caption;
577
579 std::string parseMode;
580
582 std::vector<Ptr<MessageEntity>> captionEntities;
583
585 std::string documentUrl;
586
588 std::string mimeType;
589
591 std::string description;
592
596
598 std::string thumbnailUrl;
599
601 std::int32_t thumbnailWidth{};
602
604 std::int32_t thumbnailHeight{};
605
606 nl::json toJson() const override {
607 nl::json json = InlineQueryResult::toJson();
610 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
612 OBJECT_SERIALIZE_FIELD(json, "document_url", documentUrl);
613 OBJECT_SERIALIZE_FIELD(json, "mime_type", mimeType);
614 OBJECT_SERIALIZE_FIELD(json, "description", description);
615 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
616 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
617 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
618 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
619 return json;
620 }
621
622 void fromJson(const nl::json& json) override {
624 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
625 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
626 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
627 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
628 OBJECT_DESERIALIZE_FIELD(json, "document_url", documentUrl, "", false);
629 OBJECT_DESERIALIZE_FIELD(json, "mime_type", mimeType, "", false);
630 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
631 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
632 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
633 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
634 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
635 }
636 };
637
643 type = "location";
644 }
648
650 float latitude{};
651
653 float longitude{};
654
656 std::string title;
657
660
662 std::int32_t livePeriod{};
663
665 std::int32_t heading{};
666
669 std::int32_t proximityAlertRadius{};
670
673
675 std::string thumbnailUrl;
676
678 std::int32_t thumbnailWidth{};
679
681 std::int32_t thumbnailHeight{};
682
683 nl::json toJson() const override {
684 nl::json json = InlineQueryResult::toJson();
688 OBJECT_SERIALIZE_FIELD(json, "horizontal_accuracy", horizontalAccuracy);
689 OBJECT_SERIALIZE_FIELD(json, "live_period", livePeriod);
691 OBJECT_SERIALIZE_FIELD(json, "proximity_alert_radius", proximityAlertRadius);
692 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
693 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
694 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
695 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
696 return json;
697 }
698
699 void fromJson(const nl::json& json) override {
701 OBJECT_DESERIALIZE_FIELD(json, "latitude", latitude, 0.0f, false);
702 OBJECT_DESERIALIZE_FIELD(json, "longitude", longitude, 0.0f, false);
703 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
704 OBJECT_DESERIALIZE_FIELD(json, "horizontal_accuracy", horizontalAccuracy, 0.0f, true);
705 OBJECT_DESERIALIZE_FIELD(json, "live_period", livePeriod, 0, true);
706 OBJECT_DESERIALIZE_FIELD(json, "heading", heading, 0, true);
707 OBJECT_DESERIALIZE_FIELD(json, "proximity_alert_radius", proximityAlertRadius, 0, true);
708 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
709 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
710 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
711 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
712 }
713 };
714
719 type = "venue";
720 }
721 explicit InlineQueryResultVenue(const nl::json& json) {
723 }
724
726 float latitude{};
727
729 float longitude{};
730
732 std::string title;
733
735 std::string address;
736
738 std::string foursquareId;
739
742 std::string foursquareType;
743
745 std::string googlePlaceId;
746
748 std::string googlePlaceType;
749
752
754 std::string thumbnailUrl;
755
757 std::int32_t thumbnailWidth{};
758
760 std::int32_t thumbnailHeight{};
761
762 nl::json toJson() const override {
763 nl::json json = InlineQueryResult::toJson();
768 OBJECT_SERIALIZE_FIELD(json, "foursquare_id", foursquareId);
769 OBJECT_SERIALIZE_FIELD(json, "foursquare_type", foursquareType);
770 OBJECT_SERIALIZE_FIELD(json, "google_place_id", googlePlaceId);
771 OBJECT_SERIALIZE_FIELD(json, "google_place_type", googlePlaceType);
772 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
773 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
774 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
775 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
776 return json;
777 }
778
779 void fromJson(const nl::json& json) override {
781 OBJECT_DESERIALIZE_FIELD(json, "latitude", latitude, 0.0f, false);
782 OBJECT_DESERIALIZE_FIELD(json, "longitude", longitude, 0.0f, false);
783 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
784 OBJECT_DESERIALIZE_FIELD(json, "address", address, "", false);
785 OBJECT_DESERIALIZE_FIELD(json, "foursquare_id", foursquareId, "", true);
786 OBJECT_DESERIALIZE_FIELD(json, "foursquare_type", foursquareType, "", true);
787 OBJECT_DESERIALIZE_FIELD(json, "google_place_id", googlePlaceId, "", true);
788 OBJECT_DESERIALIZE_FIELD(json, "google_place_type", googlePlaceType, "", true);
789 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
790 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
791 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
792 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
793 }
794 };
795
796
801 type = "contact";
802 }
806
808 std::string phoneNumber;
809
811 std::string firstName;
812
814 std::string lastName;
815
817 std::string vcard;
818
821
823 std::string thumbnailUrl;
824
826 std::int32_t thumbnailWidth{};
827
829 std::int32_t thumbnailHeight{};
830
831 nl::json toJson() const override {
832 nl::json json = InlineQueryResult::toJson();
833 OBJECT_SERIALIZE_FIELD(json, "phone_number", phoneNumber);
834 OBJECT_SERIALIZE_FIELD(json, "first_name", firstName);
835 OBJECT_SERIALIZE_FIELD(json, "last_name", lastName);
837 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
838 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
839 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
840 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
841 return json;
842 }
843
844 void fromJson(const nl::json& json) override {
846 OBJECT_DESERIALIZE_FIELD(json, "phone_number", phoneNumber, "", false);
847 OBJECT_DESERIALIZE_FIELD(json, "first_name", firstName, "", false);
848 OBJECT_DESERIALIZE_FIELD(json, "last_name", lastName, "", true);
849 OBJECT_DESERIALIZE_FIELD(json, "vcard", vcard, "", true);
850 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
851 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
852 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
853 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
854 }
855 };
856
857
862 type = "game";
863 }
864 explicit InlineQueryResultGame(const nl::json& json) {
866 }
867
869 std::string gameShortName;
870
871 nl::json toJson() const override {
872 nl::json json = InlineQueryResult::toJson();
873 OBJECT_SERIALIZE_FIELD(json, "game_short_name", gameShortName);
874 return json;
875 }
876
877 void fromJson(const nl::json& json) override {
879 OBJECT_DESERIALIZE_FIELD(json, "game_short_name", gameShortName, "", false);
880 }
881 };
882
883
888 type = "photo";
889 }
893
895 std::string photoFileId;
896
898 std::string title;
899
901 std::string description;
902
904 std::string caption;
905
907 std::string parseMode;
908
910 std::vector<Ptr<MessageEntity>> captionEntities;
911
914
915
916 nl::json toJson() const override {
917 nl::json json = InlineQueryResult::toJson();
918 OBJECT_SERIALIZE_FIELD(json, "photo_file_id", photoFileId);
920 OBJECT_SERIALIZE_FIELD(json, "description", description);
922 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
924 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
925 return json;
926 }
927
928 void fromJson(const nl::json& json) override {
930 OBJECT_DESERIALIZE_FIELD(json, "photo_file_id", photoFileId, "", false);
931 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
932 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
933 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
934 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
935 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
936 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
937 }
938 };
939
940
946 type = "gif";
947 }
951
953 std::string gifFileId;
954
956 std::string title;
957
959 std::string caption;
960
962 std::string parseMode;
963
965 std::vector<Ptr<MessageEntity>> captionEntities;
966
969
970
971 nl::json toJson() const override {
972 nl::json json = InlineQueryResult::toJson();
973 OBJECT_SERIALIZE_FIELD(json, "gif_file_id", gifFileId);
976 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
978 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
979 return json;
980 }
981
982 void fromJson(const nl::json& json) override {
984 OBJECT_DESERIALIZE_FIELD(json, "gif_file_id", gifFileId, "", false);
985 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
986 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
987 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
988 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
989 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
990 }
991 };
992
998 type = "mpeg4_gif";
999 }
1003
1005 std::string mpeg4FileId;
1006
1008 std::string title;
1009
1011 std::string caption;
1012
1014 std::string parseMode;
1015
1017 std::vector<Ptr<MessageEntity>> captionEntities;
1018
1021
1022
1023 nl::json toJson() const override {
1024 nl::json json = InlineQueryResult::toJson();
1025 OBJECT_SERIALIZE_FIELD(json, "mpeg4_file_id", mpeg4FileId);
1027 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1028 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1030 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1031 return json;
1032 }
1033
1034 void fromJson(const nl::json& json) override {
1036 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_file_id", mpeg4FileId, "", false);
1037 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
1038 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1039 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1040 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1041 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1042 }
1043 };
1044
1051 type = "sticker";
1052 }
1056
1058 std::string stickerFileId;
1059
1062
1063
1064 nl::json toJson() const override {
1065 nl::json json = InlineQueryResult::toJson();
1066 OBJECT_SERIALIZE_FIELD(json, "sticker_file_id", stickerFileId);
1067 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1068 return json;
1069 }
1070
1071 void fromJson(const nl::json& json) override {
1073 OBJECT_DESERIALIZE_FIELD(json, "sticker_file_id", stickerFileId, "", false);
1074 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1075 }
1076 };
1077
1078
1085 type = "document";
1086 }
1090
1092 std::string title;
1093
1095 std::string documentFileId;
1096
1098 std::string description;
1099
1101 std::string caption;
1102
1104 std::string parseMode;
1105
1107 std::vector<Ptr<MessageEntity>> captionEntities;
1108
1111
1112
1113 nl::json toJson() const override {
1114 nl::json json = InlineQueryResult::toJson();
1116 OBJECT_SERIALIZE_FIELD(json, "document_file_id", documentFileId);
1117 OBJECT_SERIALIZE_FIELD(json, "description", description);
1118 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1119 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1121 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1122 return json;
1123 }
1124
1125 void fromJson(const nl::json& json) override {
1127 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1128 OBJECT_DESERIALIZE_FIELD(json, "document_file_id", documentFileId, "", false);
1129 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1130 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1131 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1132 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1133 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1134 }
1135 };
1136
1137
1142 type = "video";
1143 }
1147
1149 std::string videoFileId;
1150
1152 std::string title;
1153
1155 std::string description;
1156
1158 std::string caption;
1159
1161 std::string parseMode;
1162
1164 std::vector<Ptr<MessageEntity>> captionEntities;
1165
1168
1169
1170 nl::json toJson() const override {
1171 nl::json json = InlineQueryResult::toJson();
1172 OBJECT_SERIALIZE_FIELD(json, "video_file_id", videoFileId);
1174 OBJECT_SERIALIZE_FIELD(json, "description", description);
1175 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1176 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1178 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1179 return json;
1180 }
1181
1182 void fromJson(const nl::json& json) override {
1184 OBJECT_DESERIALIZE_FIELD(json, "video_file_id", videoFileId, "", false);
1185 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1186 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1187 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1188 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1189 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1190 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1191 }
1192 };
1193
1194
1200 type = "voice";
1201 }
1205
1207 std::string voiceFileId;
1208
1210 std::string title;
1211
1213 std::string description;
1214
1216 std::string caption;
1217
1219 std::string parseMode;
1220
1222 std::vector<Ptr<MessageEntity>> captionEntities;
1223
1226
1227
1228 nl::json toJson() const override {
1229 nl::json json = InlineQueryResult::toJson();
1230 OBJECT_SERIALIZE_FIELD(json, "voice_file_id", voiceFileId);
1232 OBJECT_SERIALIZE_FIELD(json, "description", description);
1233 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1234 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1236 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1237 return json;
1238 }
1239
1240 void fromJson(const nl::json& json) override {
1242 OBJECT_DESERIALIZE_FIELD(json, "voice_file_id", voiceFileId, "", false);
1243 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1244 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1245 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1246 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1247 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1248 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1249 }
1250 };
1251
1252
1258 type = "audio";
1259 }
1263
1265 std::string audioFileId;
1266
1268 std::string caption;
1269
1271 std::string parseMode;
1272
1274 std::vector<Ptr<MessageEntity>> captionEntities;
1275
1278
1279
1280 nl::json toJson() const override {
1281 nl::json json = InlineQueryResult::toJson();
1282 OBJECT_SERIALIZE_FIELD(json, "audio_file_id", audioFileId);
1283 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1284 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1286 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1287 return json;
1288 }
1289
1290 void fromJson(const nl::json& json) override {
1292 OBJECT_DESERIALIZE_FIELD(json, "audio_file_id", audioFileId, "", false);
1293 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1294 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1295 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1296 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1297 }
1298 };
1299
1300}
#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.