-
Notifications
You must be signed in to change notification settings - Fork 2
/
TelegramModelsOnly.kt
6285 lines (5930 loc) · 396 KB
/
TelegramModelsOnly.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package com.github.omarmiatello.telegram
sealed class TelegramModel
sealed class InputMedia : TelegramModel()
sealed class InputMessageContent : TelegramModel()
sealed class InlineQueryResult : TelegramModel()
sealed class PassportElementError : TelegramModel()
sealed class ChatMember : TelegramModel()
sealed class BotCommandScope : TelegramModel()
sealed class ReactionType : TelegramModel()
sealed class MessageOrigin : TelegramModel()
sealed class ChatBoostSource : TelegramModel()
sealed class MenuButton : TelegramModel()
sealed class BackgroundFill : TelegramModel()
sealed class BackgroundType : TelegramModel()
sealed class RevenueWithdrawalState : TelegramModel()
sealed class TransactionPartner : TelegramModel()
sealed class PaidMedia : TelegramModel()
sealed class InputPaidMedia : TelegramModel()
sealed class KeyboardOption : TelegramModel()
sealed class MaybeInaccessibleMessage : TelegramModel()
sealed class InputFileOrString : TelegramModel()
sealed class IntegerOrString : TelegramModel()
data class TelegramResponse<T>(val ok: Boolean, val result: T? = null)
// --- Utility ---
enum class ParseMode { MarkdownV2, Markdown, HTML }
// --- Parameters & Responses ---
// Getting updates
/**
* <p>This <a href="#available-types">object</a> represents an incoming update.<br>At most <strong>one</strong> of the optional parameters can be present in any given update.</p>
*
* @property update_id The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you're using <a href="#setwebhook">webhooks</a>, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
* @property message <em>Optional</em>. New incoming message of any kind - text, photo, sticker, etc.
* @property edited_message <em>Optional</em>. New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
* @property channel_post <em>Optional</em>. New incoming channel post of any kind - text, photo, sticker, etc.
* @property edited_channel_post <em>Optional</em>. New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.
* @property business_connection <em>Optional</em>. The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot
* @property business_message <em>Optional</em>. New message from a connected business account
* @property edited_business_message <em>Optional</em>. New version of a message from a connected business account
* @property deleted_business_messages <em>Optional</em>. Messages were deleted from a connected business account
* @property message_reaction <em>Optional</em>. A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify <code>"message_reaction"</code> in the list of <em>allowed_updates</em> to receive these updates. The update isn't received for reactions set by bots.
* @property message_reaction_count <em>Optional</em>. Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify <code>"message_reaction_count"</code> in the list of <em>allowed_updates</em> to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.
* @property inline_query <em>Optional</em>. New incoming <a href="#inline-mode">inline</a> query
* @property chosen_inline_result <em>Optional</em>. The result of an <a href="#inline-mode">inline</a> query that was chosen by a user and sent to their chat partner. Please see our documentation on the <a href="/bots/inline#collecting-feedback">feedback collecting</a> for details on how to enable these updates for your bot.
* @property callback_query <em>Optional</em>. New incoming callback query
* @property shipping_query <em>Optional</em>. New incoming shipping query. Only for invoices with flexible price
* @property pre_checkout_query <em>Optional</em>. New incoming pre-checkout query. Contains full information about checkout
* @property poll <em>Optional</em>. New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot
* @property poll_answer <em>Optional</em>. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
* @property my_chat_member <em>Optional</em>. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
* @property chat_member <em>Optional</em>. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify <code>"chat_member"</code> in the list of <em>allowed_updates</em> to receive these updates.
* @property chat_join_request <em>Optional</em>. A request to join the chat has been sent. The bot must have the <em>can_invite_users</em> administrator right in the chat to receive these updates.
* @property chat_boost <em>Optional</em>. A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.
* @property removed_chat_boost <em>Optional</em>. A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.
*
* @constructor Creates a [Update].
* */
data class Update(
val update_id: Long,
val message: Message? = null,
val edited_message: Message? = null,
val channel_post: Message? = null,
val edited_channel_post: Message? = null,
val business_connection: BusinessConnection? = null,
val business_message: Message? = null,
val edited_business_message: Message? = null,
val deleted_business_messages: BusinessMessagesDeleted? = null,
val message_reaction: MessageReactionUpdated? = null,
val message_reaction_count: MessageReactionCountUpdated? = null,
val inline_query: InlineQuery? = null,
val chosen_inline_result: ChosenInlineResult? = null,
val callback_query: CallbackQuery? = null,
val shipping_query: ShippingQuery? = null,
val pre_checkout_query: PreCheckoutQuery? = null,
val poll: Poll? = null,
val poll_answer: PollAnswer? = null,
val my_chat_member: ChatMemberUpdated? = null,
val chat_member: ChatMemberUpdated? = null,
val chat_join_request: ChatJoinRequest? = null,
val chat_boost: ChatBoostUpdated? = null,
val removed_chat_boost: ChatBoostRemoved? = null,
) : TelegramModel()
/**
* <p>Describes the current status of a webhook.</p>
*
* @property url Webhook URL, may be empty if webhook is not set up
* @property has_custom_certificate <em>True</em>, if a custom certificate was provided for webhook certificate checks
* @property pending_update_count Number of updates awaiting delivery
* @property ip_address <em>Optional</em>. Currently used webhook IP address
* @property last_error_date <em>Optional</em>. Unix time for the most recent error that happened when trying to deliver an update via webhook
* @property last_error_message <em>Optional</em>. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
* @property last_synchronization_error_date <em>Optional</em>. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
* @property max_connections <em>Optional</em>. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
* @property allowed_updates <em>Optional</em>. A list of update types the bot is subscribed to. Defaults to all update types except <em>chat_member</em>
*
* @constructor Creates a [WebhookInfo].
* */
data class WebhookInfo(
val url: String,
val has_custom_certificate: Boolean,
val pending_update_count: Long,
val ip_address: String? = null,
val last_error_date: Long? = null,
val last_error_message: String? = null,
val last_synchronization_error_date: Long? = null,
val max_connections: Long? = null,
val allowed_updates: List<String>? = null,
) : TelegramModel()
// Available types
/**
* <p>This object represents a Telegram user or bot.</p>
*
* @property id Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
* @property is_bot <em>True</em>, if this user is a bot
* @property first_name User's or bot's first name
* @property last_name <em>Optional</em>. User's or bot's last name
* @property username <em>Optional</em>. User's or bot's username
* @property language_code <em>Optional</em>. <a href="https://en.wikipedia.org/wiki/IETF_language_tag">IETF language tag</a> of the user's language
* @property is_premium <em>Optional</em>. <em>True</em>, if this user is a Telegram Premium user
* @property added_to_attachment_menu <em>Optional</em>. <em>True</em>, if this user added the bot to the attachment menu
* @property can_join_groups <em>Optional</em>. <em>True</em>, if the bot can be invited to groups. Returned only in <a href="#getme">getMe</a>.
* @property can_read_all_group_messages <em>Optional</em>. <em>True</em>, if <a href="/bots/features#privacy-mode">privacy mode</a> is disabled for the bot. Returned only in <a href="#getme">getMe</a>.
* @property supports_inline_queries <em>Optional</em>. <em>True</em>, if the bot supports inline queries. Returned only in <a href="#getme">getMe</a>.
* @property can_connect_to_business <em>Optional</em>. <em>True</em>, if the bot can be connected to a Telegram Business account to receive its messages. Returned only in <a href="#getme">getMe</a>.
* @property has_main_web_app <em>Optional</em>. <em>True</em>, if the bot has a main Web App. Returned only in <a href="#getme">getMe</a>.
*
* @constructor Creates a [User].
* */
data class User(
val id: Long,
val is_bot: Boolean,
val first_name: String,
val last_name: String? = null,
val username: String? = null,
val language_code: String? = null,
val is_premium: Boolean? = null,
val added_to_attachment_menu: Boolean? = null,
val can_join_groups: Boolean? = null,
val can_read_all_group_messages: Boolean? = null,
val supports_inline_queries: Boolean? = null,
val can_connect_to_business: Boolean? = null,
val has_main_web_app: Boolean? = null,
) : TelegramModel()
/**
* <p>This object represents a chat.</p>
*
* @property id Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
* @property type Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
* @property title <em>Optional</em>. Title, for supergroups, channels and group chats
* @property username <em>Optional</em>. Username, for private chats, supergroups and channels if available
* @property first_name <em>Optional</em>. First name of the other party in a private chat
* @property last_name <em>Optional</em>. Last name of the other party in a private chat
* @property is_forum <em>Optional</em>. <em>True</em>, if the supergroup chat is a forum (has <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups">topics</a> enabled)
*
* @constructor Creates a [Chat].
* */
data class Chat(
val id: Long,
val type: String,
val title: String? = null,
val username: String? = null,
val first_name: String? = null,
val last_name: String? = null,
val is_forum: Boolean? = null,
) : TelegramModel()
/**
* <p>This object contains full information about a chat.</p>
*
* @property id Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
* @property type Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
* @property accent_color_id Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See <a href="#accent-colors">accent colors</a> for more details.
* @property max_reaction_count The maximum number of reactions that can be set on a message in the chat
* @property title <em>Optional</em>. Title, for supergroups, channels and group chats
* @property username <em>Optional</em>. Username, for private chats, supergroups and channels if available
* @property first_name <em>Optional</em>. First name of the other party in a private chat
* @property last_name <em>Optional</em>. Last name of the other party in a private chat
* @property is_forum <em>Optional</em>. <em>True</em>, if the supergroup chat is a forum (has <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups">topics</a> enabled)
* @property photo <em>Optional</em>. Chat photo
* @property active_usernames <em>Optional</em>. If non-empty, the list of all <a href="https://telegram.org/blog/topics-in-groups-collectible-usernames#collectible-usernames">active chat usernames</a>; for private chats, supergroups and channels
* @property birthdate <em>Optional</em>. For private chats, the date of birth of the user
* @property business_intro <em>Optional</em>. For private chats with business accounts, the intro of the business
* @property business_location <em>Optional</em>. For private chats with business accounts, the location of the business
* @property business_opening_hours <em>Optional</em>. For private chats with business accounts, the opening hours of the business
* @property personal_chat <em>Optional</em>. For private chats, the personal channel of the user
* @property available_reactions <em>Optional</em>. List of available reactions allowed in the chat. If omitted, then all <a href="#reactiontypeemoji">emoji reactions</a> are allowed.
* @property background_custom_emoji_id <em>Optional</em>. Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background
* @property profile_accent_color_id <em>Optional</em>. Identifier of the accent color for the chat's profile background. See <a href="#profile-accent-colors">profile accent colors</a> for more details.
* @property profile_background_custom_emoji_id <em>Optional</em>. Custom emoji identifier of the emoji chosen by the chat for its profile background
* @property emoji_status_custom_emoji_id <em>Optional</em>. Custom emoji identifier of the emoji status of the chat or the other party in a private chat
* @property emoji_status_expiration_date <em>Optional</em>. Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any
* @property bio <em>Optional</em>. Bio of the other party in a private chat
* @property has_private_forwards <em>Optional</em>. <em>True</em>, if privacy settings of the other party in the private chat allows to use <code>tg://user?id=<user_id></code> links only in chats with the user
* @property has_restricted_voice_and_video_messages <em>Optional</em>. <em>True</em>, if the privacy settings of the other party restrict sending voice and video note messages in the private chat
* @property join_to_send_messages <em>Optional</em>. <em>True</em>, if users need to join the supergroup before they can send messages
* @property join_by_request <em>Optional</em>. <em>True</em>, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators
* @property description <em>Optional</em>. Description, for groups, supergroups and channel chats
* @property invite_link <em>Optional</em>. Primary invite link, for groups, supergroups and channel chats
* @property pinned_message <em>Optional</em>. The most recent pinned message (by sending date)
* @property permissions <em>Optional</em>. Default chat member permissions, for groups and supergroups
* @property can_send_paid_media <em>Optional</em>. <em>True</em>, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.
* @property slow_mode_delay <em>Optional</em>. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds
* @property unrestrict_boost_count <em>Optional</em>. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions
* @property message_auto_delete_time <em>Optional</em>. The time after which all messages sent to the chat will be automatically deleted; in seconds
* @property has_aggressive_anti_spam_enabled <em>Optional</em>. <em>True</em>, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.
* @property has_hidden_members <em>Optional</em>. <em>True</em>, if non-administrators can only get the list of bots and administrators in the chat
* @property has_protected_content <em>Optional</em>. <em>True</em>, if messages from the chat can't be forwarded to other chats
* @property has_visible_history <em>Optional</em>. <em>True</em>, if new chat members will have access to old messages; available only to chat administrators
* @property sticker_set_name <em>Optional</em>. For supergroups, name of the group sticker set
* @property can_set_sticker_set <em>Optional</em>. <em>True</em>, if the bot can change the group sticker set
* @property custom_emoji_sticker_set_name <em>Optional</em>. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.
* @property linked_chat_id <em>Optional</em>. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.
* @property location <em>Optional</em>. For supergroups, the location to which the supergroup is connected
*
* @constructor Creates a [ChatFullInfo].
* */
data class ChatFullInfo(
val id: Long,
val type: String,
val accent_color_id: Long,
val max_reaction_count: Long,
val title: String? = null,
val username: String? = null,
val first_name: String? = null,
val last_name: String? = null,
val is_forum: Boolean? = null,
val photo: ChatPhoto? = null,
val active_usernames: List<String>? = null,
val birthdate: Birthdate? = null,
val business_intro: BusinessIntro? = null,
val business_location: BusinessLocation? = null,
val business_opening_hours: BusinessOpeningHours? = null,
val personal_chat: Chat? = null,
val available_reactions: List<ReactionType>? = null,
val background_custom_emoji_id: String? = null,
val profile_accent_color_id: Long? = null,
val profile_background_custom_emoji_id: String? = null,
val emoji_status_custom_emoji_id: String? = null,
val emoji_status_expiration_date: Long? = null,
val bio: String? = null,
val has_private_forwards: Boolean? = null,
val has_restricted_voice_and_video_messages: Boolean? = null,
val join_to_send_messages: Boolean? = null,
val join_by_request: Boolean? = null,
val description: String? = null,
val invite_link: String? = null,
val pinned_message: Message? = null,
val permissions: ChatPermissions? = null,
val can_send_paid_media: Boolean? = null,
val slow_mode_delay: Long? = null,
val unrestrict_boost_count: Long? = null,
val message_auto_delete_time: Long? = null,
val has_aggressive_anti_spam_enabled: Boolean? = null,
val has_hidden_members: Boolean? = null,
val has_protected_content: Boolean? = null,
val has_visible_history: Boolean? = null,
val sticker_set_name: String? = null,
val can_set_sticker_set: Boolean? = null,
val custom_emoji_sticker_set_name: String? = null,
val linked_chat_id: Long? = null,
val location: ChatLocation? = null,
) : TelegramModel()
/**
* <p>This object represents a message.</p>
*
* @property message_id Unique message identifier inside this chat
* @property date Date the message was sent in Unix time. It is always a positive number, representing a valid date.
* @property chat Chat the message belongs to
* @property message_thread_id <em>Optional</em>. Unique identifier of a message thread to which the message belongs; for supergroups only
* @property from <em>Optional</em>. Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats
* @property sender_chat <em>Optional</em>. Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel's discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field <em>from</em> contains a fake sender user in non-channel chats.
* @property sender_boost_count <em>Optional</em>. If the sender of the message boosted the chat, the number of boosts added by the user
* @property sender_business_bot <em>Optional</em>. The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.
* @property business_connection_id <em>Optional</em>. Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.
* @property forward_origin <em>Optional</em>. Information about the original message for forwarded messages
* @property is_topic_message <em>Optional</em>. <em>True</em>, if the message is sent to a forum topic
* @property is_automatic_forward <em>Optional</em>. <em>True</em>, if the message is a channel post that was automatically forwarded to the connected discussion group
* @property reply_to_message <em>Optional</em>. For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further <em>reply_to_message</em> fields even if it itself is a reply.
* @property external_reply <em>Optional</em>. Information about the message that is being replied to, which may come from another chat or forum topic
* @property quote <em>Optional</em>. For replies that quote part of the original message, the quoted part of the message
* @property reply_to_story <em>Optional</em>. For replies to a story, the original story
* @property via_bot <em>Optional</em>. Bot through which the message was sent
* @property edit_date <em>Optional</em>. Date the message was last edited in Unix time
* @property has_protected_content <em>Optional</em>. <em>True</em>, if the message can't be forwarded
* @property is_from_offline <em>Optional</em>. True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message
* @property media_group_id <em>Optional</em>. The unique identifier of a media message group this message belongs to
* @property author_signature <em>Optional</em>. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
* @property text <em>Optional</em>. For text messages, the actual UTF-8 text of the message
* @property entities <em>Optional</em>. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
* @property link_preview_options <em>Optional</em>. Options used for link preview generation for the message, if it is a text message and link preview options were changed
* @property effect_id <em>Optional</em>. Unique identifier of the message effect added to the message
* @property animation <em>Optional</em>. Message is an animation, information about the animation. For backward compatibility, when this field is set, the <em>document</em> field will also be set
* @property audio <em>Optional</em>. Message is an audio file, information about the file
* @property document <em>Optional</em>. Message is a general file, information about the file
* @property paid_media <em>Optional</em>. Message contains paid media; information about the paid media
* @property photo <em>Optional</em>. Message is a photo, available sizes of the photo
* @property sticker <em>Optional</em>. Message is a sticker, information about the sticker
* @property story <em>Optional</em>. Message is a forwarded story
* @property video <em>Optional</em>. Message is a video, information about the video
* @property video_note <em>Optional</em>. Message is a <a href="https://telegram.org/blog/video-messages-and-telescope">video note</a>, information about the video message
* @property voice <em>Optional</em>. Message is a voice message, information about the file
* @property caption <em>Optional</em>. Caption for the animation, audio, document, paid media, photo, video or voice
* @property caption_entities <em>Optional</em>. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
* @property show_caption_above_media <em>Optional</em>. True, if the caption must be shown above the message media
* @property has_media_spoiler <em>Optional</em>. <em>True</em>, if the message media is covered by a spoiler animation
* @property contact <em>Optional</em>. Message is a shared contact, information about the contact
* @property dice <em>Optional</em>. Message is a dice with random value
* @property game <em>Optional</em>. Message is a game, information about the game. <a href="#games">More about games »</a>
* @property poll <em>Optional</em>. Message is a native poll, information about the poll
* @property venue <em>Optional</em>. Message is a venue, information about the venue. For backward compatibility, when this field is set, the <em>location</em> field will also be set
* @property location <em>Optional</em>. Message is a shared location, information about the location
* @property new_chat_members <em>Optional</em>. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
* @property left_chat_member <em>Optional</em>. A member was removed from the group, information about them (this member may be the bot itself)
* @property new_chat_title <em>Optional</em>. A chat title was changed to this value
* @property new_chat_photo <em>Optional</em>. A chat photo was change to this value
* @property delete_chat_photo <em>Optional</em>. Service message: the chat photo was deleted
* @property group_chat_created <em>Optional</em>. Service message: the group has been created
* @property supergroup_chat_created <em>Optional</em>. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
* @property channel_chat_created <em>Optional</em>. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
* @property message_auto_delete_timer_changed <em>Optional</em>. Service message: auto-delete timer settings changed in the chat
* @property migrate_to_chat_id <em>Optional</em>. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
* @property migrate_from_chat_id <em>Optional</em>. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
* @property pinned_message <em>Optional</em>. Specified message was pinned. Note that the Message object in this field will not contain further <em>reply_to_message</em> fields even if it itself is a reply.
* @property invoice <em>Optional</em>. Message is an invoice for a <a href="#payments">payment</a>, information about the invoice. <a href="#payments">More about payments »</a>
* @property successful_payment <em>Optional</em>. Message is a service message about a successful payment, information about the payment. <a href="#payments">More about payments »</a>
* @property refunded_payment <em>Optional</em>. Message is a service message about a refunded payment, information about the payment. <a href="#payments">More about payments »</a>
* @property users_shared <em>Optional</em>. Service message: users were shared with the bot
* @property chat_shared <em>Optional</em>. Service message: a chat was shared with the bot
* @property connected_website <em>Optional</em>. The domain name of the website on which the user has logged in. <a href="/widgets/login">More about Telegram Login »</a>
* @property write_access_allowed <em>Optional</em>. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method <a href="/bots/webapps#initializing-mini-apps">requestWriteAccess</a>
* @property passport_data <em>Optional</em>. Telegram Passport data
* @property proximity_alert_triggered <em>Optional</em>. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
* @property boost_added <em>Optional</em>. Service message: user boosted the chat
* @property chat_background_set <em>Optional</em>. Service message: chat background set
* @property forum_topic_created <em>Optional</em>. Service message: forum topic created
* @property forum_topic_edited <em>Optional</em>. Service message: forum topic edited
* @property forum_topic_closed <em>Optional</em>. Service message: forum topic closed
* @property forum_topic_reopened <em>Optional</em>. Service message: forum topic reopened
* @property general_forum_topic_hidden <em>Optional</em>. Service message: the 'General' forum topic hidden
* @property general_forum_topic_unhidden <em>Optional</em>. Service message: the 'General' forum topic unhidden
* @property giveaway_created <em>Optional</em>. Service message: a scheduled giveaway was created
* @property giveaway <em>Optional</em>. The message is a scheduled giveaway message
* @property giveaway_winners <em>Optional</em>. A giveaway with public winners was completed
* @property giveaway_completed <em>Optional</em>. Service message: a giveaway without public winners was completed
* @property video_chat_scheduled <em>Optional</em>. Service message: video chat scheduled
* @property video_chat_started <em>Optional</em>. Service message: video chat started
* @property video_chat_ended <em>Optional</em>. Service message: video chat ended
* @property video_chat_participants_invited <em>Optional</em>. Service message: new participants invited to a video chat
* @property web_app_data <em>Optional</em>. Service message: data sent by a Web App
* @property reply_markup <em>Optional</em>. Inline keyboard attached to the message. <code>login_url</code> buttons are represented as ordinary <code>url</code> buttons.
*
* @constructor Creates a [Message].
* */
data class Message(
val message_id: Long,
val date: Long,
val chat: Chat,
val message_thread_id: Long? = null,
val from: User? = null,
val sender_chat: Chat? = null,
val sender_boost_count: Long? = null,
val sender_business_bot: User? = null,
val business_connection_id: String? = null,
val forward_origin: MessageOrigin? = null,
val is_topic_message: Boolean? = null,
val is_automatic_forward: Boolean? = null,
val reply_to_message: Message? = null,
val external_reply: ExternalReplyInfo? = null,
val quote: TextQuote? = null,
val reply_to_story: Story? = null,
val via_bot: User? = null,
val edit_date: Long? = null,
val has_protected_content: Boolean? = null,
val is_from_offline: Boolean? = null,
val media_group_id: String? = null,
val author_signature: String? = null,
val text: String? = null,
val entities: List<MessageEntity>? = null,
val link_preview_options: LinkPreviewOptions? = null,
val effect_id: String? = null,
val animation: Animation? = null,
val audio: Audio? = null,
val document: Document? = null,
val paid_media: PaidMediaInfo? = null,
val photo: List<PhotoSize>? = null,
val sticker: Sticker? = null,
val story: Story? = null,
val video: Video? = null,
val video_note: VideoNote? = null,
val voice: Voice? = null,
val caption: String? = null,
val caption_entities: List<MessageEntity>? = null,
val show_caption_above_media: Boolean? = null,
val has_media_spoiler: Boolean? = null,
val contact: Contact? = null,
val dice: Dice? = null,
val game: Game? = null,
val poll: Poll? = null,
val venue: Venue? = null,
val location: Location? = null,
val new_chat_members: List<User>? = null,
val left_chat_member: User? = null,
val new_chat_title: String? = null,
val new_chat_photo: List<PhotoSize>? = null,
val delete_chat_photo: Boolean? = null,
val group_chat_created: Boolean? = null,
val supergroup_chat_created: Boolean? = null,
val channel_chat_created: Boolean? = null,
val message_auto_delete_timer_changed: MessageAutoDeleteTimerChanged? = null,
val migrate_to_chat_id: Long? = null,
val migrate_from_chat_id: Long? = null,
val pinned_message: MaybeInaccessibleMessage? = null,
val invoice: Invoice? = null,
val successful_payment: SuccessfulPayment? = null,
val refunded_payment: RefundedPayment? = null,
val users_shared: UsersShared? = null,
val chat_shared: ChatShared? = null,
val connected_website: String? = null,
val write_access_allowed: WriteAccessAllowed? = null,
val passport_data: PassportData? = null,
val proximity_alert_triggered: ProximityAlertTriggered? = null,
val boost_added: ChatBoostAdded? = null,
val chat_background_set: ChatBackground? = null,
val forum_topic_created: ForumTopicCreated? = null,
val forum_topic_edited: ForumTopicEdited? = null,
val forum_topic_closed: Any? = null,
val forum_topic_reopened: Any? = null,
val general_forum_topic_hidden: Any? = null,
val general_forum_topic_unhidden: Any? = null,
val giveaway_created: Any? = null,
val giveaway: Giveaway? = null,
val giveaway_winners: GiveawayWinners? = null,
val giveaway_completed: GiveawayCompleted? = null,
val video_chat_scheduled: VideoChatScheduled? = null,
val video_chat_started: Any? = null,
val video_chat_ended: VideoChatEnded? = null,
val video_chat_participants_invited: VideoChatParticipantsInvited? = null,
val web_app_data: WebAppData? = null,
val reply_markup: InlineKeyboardMarkup? = null,
) : MaybeInaccessibleMessage()
/**
* <p>This object describes a message that was deleted or is otherwise inaccessible to the bot.</p>
*
* @property chat Chat the message belonged to
* @property message_id Unique message identifier inside the chat
* @property date Always 0. The field can be used to differentiate regular and inaccessible messages.
*
* @constructor Creates a [InaccessibleMessage].
* */
data class InaccessibleMessage(
val chat: Chat,
val message_id: Long,
val date: Long,
) : MaybeInaccessibleMessage()
/**
* <p>This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.</p>
*
* @property type Type of the entity. Currently, can be “mention” (<code>@username</code>), “hashtag” (<code>#hashtag</code>), “cashtag” (<code>$USD</code>), “bot_command” (<code>/start@jobs_bot</code>), “url” (<code>https://telegram.org</code>), “email” (<code>[email protected]</code>), “phone_number” (<code>+1-212-555-0123</code>), “bold” (<strong>bold text</strong>), “italic” (<em>italic text</em>), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users <a href="https://telegram.org/blog/edit#new-mentions">without usernames</a>), “custom_emoji” (for inline custom emoji stickers)
* @property offset Offset in <a href="/api/entities#entity-length">UTF-16 code units</a> to the start of the entity
* @property length Length of the entity in <a href="/api/entities#entity-length">UTF-16 code units</a>
* @property url <em>Optional</em>. For “text_link” only, URL that will be opened after user taps on the text
* @property user <em>Optional</em>. For “text_mention” only, the mentioned user
* @property language <em>Optional</em>. For “pre” only, the programming language of the entity text
* @property custom_emoji_id <em>Optional</em>. For “custom_emoji” only, unique identifier of the custom emoji. Use <a href="#getcustomemojistickers">getCustomEmojiStickers</a> to get full information about the sticker
*
* @constructor Creates a [MessageEntity].
* */
data class MessageEntity(
val type: String,
val offset: Long,
val length: Long,
val url: String? = null,
val user: User? = null,
val language: String? = null,
val custom_emoji_id: String? = null,
) : TelegramModel()
/**
* <p>This object contains information about the quoted part of a message that is replied to by the given message.</p>
*
* @property text Text of the quoted part of a message that is replied to by the given message
* @property position Approximate quote position in the original message in UTF-16 code units as specified by the sender
* @property entities <em>Optional</em>. Special entities that appear in the quote. Currently, only <em>bold</em>, <em>italic</em>, <em>underline</em>, <em>strikethrough</em>, <em>spoiler</em>, and <em>custom_emoji</em> entities are kept in quotes.
* @property is_manual <em>Optional</em>. True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.
*
* @constructor Creates a [TextQuote].
* */
data class TextQuote(
val text: String,
val position: Long,
val entities: List<MessageEntity>? = null,
val is_manual: Boolean? = null,
) : TelegramModel()
/**
* <p>This object contains information about a message that is being replied to, which may come from another chat or forum topic.</p>
*
* @property origin Origin of the message replied to by the given message
* @property chat <em>Optional</em>. Chat the original message belongs to. Available only if the chat is a supergroup or a channel.
* @property message_id <em>Optional</em>. Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.
* @property link_preview_options <em>Optional</em>. Options used for link preview generation for the original message, if it is a text message
* @property animation <em>Optional</em>. Message is an animation, information about the animation
* @property audio <em>Optional</em>. Message is an audio file, information about the file
* @property document <em>Optional</em>. Message is a general file, information about the file
* @property paid_media <em>Optional</em>. Message contains paid media; information about the paid media
* @property photo <em>Optional</em>. Message is a photo, available sizes of the photo
* @property sticker <em>Optional</em>. Message is a sticker, information about the sticker
* @property story <em>Optional</em>. Message is a forwarded story
* @property video <em>Optional</em>. Message is a video, information about the video
* @property video_note <em>Optional</em>. Message is a <a href="https://telegram.org/blog/video-messages-and-telescope">video note</a>, information about the video message
* @property voice <em>Optional</em>. Message is a voice message, information about the file
* @property has_media_spoiler <em>Optional</em>. <em>True</em>, if the message media is covered by a spoiler animation
* @property contact <em>Optional</em>. Message is a shared contact, information about the contact
* @property dice <em>Optional</em>. Message is a dice with random value
* @property game <em>Optional</em>. Message is a game, information about the game. <a href="#games">More about games »</a>
* @property giveaway <em>Optional</em>. Message is a scheduled giveaway, information about the giveaway
* @property giveaway_winners <em>Optional</em>. A giveaway with public winners was completed
* @property invoice <em>Optional</em>. Message is an invoice for a <a href="#payments">payment</a>, information about the invoice. <a href="#payments">More about payments »</a>
* @property location <em>Optional</em>. Message is a shared location, information about the location
* @property poll <em>Optional</em>. Message is a native poll, information about the poll
* @property venue <em>Optional</em>. Message is a venue, information about the venue
*
* @constructor Creates a [ExternalReplyInfo].
* */
data class ExternalReplyInfo(
val origin: MessageOrigin,
val chat: Chat? = null,
val message_id: Long? = null,
val link_preview_options: LinkPreviewOptions? = null,
val animation: Animation? = null,
val audio: Audio? = null,
val document: Document? = null,
val paid_media: PaidMediaInfo? = null,
val photo: List<PhotoSize>? = null,
val sticker: Sticker? = null,
val story: Story? = null,
val video: Video? = null,
val video_note: VideoNote? = null,
val voice: Voice? = null,
val has_media_spoiler: Boolean? = null,
val contact: Contact? = null,
val dice: Dice? = null,
val game: Game? = null,
val giveaway: Giveaway? = null,
val giveaway_winners: GiveawayWinners? = null,
val invoice: Invoice? = null,
val location: Location? = null,
val poll: Poll? = null,
val venue: Venue? = null,
) : TelegramModel()
/**
* <p>Describes reply parameters for the message that is being sent.</p>
*
* @property message_id Identifier of the message that will be replied to in the current chat, or in the chat <em>chat_id</em> if it is specified
* @property chat_id <em>Optional</em>. If the message to be replied to is from a different chat, unique identifier for the chat or username of the channel (in the format <code>@channelusername</code>). Not supported for messages sent on behalf of a business account.
* @property allow_sending_without_reply <em>Optional</em>. Pass <em>True</em> if the message should be sent even if the specified message to be replied to is not found. Always <em>False</em> for replies in another chat or forum topic. Always <em>True</em> for messages sent on behalf of a business account.
* @property quote <em>Optional</em>. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including <em>bold</em>, <em>italic</em>, <em>underline</em>, <em>strikethrough</em>, <em>spoiler</em>, and <em>custom_emoji</em> entities. The message will fail to send if the quote isn't found in the original message.
* @property quote_parse_mode <em>Optional</em>. Mode for parsing entities in the quote. See <a href="#formatting-options">formatting options</a> for more details.
* @property quote_entities <em>Optional</em>. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of <em>quote_parse_mode</em>.
* @property quote_position <em>Optional</em>. Position of the quote in the original message in UTF-16 code units
*
* @constructor Creates a [ReplyParameters].
* */
data class ReplyParameters(
val message_id: Long,
val chat_id: String? = null,
val allow_sending_without_reply: Boolean? = null,
val quote: String? = null,
val quote_parse_mode: String? = null,
val quote_entities: List<MessageEntity>? = null,
val quote_position: Long? = null,
) : TelegramModel()
/**
* <p>The message was originally sent by a known user.</p>
*
* @property type Type of the message origin, always “user”
* @property date Date the message was sent originally in Unix time
* @property sender_user User that sent the message originally
*
* @constructor Creates a [MessageOriginUser].
* */
data class MessageOriginUser(
val type: String,
val date: Long,
val sender_user: User,
) : MessageOrigin()
/**
* <p>The message was originally sent by an unknown user.</p>
*
* @property type Type of the message origin, always “hidden_user”
* @property date Date the message was sent originally in Unix time
* @property sender_user_name Name of the user that sent the message originally
*
* @constructor Creates a [MessageOriginHiddenUser].
* */
data class MessageOriginHiddenUser(
val type: String,
val date: Long,
val sender_user_name: String,
) : MessageOrigin()
/**
* <p>The message was originally sent on behalf of a chat to a group chat.</p>
*
* @property type Type of the message origin, always “chat”
* @property date Date the message was sent originally in Unix time
* @property sender_chat Chat that sent the message originally
* @property author_signature <em>Optional</em>. For messages originally sent by an anonymous chat administrator, original message author signature
*
* @constructor Creates a [MessageOriginChat].
* */
data class MessageOriginChat(
val type: String,
val date: Long,
val sender_chat: Chat,
val author_signature: String? = null,
) : MessageOrigin()
/**
* <p>The message was originally sent to a channel chat.</p>
*
* @property type Type of the message origin, always “channel”
* @property date Date the message was sent originally in Unix time
* @property chat Channel chat to which the message was originally sent
* @property message_id Unique message identifier inside the chat
* @property author_signature <em>Optional</em>. Signature of the original post author
*
* @constructor Creates a [MessageOriginChannel].
* */
data class MessageOriginChannel(
val type: String,
val date: Long,
val chat: Chat,
val message_id: Long,
val author_signature: String? = null,
) : MessageOrigin()
/**
* <p>This object represents one size of a photo or a <a href="#document">file</a> / <a href="#sticker">sticker</a> thumbnail.</p>
*
* @property file_id Identifier for this file, which can be used to download or reuse the file
* @property file_unique_id Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @property width Photo width
* @property height Photo height
* @property file_size <em>Optional</em>. File size in bytes
*
* @constructor Creates a [PhotoSize].
* */
data class PhotoSize(
val file_id: String,
val file_unique_id: String,
val width: Long,
val height: Long,
val file_size: Long? = null,
) : TelegramModel()
/**
* <p>This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).</p>
*
* @property file_id Identifier for this file, which can be used to download or reuse the file
* @property file_unique_id Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @property width Video width as defined by the sender
* @property height Video height as defined by the sender
* @property duration Duration of the video in seconds as defined by the sender
* @property thumbnail <em>Optional</em>. Animation thumbnail as defined by the sender
* @property file_name <em>Optional</em>. Original animation filename as defined by the sender
* @property mime_type <em>Optional</em>. MIME type of the file as defined by the sender
* @property file_size <em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
*
* @constructor Creates a [Animation].
* */
data class Animation(
val file_id: String,
val file_unique_id: String,
val width: Long,
val height: Long,
val duration: Long,
val thumbnail: PhotoSize? = null,
val file_name: String? = null,
val mime_type: String? = null,
val file_size: Long? = null,
) : TelegramModel()
/**
* <p>This object represents an audio file to be treated as music by the Telegram clients.</p>
*
* @property file_id Identifier for this file, which can be used to download or reuse the file
* @property file_unique_id Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @property duration Duration of the audio in seconds as defined by the sender
* @property performer <em>Optional</em>. Performer of the audio as defined by the sender or by audio tags
* @property title <em>Optional</em>. Title of the audio as defined by the sender or by audio tags
* @property file_name <em>Optional</em>. Original filename as defined by the sender
* @property mime_type <em>Optional</em>. MIME type of the file as defined by the sender
* @property file_size <em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
* @property thumbnail <em>Optional</em>. Thumbnail of the album cover to which the music file belongs
*
* @constructor Creates a [Audio].
* */
data class Audio(
val file_id: String,
val file_unique_id: String,
val duration: Long,
val performer: String? = null,
val title: String? = null,
val file_name: String? = null,
val mime_type: String? = null,
val file_size: Long? = null,
val thumbnail: PhotoSize? = null,
) : TelegramModel()
/**
* <p>This object represents a general file (as opposed to <a href="#photosize">photos</a>, <a href="#voice">voice messages</a> and <a href="#audio">audio files</a>).</p>
*
* @property file_id Identifier for this file, which can be used to download or reuse the file
* @property file_unique_id Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @property thumbnail <em>Optional</em>. Document thumbnail as defined by the sender
* @property file_name <em>Optional</em>. Original filename as defined by the sender
* @property mime_type <em>Optional</em>. MIME type of the file as defined by the sender
* @property file_size <em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
*
* @constructor Creates a [Document].
* */
data class Document(
val file_id: String,
val file_unique_id: String,
val thumbnail: PhotoSize? = null,
val file_name: String? = null,
val mime_type: String? = null,
val file_size: Long? = null,
) : TelegramModel()
/**
* <p>This object represents a story.</p>
*
* @property chat Chat that posted the story
* @property id Unique identifier for the story in the chat
*
* @constructor Creates a [Story].
* */
data class Story(
val chat: Chat,
val id: Long,
) : TelegramModel()
/**
* <p>This object represents a video file.</p>
*
* @property file_id Identifier for this file, which can be used to download or reuse the file
* @property file_unique_id Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @property width Video width as defined by the sender
* @property height Video height as defined by the sender
* @property duration Duration of the video in seconds as defined by the sender
* @property thumbnail <em>Optional</em>. Video thumbnail
* @property file_name <em>Optional</em>. Original filename as defined by the sender
* @property mime_type <em>Optional</em>. MIME type of the file as defined by the sender
* @property file_size <em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
*
* @constructor Creates a [Video].
* */
data class Video(
val file_id: String,
val file_unique_id: String,
val width: Long,
val height: Long,
val duration: Long,
val thumbnail: PhotoSize? = null,
val file_name: String? = null,
val mime_type: String? = null,
val file_size: Long? = null,
) : TelegramModel()
/**
* <p>This object represents a <a href="https://telegram.org/blog/video-messages-and-telescope">video message</a> (available in Telegram apps as of <a href="https://telegram.org/blog/video-messages-and-telescope">v.4.0</a>).</p>
*
* @property file_id Identifier for this file, which can be used to download or reuse the file
* @property file_unique_id Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @property length Video width and height (diameter of the video message) as defined by the sender
* @property duration Duration of the video in seconds as defined by the sender
* @property thumbnail <em>Optional</em>. Video thumbnail
* @property file_size <em>Optional</em>. File size in bytes
*
* @constructor Creates a [VideoNote].
* */
data class VideoNote(
val file_id: String,
val file_unique_id: String,
val length: Long,
val duration: Long,
val thumbnail: PhotoSize? = null,
val file_size: Long? = null,
) : TelegramModel()
/**
* <p>This object represents a voice note.</p>
*
* @property file_id Identifier for this file, which can be used to download or reuse the file
* @property file_unique_id Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
* @property duration Duration of the audio in seconds as defined by the sender
* @property mime_type <em>Optional</em>. MIME type of the file as defined by the sender
* @property file_size <em>Optional</em>. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.
*
* @constructor Creates a [Voice].
* */
data class Voice(
val file_id: String,
val file_unique_id: String,
val duration: Long,
val mime_type: String? = null,
val file_size: Long? = null,
) : TelegramModel()
/**
* <p>Describes the paid media added to a message.</p>
*
* @property star_count The number of Telegram Stars that must be paid to buy access to the media
* @property paid_media Information about the paid media
*
* @constructor Creates a [PaidMediaInfo].
* */
data class PaidMediaInfo(
val star_count: Long,
val paid_media: List<PaidMedia>,
) : PaidMedia()
/**
* <p>The paid media isn't available before the payment.</p>
*
* @property type Type of the paid media, always “preview”
* @property width <em>Optional</em>. Media width as defined by the sender
* @property height <em>Optional</em>. Media height as defined by the sender
* @property duration <em>Optional</em>. Duration of the media in seconds as defined by the sender
*
* @constructor Creates a [PaidMediaPreview].
* */
data class PaidMediaPreview(
val type: String,
val width: Long? = null,
val height: Long? = null,
val duration: Long? = null,
) : PaidMedia()
/**
* <p>The paid media is a photo.</p>
*
* @property type Type of the paid media, always “photo”
* @property photo The photo
*
* @constructor Creates a [PaidMediaPhoto].
* */
data class PaidMediaPhoto(
val type: String,
val photo: List<PhotoSize>,
) : PaidMedia()
/**
* <p>The paid media is a video.</p>
*
* @property type Type of the paid media, always “video”
* @property video The video
*
* @constructor Creates a [PaidMediaVideo].
* */
data class PaidMediaVideo(
val type: String,
val video: Video,
) : PaidMedia()
/**
* <p>This object represents a phone contact.</p>
*
* @property phone_number Contact's phone number
* @property first_name Contact's first name
* @property last_name <em>Optional</em>. Contact's last name
* @property user_id <em>Optional</em>. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.
* @property vcard <em>Optional</em>. Additional data about the contact in the form of a <a href="https://en.wikipedia.org/wiki/VCard">vCard</a>
*
* @constructor Creates a [Contact].
* */
data class Contact(
val phone_number: String,
val first_name: String,
val last_name: String? = null,
val user_id: Long? = null,
val vcard: String? = null,
) : TelegramModel()
/**
* <p>This object represents an animated emoji that displays a random value.</p>
*
* @property emoji Emoji on which the dice throw animation is based
* @property value Value of the dice, 1-6 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲">”, “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EAF.png" width="20" height="20" alt="🎯">” and “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB3.png" width="20" height="20" alt="🎳">” base emoji, 1-5 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8F80.png" width="20" height="20" alt="🏀">” and “<img class="emoji" src="//telegram.org/img/emoji/40/E29ABD.png" width="20" height="20" alt="⚽">” base emoji, 1-64 for “<img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB0.png" width="20" height="20" alt="🎰">” base emoji
*
* @constructor Creates a [Dice].
* */
data class Dice(
val emoji: String,
val value: Long,
) : TelegramModel()
/**
* <p>This object contains information about one answer option in a poll.</p>
*
* @property text Option text, 1-100 characters
* @property voter_count Number of users that voted for this option
* @property text_entities <em>Optional</em>. Special entities that appear in the option <em>text</em>. Currently, only custom emoji entities are allowed in poll option texts
*
* @constructor Creates a [PollOption].
* */
data class PollOption(
val text: String,
val voter_count: Long,
val text_entities: List<MessageEntity>? = null,
) : TelegramModel()
/**
* <p>This object contains information about one answer option in a poll to be sent.</p>
*
* @property text Option text, 1-100 characters
* @property text_parse_mode <em>Optional</em>. Mode for parsing entities in the text. See <a href="#formatting-options">formatting options</a> for more details. Currently, only custom emoji entities are allowed
* @property text_entities <em>Optional</em>. A JSON-serialized list of special entities that appear in the poll option text. It can be specified instead of <em>text_parse_mode</em>
*
* @constructor Creates a [InputPollOption].
* */
data class InputPollOption(
val text: String,
val text_parse_mode: String? = null,
val text_entities: List<MessageEntity>? = null,
) : TelegramModel()
/**
* <p>This object represents an answer of a user in a non-anonymous poll.</p>
*
* @property poll_id Unique poll identifier
* @property option_ids 0-based identifiers of chosen answer options. May be empty if the vote was retracted.
* @property voter_chat <em>Optional</em>. The chat that changed the answer to the poll, if the voter is anonymous
* @property user <em>Optional</em>. The user that changed the answer to the poll, if the voter isn't anonymous
*
* @constructor Creates a [PollAnswer].
* */
data class PollAnswer(
val poll_id: String,
val option_ids: List<Long>,
val voter_chat: Chat? = null,
val user: User? = null,
) : TelegramModel()
/**
* <p>This object contains information about a poll.</p>
*
* @property id Unique poll identifier
* @property question Poll question, 1-300 characters
* @property options List of poll options
* @property total_voter_count Total number of users that voted in the poll
* @property is_closed <em>True</em>, if the poll is closed
* @property is_anonymous <em>True</em>, if the poll is anonymous
* @property type Poll type, currently can be “regular” or “quiz”
* @property allows_multiple_answers <em>True</em>, if the poll allows multiple answers
* @property question_entities <em>Optional</em>. Special entities that appear in the <em>question</em>. Currently, only custom emoji entities are allowed in poll questions
* @property correct_option_id <em>Optional</em>. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
* @property explanation <em>Optional</em>. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
* @property explanation_entities <em>Optional</em>. Special entities like usernames, URLs, bot commands, etc. that appear in the <em>explanation</em>
* @property open_period <em>Optional</em>. Amount of time in seconds the poll will be active after creation
* @property close_date <em>Optional</em>. Point in time (Unix timestamp) when the poll will be automatically closed
*
* @constructor Creates a [Poll].
* */
data class Poll(
val id: String,
val question: String,
val options: List<PollOption>,
val total_voter_count: Long,
val is_closed: Boolean,
val is_anonymous: Boolean,
val type: String,
val allows_multiple_answers: Boolean,
val question_entities: List<MessageEntity>? = null,
val correct_option_id: Long? = null,
val explanation: String? = null,
val explanation_entities: List<MessageEntity>? = null,
val open_period: Long? = null,
val close_date: Long? = null,
) : TelegramModel()