tgbotxx 1.1.6.9
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
39 std::string type;
40
42 std::string id;
43
46
47 virtual nl::json toJson() const {
48 nl::json json = nl::json::object();
49 OBJECT_SERIALIZE_FIELD(json, "type", type);
50 OBJECT_SERIALIZE_FIELD(json, "id", id);
51 OBJECT_SERIALIZE_FIELD_PTR(json, "reply_markup", replyMarkup);
52 return json;
53 }
54
55 virtual void fromJson(const nl::json& json) {
56 OBJECT_DESERIALIZE_FIELD(json, "type", type, "", false);
57 OBJECT_DESERIALIZE_FIELD(json, "id", id, "", false);
58 OBJECT_DESERIALIZE_FIELD_PTR(json, "reply_markup", replyMarkup, true);
59 }
60
61 private:
62 void _fromJson(const nl::json& json) { // to avoid calling virtual method fromJson() from constructor
63 fromJson(json);
64 }
65 };
66
67
74 explicit InlineQueryResultArticle(const nl::json& json) : InlineQueryResult(json) {
75 InlineQueryResult::type = "article";
76 }
77
79 std::string title;
80
83
85 std::string url;
86
88 bool hideUrl{};
89
91 std::string description;
92
94 std::string thumbnailUrl;
95
97 std::int32_t thumbnailWidth{};
98
100 std::int32_t thumbnailHeight{};
101
102 nl::json toJson() const override {
103 nl::json json = InlineQueryResult::toJson();
104 OBJECT_SERIALIZE_FIELD(json, "title", title);
105 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
106 OBJECT_SERIALIZE_FIELD(json, "url", url);
107 OBJECT_SERIALIZE_FIELD(json, "hide_url", hideUrl);
108 OBJECT_SERIALIZE_FIELD(json, "description", description);
109 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
110 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
111 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
112 return json;
113 }
114
115 void fromJson(const nl::json& json) override {
117 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
118 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, false);
119 OBJECT_DESERIALIZE_FIELD(json, "url", url, "", true);
120 OBJECT_DESERIALIZE_FIELD(json, "hide_url", hideUrl, false, true);
121 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
122 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
123 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
124 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
125 }
126 };
127
135 explicit InlineQueryResultPhoto(const nl::json& json) : InlineQueryResult(json) {
136 InlineQueryResult::type = "photo";
137 }
138
140 std::string photoUrl;
141
143 std::string thumbnailUrl;
144
146 std::int32_t photoWidth{};
147
149 std::int32_t photoHeight{};
150
152 std::string title;
153
155 std::string description;
156
158 std::string caption;
159
161 std::string parseMode;
162
164 std::vector<Ptr<MessageEntity>> captionEntities;
165
168
169 nl::json toJson() const override {
170 nl::json json = InlineQueryResult::toJson();
171 OBJECT_SERIALIZE_FIELD(json, "photo_url", photoUrl);
172 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
173 OBJECT_SERIALIZE_FIELD(json, "photo_width", photoWidth);
174 OBJECT_SERIALIZE_FIELD(json, "photo_height", photoHeight);
175 OBJECT_SERIALIZE_FIELD(json, "title", title);
176 OBJECT_SERIALIZE_FIELD(json, "description", description);
177 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
178 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
179 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
180 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
181 return json;
182 }
183
184 void fromJson(const nl::json& json) override {
186 OBJECT_DESERIALIZE_FIELD(json, "photo_url", photoUrl, "", false);
187 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
188 OBJECT_DESERIALIZE_FIELD(json, "photo_width", photoWidth, 0, true);
189 OBJECT_DESERIALIZE_FIELD(json, "photo_height", photoHeight, 0, true);
190 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
191 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
192 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
193 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
194 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
195 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
196 }
197 };
198
206 explicit InlineQueryResultGif(const nl::json& json) : InlineQueryResult(json) {
208 }
209
211 std::string gifUrl;
212
214 std::int32_t gifWidth{};
215
217 std::int32_t gifHeight{};
218
220 std::int32_t gifDuration{};
221
223 std::string thumbnailUrl;
224
226 std::string thumbnailMimeType;
227
229 std::string title;
230
232 std::string caption;
233
235 std::string parseMode;
236
238 std::vector<Ptr<MessageEntity>> captionEntities;
239
242
243 nl::json toJson() const override {
244 nl::json json = InlineQueryResult::toJson();
245 OBJECT_SERIALIZE_FIELD(json, "gif_url", gifUrl);
246 OBJECT_SERIALIZE_FIELD(json, "gif_width", gifWidth);
247 OBJECT_SERIALIZE_FIELD(json, "gif_height", gifHeight);
248 OBJECT_SERIALIZE_FIELD(json, "gif_duration", gifDuration);
249 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
250 OBJECT_SERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType);
251 OBJECT_SERIALIZE_FIELD(json, "title", title);
252 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
253 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
254 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
255 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
256 return json;
257 }
258
259 void fromJson(const nl::json& json) override {
261 OBJECT_DESERIALIZE_FIELD(json, "gif_url", gifUrl, "", false);
262 OBJECT_DESERIALIZE_FIELD(json, "gif_width", gifWidth, 0, true);
263 OBJECT_DESERIALIZE_FIELD(json, "gif_height", gifHeight, 0, true);
264 OBJECT_DESERIALIZE_FIELD(json, "gif_duration", gifDuration, 0, true);
265 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
266 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType, "", true);
267 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
268 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
269 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
270 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
271 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
272 }
273 };
274
283 explicit InlineQueryResultMpeg4Gif(const nl::json& json) : InlineQueryResult(json) {
284 InlineQueryResult::type = "mpeg4_gif";
285 }
286
288 std::string mpeg4Url;
289
291 std::int32_t mpeg4Width{};
292
294 std::int32_t mpeg4Height{};
295
297 std::int32_t mpeg4Duration{};
298
300 std::string thumbnailUrl;
301
303 std::string thumbnailMimeType;
304
306 std::string title;
307
309 std::string caption;
310
312 std::string parseMode;
313
315 std::vector<Ptr<MessageEntity>> captionEntities;
316
319
320 nl::json toJson() const override {
321 nl::json json = InlineQueryResult::toJson();
322 OBJECT_SERIALIZE_FIELD(json, "mpeg4_url", mpeg4Url);
323 OBJECT_SERIALIZE_FIELD(json, "mpeg4_width", mpeg4Width);
324 OBJECT_SERIALIZE_FIELD(json, "mpeg4_height", mpeg4Height);
325 OBJECT_SERIALIZE_FIELD(json, "mpeg4_duration", mpeg4Duration);
326 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
327 OBJECT_SERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType);
328 OBJECT_SERIALIZE_FIELD(json, "title", title);
329 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
330 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
331 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
332 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
333 return json;
334 }
335
336 void fromJson(const nl::json& json) override {
338 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_url", mpeg4Url, "", false);
339 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_width", mpeg4Width, 0, true);
340 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_height", mpeg4Height, 0, true);
341 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_duration", mpeg4Duration, 0, true);
342 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
343 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_mime_type", thumbnailMimeType, "", true);
344 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
345 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
346 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
347 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
348 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
349 }
350 };
351
352
362 explicit InlineQueryResultVideo(const nl::json& json) : InlineQueryResult(json) {
363 InlineQueryResult::type = "video";
364 }
365
367 std::string videoUrl;
368
370 std::string mimeType;
371
373 std::string title;
374
376 std::string thumbnailUrl;
377
379 std::string caption;
380
382 std::string parseMode;
383
385 std::vector<Ptr<MessageEntity>> captionEntities;
386
388 std::int32_t videoWidth{};
389
391 std::int32_t videoHeight{};
392
394 std::int32_t videoDuration{};
395
397 std::string description;
398
402
403 nl::json toJson() const override {
404 nl::json json = InlineQueryResult::toJson();
405 OBJECT_SERIALIZE_FIELD(json, "video_url", videoUrl);
406 OBJECT_SERIALIZE_FIELD(json, "mime_type", mimeType);
407 OBJECT_SERIALIZE_FIELD(json, "title", title);
408 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
409 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
410 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
411 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
412 OBJECT_SERIALIZE_FIELD(json, "video_width", videoWidth);
413 OBJECT_SERIALIZE_FIELD(json, "video_height", videoHeight);
414 OBJECT_SERIALIZE_FIELD(json, "video_duration", videoDuration);
415 OBJECT_SERIALIZE_FIELD(json, "description", description);
416 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
417 return json;
418 }
419
420 void fromJson(const nl::json& json) override {
422 OBJECT_DESERIALIZE_FIELD(json, "video_url", videoUrl, "", false);
423 OBJECT_DESERIALIZE_FIELD(json, "mime_type", mimeType, "", false);
424 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
425 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", false);
426 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
427 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
428 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
429 OBJECT_DESERIALIZE_FIELD(json, "video_width", videoWidth, 0, true);
430 OBJECT_DESERIALIZE_FIELD(json, "video_height", videoHeight, 0, true);
431 OBJECT_DESERIALIZE_FIELD(json, "video_duration", videoDuration, 0, true);
432 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
433 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
434 }
435 };
436
437
445 explicit InlineQueryResultAudio(const nl::json& json) : InlineQueryResult(json) {
446 InlineQueryResult::type = "audio";
447 }
448
450 std::string audioUrl;
451
453 std::string title;
454
456 std::string caption;
457
459 std::string parseMode;
460
462 std::vector<Ptr<MessageEntity>> captionEntities;
463
465 std::string performer;
466
468 std::int32_t audioDuration{};
469
473
474 nl::json toJson() const override {
475 nl::json json = InlineQueryResult::toJson();
476 OBJECT_SERIALIZE_FIELD(json, "audio_url", audioUrl);
477 OBJECT_SERIALIZE_FIELD(json, "title", title);
478 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
479 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
480 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
481 OBJECT_SERIALIZE_FIELD(json, "performer", performer);
482 OBJECT_SERIALIZE_FIELD(json, "audio_duration", audioDuration);
483 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
484 return json;
485 }
486
487 void fromJson(const nl::json& json) override {
489 OBJECT_DESERIALIZE_FIELD(json, "audio_url", audioUrl, "", false);
490 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
491 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
492 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
493 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
494 OBJECT_DESERIALIZE_FIELD(json, "performer", performer, "", true);
495 OBJECT_DESERIALIZE_FIELD(json, "audio_duration", audioDuration, 0, true);
496 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
497 }
498 };
499
500
509 explicit InlineQueryResultVoice(const nl::json& json) : InlineQueryResult(json) {
510 InlineQueryResult::type = "voice";
511 }
512
514 std::string voiceUrl;
515
517 std::string title;
518
520 std::string caption;
521
523 std::string parseMode;
524
526 std::vector<Ptr<MessageEntity>> captionEntities;
527
529 std::string performer;
530
532 std::int32_t voiceDuration{};
533
537
538 nl::json toJson() const override {
539 nl::json json = InlineQueryResult::toJson();
540 OBJECT_SERIALIZE_FIELD(json, "voice_url", voiceUrl);
541 OBJECT_SERIALIZE_FIELD(json, "title", title);
542 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
543 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
544 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
545 OBJECT_SERIALIZE_FIELD(json, "performer", performer);
546 OBJECT_SERIALIZE_FIELD(json, "voice_duration", voiceDuration);
547 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
548 return json;
549 }
550
551 void fromJson(const nl::json& json) override {
553 OBJECT_DESERIALIZE_FIELD(json, "audio_url", voiceUrl, "", false);
554 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
555 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
556 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
557 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
558 OBJECT_DESERIALIZE_FIELD(json, "performer", performer, "", true);
559 OBJECT_DESERIALIZE_FIELD(json, "voice_duration", voiceDuration, 0, true);
560 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
561 }
562 };
563
572 explicit InlineQueryResultDocument(const nl::json& json) : InlineQueryResult(json) {
573 InlineQueryResult::type = "document";
574 }
575
577 std::string title;
578
580 std::string caption;
581
583 std::string parseMode;
584
586 std::vector<Ptr<MessageEntity>> captionEntities;
587
589 std::string documentUrl;
590
592 std::string mimeType;
593
595 std::string description;
596
600
602 std::string thumbnailUrl;
603
605 std::int32_t thumbnailWidth{};
606
608 std::int32_t thumbnailHeight{};
609
610 nl::json toJson() const override {
611 nl::json json = InlineQueryResult::toJson();
612 OBJECT_SERIALIZE_FIELD(json, "title", title);
613 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
614 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
615 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
616 OBJECT_SERIALIZE_FIELD(json, "document_url", documentUrl);
617 OBJECT_SERIALIZE_FIELD(json, "mime_type", mimeType);
618 OBJECT_SERIALIZE_FIELD(json, "description", description);
619 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
620 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
621 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
622 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
623 return json;
624 }
625
626 void fromJson(const nl::json& json) override {
628 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
629 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
630 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
631 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
632 OBJECT_DESERIALIZE_FIELD(json, "document_url", documentUrl, "", false);
633 OBJECT_DESERIALIZE_FIELD(json, "mime_type", mimeType, "", false);
634 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
635 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
636 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
637 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
638 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
639 }
640 };
641
649 explicit InlineQueryResultLocation(const nl::json& json) : InlineQueryResult(json) {
650 InlineQueryResult::type = "location";
651 }
652
654 float latitude{};
655
657 float longitude{};
658
660 std::string title;
661
664
666 std::int32_t livePeriod{};
667
669 std::int32_t heading{};
670
673 std::int32_t proximityAlertRadius{};
674
677
679 std::string thumbnailUrl;
680
682 std::int32_t thumbnailWidth{};
683
685 std::int32_t thumbnailHeight{};
686
687 nl::json toJson() const override {
688 nl::json json = InlineQueryResult::toJson();
689 OBJECT_SERIALIZE_FIELD(json, "latitude", latitude);
690 OBJECT_SERIALIZE_FIELD(json, "longitude", longitude);
691 OBJECT_SERIALIZE_FIELD(json, "title", title);
692 OBJECT_SERIALIZE_FIELD(json, "horizontal_accuracy", horizontalAccuracy);
693 OBJECT_SERIALIZE_FIELD(json, "live_period", livePeriod);
694 OBJECT_SERIALIZE_FIELD(json, "heading", heading);
695 OBJECT_SERIALIZE_FIELD(json, "proximity_alert_radius", proximityAlertRadius);
696 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
697 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
698 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
699 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
700 return json;
701 }
702
703 void fromJson(const nl::json& json) override {
705 OBJECT_DESERIALIZE_FIELD(json, "latitude", latitude, 0.0f, false);
706 OBJECT_DESERIALIZE_FIELD(json, "longitude", longitude, 0.0f, false);
707 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
708 OBJECT_DESERIALIZE_FIELD(json, "horizontal_accuracy", horizontalAccuracy, 0.0f, true);
709 OBJECT_DESERIALIZE_FIELD(json, "live_period", livePeriod, 0, true);
710 OBJECT_DESERIALIZE_FIELD(json, "heading", heading, 0, true);
711 OBJECT_DESERIALIZE_FIELD(json, "proximity_alert_radius", proximityAlertRadius, 0, true);
712 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
713 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
714 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
715 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
716 }
717 };
718
725 explicit InlineQueryResultVenue(const nl::json& json) : InlineQueryResult(json) {
726 InlineQueryResult::type = "venue";
727 }
728
730 float latitude{};
731
733 float longitude{};
734
736 std::string title;
737
739 std::string address;
740
742 std::string foursquareId;
743
746 std::string foursquareType;
747
749 std::string googlePlaceId;
750
752 std::string googlePlaceType;
753
756
758 std::string thumbnailUrl;
759
761 std::int32_t thumbnailWidth{};
762
764 std::int32_t thumbnailHeight{};
765
766 nl::json toJson() const override {
767 nl::json json = InlineQueryResult::toJson();
768 OBJECT_SERIALIZE_FIELD(json, "latitude", latitude);
769 OBJECT_SERIALIZE_FIELD(json, "longitude", longitude);
770 OBJECT_SERIALIZE_FIELD(json, "title", title);
771 OBJECT_SERIALIZE_FIELD(json, "address", address);
772 OBJECT_SERIALIZE_FIELD(json, "foursquare_id", foursquareId);
773 OBJECT_SERIALIZE_FIELD(json, "foursquare_type", foursquareType);
774 OBJECT_SERIALIZE_FIELD(json, "google_place_id", googlePlaceId);
775 OBJECT_SERIALIZE_FIELD(json, "google_place_type", googlePlaceType);
776 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
777 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
778 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
779 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
780 return json;
781 }
782
783 void fromJson(const nl::json& json) override {
785 OBJECT_DESERIALIZE_FIELD(json, "latitude", latitude, 0.0f, false);
786 OBJECT_DESERIALIZE_FIELD(json, "longitude", longitude, 0.0f, false);
787 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
788 OBJECT_DESERIALIZE_FIELD(json, "address", address, "", false);
789 OBJECT_DESERIALIZE_FIELD(json, "foursquare_id", foursquareId, "", true);
790 OBJECT_DESERIALIZE_FIELD(json, "foursquare_type", foursquareType, "", true);
791 OBJECT_DESERIALIZE_FIELD(json, "google_place_id", googlePlaceId, "", true);
792 OBJECT_DESERIALIZE_FIELD(json, "google_place_type", googlePlaceType, "", true);
793 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
794 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
795 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
796 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
797 }
798 };
799
800
807 explicit InlineQueryResultContact(const nl::json& json) : InlineQueryResult(json) {
808 InlineQueryResult::type = "contact";
809 }
810
812 std::string phoneNumber;
813
815 std::string firstName;
816
818 std::string lastName;
819
821 std::string vcard;
822
825
827 std::string thumbnailUrl;
828
830 std::int32_t thumbnailWidth{};
831
833 std::int32_t thumbnailHeight{};
834
835 nl::json toJson() const override {
836 nl::json json = InlineQueryResult::toJson();
837 OBJECT_SERIALIZE_FIELD(json, "phone_number", phoneNumber);
838 OBJECT_SERIALIZE_FIELD(json, "first_name", firstName);
839 OBJECT_SERIALIZE_FIELD(json, "last_name", lastName);
840 OBJECT_SERIALIZE_FIELD(json, "vcard", vcard);
841 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
842 OBJECT_SERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl);
843 OBJECT_SERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth);
844 OBJECT_SERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight);
845 return json;
846 }
847
848 void fromJson(const nl::json& json) override {
850 OBJECT_DESERIALIZE_FIELD(json, "phone_number", phoneNumber, "", false);
851 OBJECT_DESERIALIZE_FIELD(json, "first_name", firstName, "", false);
852 OBJECT_DESERIALIZE_FIELD(json, "last_name", lastName, "", true);
853 OBJECT_DESERIALIZE_FIELD(json, "vcard", vcard, "", true);
854 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
855 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_url", thumbnailUrl, "", true);
856 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_width", thumbnailWidth, 0, true);
857 OBJECT_DESERIALIZE_FIELD(json, "thumbnail_height", thumbnailHeight, 0, true);
858 }
859 };
860
861
868 explicit InlineQueryResultGame(const nl::json& json) : InlineQueryResult(json) {
870 }
871
873 std::string gameShortName;
874
875 nl::json toJson() const override {
876 nl::json json = InlineQueryResult::toJson();
877 OBJECT_SERIALIZE_FIELD(json, "game_short_name", gameShortName);
878 return json;
879 }
880
881 void fromJson(const nl::json& json) override {
883 OBJECT_DESERIALIZE_FIELD(json, "game_short_name", gameShortName, "", false);
884 }
885 };
886
887
894 explicit InlineQueryResultCachedPhoto(const nl::json& json) : InlineQueryResult(json) {
895 InlineQueryResult::type = "photo";
896 }
897
899 std::string photoFileId;
900
902 std::string title;
903
905 std::string description;
906
908 std::string caption;
909
911 std::string parseMode;
912
914 std::vector<Ptr<MessageEntity>> captionEntities;
915
918
919
920 nl::json toJson() const override {
921 nl::json json = InlineQueryResult::toJson();
922 OBJECT_SERIALIZE_FIELD(json, "photo_file_id", photoFileId);
923 OBJECT_SERIALIZE_FIELD(json, "title", title);
924 OBJECT_SERIALIZE_FIELD(json, "description", description);
925 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
926 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
927 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
928 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
929 return json;
930 }
931
932 void fromJson(const nl::json& json) override {
934 OBJECT_DESERIALIZE_FIELD(json, "photo_file_id", photoFileId, "", false);
935 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
936 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
937 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
938 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
939 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
940 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
941 }
942 };
943
944
952 explicit InlineQueryResultCachedGif(const nl::json& json) : InlineQueryResult(json) {
954 }
955
957 std::string gifFileId;
958
960 std::string title;
961
963 std::string caption;
964
966 std::string parseMode;
967
969 std::vector<Ptr<MessageEntity>> captionEntities;
970
973
974
975 nl::json toJson() const override {
976 nl::json json = InlineQueryResult::toJson();
977 OBJECT_SERIALIZE_FIELD(json, "gif_file_id", gifFileId);
978 OBJECT_SERIALIZE_FIELD(json, "title", title);
979 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
980 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
981 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
982 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
983 return json;
984 }
985
986 void fromJson(const nl::json& json) override {
988 OBJECT_DESERIALIZE_FIELD(json, "gif_file_id", gifFileId, "", false);
989 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
990 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
991 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
992 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
993 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
994 }
995 };
996
1004 explicit InlineQueryResultCachedMpeg4Gif(const nl::json& json) : InlineQueryResult(json) {
1005 InlineQueryResult::type = "mpeg4_gif";
1006 }
1007
1009 std::string mpeg4FileId;
1010
1012 std::string title;
1013
1015 std::string caption;
1016
1018 std::string parseMode;
1019
1021 std::vector<Ptr<MessageEntity>> captionEntities;
1022
1025
1026
1027 nl::json toJson() const override {
1028 nl::json json = InlineQueryResult::toJson();
1029 OBJECT_SERIALIZE_FIELD(json, "mpeg4_file_id", mpeg4FileId);
1030 OBJECT_SERIALIZE_FIELD(json, "title", title);
1031 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1032 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1033 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1034 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1035 return json;
1036 }
1037
1038 void fromJson(const nl::json& json) override {
1040 OBJECT_DESERIALIZE_FIELD(json, "mpeg4_file_id", mpeg4FileId, "", false);
1041 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", true);
1042 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1043 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1044 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1045 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1046 }
1047 };
1048
1057 explicit InlineQueryResultCachedSticker(const nl::json& json) : InlineQueryResult(json) {
1058 InlineQueryResult::type = "sticker";
1059 }
1060
1062 std::string stickerFileId;
1063
1066
1067
1068 nl::json toJson() const override {
1069 nl::json json = InlineQueryResult::toJson();
1070 OBJECT_SERIALIZE_FIELD(json, "sticker_file_id", stickerFileId);
1071 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1072 return json;
1073 }
1074
1075 void fromJson(const nl::json& json) override {
1077 OBJECT_DESERIALIZE_FIELD(json, "sticker_file_id", stickerFileId, "", false);
1078 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1079 }
1080 };
1081
1082
1091 explicit InlineQueryResultCachedDocument(const nl::json& json) : InlineQueryResult(json) {
1092 InlineQueryResult::type = "document";
1093 }
1094
1096 std::string title;
1097
1099 std::string documentFileId;
1100
1102 std::string description;
1103
1105 std::string caption;
1106
1108 std::string parseMode;
1109
1111 std::vector<Ptr<MessageEntity>> captionEntities;
1112
1115
1116
1117 nl::json toJson() const override {
1118 nl::json json = InlineQueryResult::toJson();
1119 OBJECT_SERIALIZE_FIELD(json, "title", title);
1120 OBJECT_SERIALIZE_FIELD(json, "document_file_id", documentFileId);
1121 OBJECT_SERIALIZE_FIELD(json, "description", description);
1122 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1123 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1124 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1125 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1126 return json;
1127 }
1128
1129 void fromJson(const nl::json& json) override {
1131 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1132 OBJECT_DESERIALIZE_FIELD(json, "document_file_id", documentFileId, "", false);
1133 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1134 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1135 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1136 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1137 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1138 }
1139 };
1140
1141
1148 explicit InlineQueryResultCachedVideo(const nl::json& json) : InlineQueryResult(json) {
1149 InlineQueryResult::type = "video";
1150 }
1151
1153 std::string videoFileId;
1154
1156 std::string title;
1157
1159 std::string description;
1160
1162 std::string caption;
1163
1165 std::string parseMode;
1166
1168 std::vector<Ptr<MessageEntity>> captionEntities;
1169
1172
1173
1174 nl::json toJson() const override {
1175 nl::json json = InlineQueryResult::toJson();
1176 OBJECT_SERIALIZE_FIELD(json, "video_file_id", videoFileId);
1177 OBJECT_SERIALIZE_FIELD(json, "title", title);
1178 OBJECT_SERIALIZE_FIELD(json, "description", description);
1179 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1180 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1181 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1182 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1183 return json;
1184 }
1185
1186 void fromJson(const nl::json& json) override {
1188 OBJECT_DESERIALIZE_FIELD(json, "video_file_id", videoFileId, "", false);
1189 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1190 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1191 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1192 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1193 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1194 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1195 }
1196 };
1197
1198
1206 explicit InlineQueryResultCachedVoice(const nl::json& json) : InlineQueryResult(json) {
1207 InlineQueryResult::type = "voice";
1208 }
1209
1211 std::string voiceFileId;
1212
1214 std::string title;
1215
1217 std::string description;
1218
1220 std::string caption;
1221
1223 std::string parseMode;
1224
1226 std::vector<Ptr<MessageEntity>> captionEntities;
1227
1230
1231
1232 nl::json toJson() const override {
1233 nl::json json = InlineQueryResult::toJson();
1234 OBJECT_SERIALIZE_FIELD(json, "voice_file_id", voiceFileId);
1235 OBJECT_SERIALIZE_FIELD(json, "title", title);
1236 OBJECT_SERIALIZE_FIELD(json, "description", description);
1237 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1238 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1239 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1240 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1241 return json;
1242 }
1243
1244 void fromJson(const nl::json& json) override {
1246 OBJECT_DESERIALIZE_FIELD(json, "voice_file_id", voiceFileId, "", false);
1247 OBJECT_DESERIALIZE_FIELD(json, "title", title, "", false);
1248 OBJECT_DESERIALIZE_FIELD(json, "description", description, "", true);
1249 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1250 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1251 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1252 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1253 }
1254 };
1255
1256
1264 explicit InlineQueryResultCachedAudio(const nl::json& json) : InlineQueryResult(json) {
1265 InlineQueryResult::type = "audio";
1266 }
1267
1269 std::string audioFileId;
1270
1272 std::string caption;
1273
1275 std::string parseMode;
1276
1278 std::vector<Ptr<MessageEntity>> captionEntities;
1279
1282
1283
1284 nl::json toJson() const override {
1285 nl::json json = InlineQueryResult::toJson();
1286 OBJECT_SERIALIZE_FIELD(json, "audio_file_id", audioFileId);
1287 OBJECT_SERIALIZE_FIELD(json, "caption", caption);
1288 OBJECT_SERIALIZE_FIELD(json, "parse_mode", parseMode);
1289 OBJECT_SERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities);
1290 OBJECT_SERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent);
1291 return json;
1292 }
1293
1294 void fromJson(const nl::json& json) override {
1296 OBJECT_DESERIALIZE_FIELD(json, "audio_file_id", audioFileId, "", false);
1297 OBJECT_DESERIALIZE_FIELD(json, "caption", caption, "", true);
1298 OBJECT_DESERIALIZE_FIELD(json, "parse_mode", parseMode, "", true);
1299 OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, "caption_entities", captionEntities, true);
1300 OBJECT_DESERIALIZE_FIELD_PTR(json, "input_message_content", inputMessageContent, true);
1301 }
1302 };
1303
1304}
#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:70
#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:44
#define OBJECT_DESERIALIZE_FIELD_PTR_ARRAY(json, json_field, array_field, optional)
Definition Object.hpp:87
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.
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.