botapi-py 1.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
botapi/types.py ADDED
@@ -0,0 +1,4316 @@
1
+ # This is an autogenerated file. Do not edit this file directly.
2
+
3
+ from __future__ import annotations
4
+
5
+ from pydantic import BaseModel, Field, TypeAdapter
6
+ from typing import Union, Optional, Literal, List
7
+
8
+ class Update(BaseModel):
9
+ '''
10
+ This object represents an incoming update.At most one
11
+ of the optional parameters can be present in
12
+ any given update.
13
+
14
+ Reference: https://core.telegram.org/bots/api#update
15
+ '''
16
+
17
+ update_id: int
18
+ message: Optional[Message] = Field(default=None)
19
+ edited_message: Optional[Message] = Field(default=None)
20
+ channel_post: Optional[Message] = Field(default=None)
21
+ edited_channel_post: Optional[Message] = Field(default=None)
22
+ business_connection: Optional[BusinessConnection] = Field(default=None)
23
+ business_message: Optional[Message] = Field(default=None)
24
+ edited_business_message: Optional[Message] = Field(default=None)
25
+ deleted_business_messages: Optional[BusinessMessagesDeleted] = Field(default=None)
26
+ message_reaction: Optional[MessageReactionUpdated] = Field(default=None)
27
+ message_reaction_count: Optional[MessageReactionCountUpdated] = Field(default=None)
28
+ inline_query: Optional[InlineQuery] = Field(default=None)
29
+ chosen_inline_result: Optional[ChosenInlineResult] = Field(default=None)
30
+ callback_query: Optional[CallbackQuery] = Field(default=None)
31
+ shipping_query: Optional[ShippingQuery] = Field(default=None)
32
+ pre_checkout_query: Optional[PreCheckoutQuery] = Field(default=None)
33
+ purchased_paid_media: Optional[PaidMediaPurchased] = Field(default=None)
34
+ poll: Optional[Poll] = Field(default=None)
35
+ poll_answer: Optional[PollAnswer] = Field(default=None)
36
+ my_chat_member: Optional[ChatMemberUpdated] = Field(default=None)
37
+ chat_member: Optional[ChatMemberUpdated] = Field(default=None)
38
+ chat_join_request: Optional[ChatJoinRequest] = Field(default=None)
39
+ chat_boost: Optional[ChatBoostUpdated] = Field(default=None)
40
+ removed_chat_boost: Optional[ChatBoostRemoved] = Field(default=None)
41
+
42
+ class WebhookInfo(BaseModel):
43
+ '''
44
+ Describes the current status of a webhook.
45
+
46
+ Reference: https://core.telegram.org/bots/api#webhookinfo
47
+ '''
48
+
49
+ url: str
50
+ has_custom_certificate: bool
51
+ pending_update_count: int
52
+ ip_address: Optional[str] = Field(default=None)
53
+ last_error_date: Optional[int] = Field(default=None)
54
+ last_error_message: Optional[str] = Field(default=None)
55
+ last_synchronization_error_date: Optional[int] = Field(default=None)
56
+ max_connections: Optional[int] = Field(default=None)
57
+ allowed_updates: Optional[List[str]] = Field(default=None)
58
+
59
+ class User(BaseModel):
60
+ '''
61
+ This object represents a Telegram user or bot.
62
+
63
+ Reference: https://core.telegram.org/bots/api#user
64
+ '''
65
+
66
+ id: int
67
+ is_bot: bool
68
+ first_name: str
69
+ last_name: Optional[str] = Field(default=None)
70
+ username: Optional[str] = Field(default=None)
71
+ language_code: Optional[str] = Field(default=None)
72
+ is_premium: Optional[bool] = Field(default=None)
73
+ added_to_attachment_menu: Optional[bool] = Field(default=None)
74
+ can_join_groups: Optional[bool] = Field(default=None)
75
+ can_read_all_group_messages: Optional[bool] = Field(default=None)
76
+ supports_inline_queries: Optional[bool] = Field(default=None)
77
+ can_connect_to_business: Optional[bool] = Field(default=None)
78
+ has_main_web_app: Optional[bool] = Field(default=None)
79
+
80
+ class Chat(BaseModel):
81
+ '''
82
+ This object represents a chat.
83
+
84
+ Reference: https://core.telegram.org/bots/api#chat
85
+ '''
86
+
87
+ id: int
88
+ type: str
89
+ title: Optional[str] = Field(default=None)
90
+ username: Optional[str] = Field(default=None)
91
+ first_name: Optional[str] = Field(default=None)
92
+ last_name: Optional[str] = Field(default=None)
93
+ is_forum: Optional[bool] = Field(default=None)
94
+ is_direct_messages: Optional[bool] = Field(default=None)
95
+
96
+ class ChatFullInfo(BaseModel):
97
+ '''
98
+ This object contains full information about a chat.
99
+
100
+ Reference: https://core.telegram.org/bots/api#chatfullinfo
101
+ '''
102
+
103
+ id: int
104
+ type: str
105
+ accent_color_id: int
106
+ max_reaction_count: int
107
+ accepted_gift_types: AcceptedGiftTypes
108
+ title: Optional[str] = Field(default=None)
109
+ username: Optional[str] = Field(default=None)
110
+ first_name: Optional[str] = Field(default=None)
111
+ last_name: Optional[str] = Field(default=None)
112
+ is_forum: Optional[bool] = Field(default=None)
113
+ is_direct_messages: Optional[bool] = Field(default=None)
114
+ photo: Optional[ChatPhoto] = Field(default=None)
115
+ active_usernames: Optional[List[str]] = Field(default=None)
116
+ birthdate: Optional[Birthdate] = Field(default=None)
117
+ business_intro: Optional[BusinessIntro] = Field(default=None)
118
+ business_location: Optional[BusinessLocation] = Field(default=None)
119
+ business_opening_hours: Optional[BusinessOpeningHours] = Field(default=None)
120
+ personal_chat: Optional[Chat] = Field(default=None)
121
+ parent_chat: Optional[Chat] = Field(default=None)
122
+ available_reactions: Optional[List[ReactionType]] = Field(default=None)
123
+ background_custom_emoji_id: Optional[str] = Field(default=None)
124
+ profile_accent_color_id: Optional[int] = Field(default=None)
125
+ profile_background_custom_emoji_id: Optional[str] = Field(default=None)
126
+ emoji_status_custom_emoji_id: Optional[str] = Field(default=None)
127
+ emoji_status_expiration_date: Optional[int] = Field(default=None)
128
+ bio: Optional[str] = Field(default=None)
129
+ has_private_forwards: Optional[bool] = Field(default=None)
130
+ has_restricted_voice_and_video_messages: Optional[bool] = Field(default=None)
131
+ join_to_send_messages: Optional[bool] = Field(default=None)
132
+ join_by_request: Optional[bool] = Field(default=None)
133
+ description: Optional[str] = Field(default=None)
134
+ invite_link: Optional[str] = Field(default=None)
135
+ pinned_message: Optional[Message] = Field(default=None)
136
+ permissions: Optional[ChatPermissions] = Field(default=None)
137
+ can_send_paid_media: Optional[bool] = Field(default=None)
138
+ slow_mode_delay: Optional[int] = Field(default=None)
139
+ unrestrict_boost_count: Optional[int] = Field(default=None)
140
+ message_auto_delete_time: Optional[int] = Field(default=None)
141
+ has_aggressive_anti_spam_enabled: Optional[bool] = Field(default=None)
142
+ has_hidden_members: Optional[bool] = Field(default=None)
143
+ has_protected_content: Optional[bool] = Field(default=None)
144
+ has_visible_history: Optional[bool] = Field(default=None)
145
+ sticker_set_name: Optional[str] = Field(default=None)
146
+ can_set_sticker_set: Optional[bool] = Field(default=None)
147
+ custom_emoji_sticker_set_name: Optional[str] = Field(default=None)
148
+ linked_chat_id: Optional[int] = Field(default=None)
149
+ location: Optional[ChatLocation] = Field(default=None)
150
+
151
+ class Message(BaseModel):
152
+ '''
153
+ This object represents a message.
154
+
155
+ Reference: https://core.telegram.org/bots/api#message
156
+ '''
157
+
158
+ message_id: int
159
+ date: int
160
+ chat: Chat
161
+ message_thread_id: Optional[int] = Field(default=None)
162
+ direct_messages_topic: Optional[DirectMessagesTopic] = Field(default=None)
163
+ from_user: Optional[User] = Field(default=None, alias='from') # FIX `from` is a python reserved keyword
164
+ sender_chat: Optional[Chat] = Field(default=None)
165
+ sender_boost_count: Optional[int] = Field(default=None)
166
+ sender_business_bot: Optional[User] = Field(default=None)
167
+ business_connection_id: Optional[str] = Field(default=None)
168
+ forward_origin: Optional[MessageOrigin] = Field(default=None)
169
+ is_topic_message: Optional[bool] = Field(default=None)
170
+ is_automatic_forward: Optional[bool] = Field(default=None)
171
+ reply_to_message: Optional[Message] = Field(default=None)
172
+ external_reply: Optional[ExternalReplyInfo] = Field(default=None)
173
+ quote: Optional[TextQuote] = Field(default=None)
174
+ reply_to_story: Optional[Story] = Field(default=None)
175
+ reply_to_checklist_task_id: Optional[int] = Field(default=None)
176
+ via_bot: Optional[User] = Field(default=None)
177
+ edit_date: Optional[int] = Field(default=None)
178
+ has_protected_content: Optional[bool] = Field(default=None)
179
+ is_from_offline: Optional[bool] = Field(default=None)
180
+ is_paid_post: Optional[bool] = Field(default=None)
181
+ media_group_id: Optional[str] = Field(default=None)
182
+ author_signature: Optional[str] = Field(default=None)
183
+ paid_star_count: Optional[int] = Field(default=None)
184
+ text: Optional[str] = Field(default=None)
185
+ entities: Optional[List[MessageEntity]] = Field(default=None)
186
+ link_preview_options: Optional[LinkPreviewOptions] = Field(default=None)
187
+ suggested_post_info: Optional[SuggestedPostInfo] = Field(default=None)
188
+ effect_id: Optional[str] = Field(default=None)
189
+ animation: Optional[Animation] = Field(default=None)
190
+ audio: Optional[Audio] = Field(default=None)
191
+ document: Optional[Document] = Field(default=None)
192
+ paid_media: Optional[PaidMediaInfo] = Field(default=None)
193
+ photo: Optional[List[PhotoSize]] = Field(default=None)
194
+ sticker: Optional[Sticker] = Field(default=None)
195
+ story: Optional[Story] = Field(default=None)
196
+ video: Optional[Video] = Field(default=None)
197
+ video_note: Optional[VideoNote] = Field(default=None)
198
+ voice: Optional[Voice] = Field(default=None)
199
+ caption: Optional[str] = Field(default=None)
200
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
201
+ show_caption_above_media: Optional[bool] = Field(default=None)
202
+ has_media_spoiler: Optional[bool] = Field(default=None)
203
+ checklist: Optional[Checklist] = Field(default=None)
204
+ contact: Optional[Contact] = Field(default=None)
205
+ dice: Optional[Dice] = Field(default=None)
206
+ game: Optional[Game] = Field(default=None)
207
+ poll: Optional[Poll] = Field(default=None)
208
+ venue: Optional[Venue] = Field(default=None)
209
+ location: Optional[Location] = Field(default=None)
210
+ new_chat_members: Optional[List[User]] = Field(default=None)
211
+ left_chat_member: Optional[User] = Field(default=None)
212
+ new_chat_title: Optional[str] = Field(default=None)
213
+ new_chat_photo: Optional[List[PhotoSize]] = Field(default=None)
214
+ delete_chat_photo: Optional[bool] = Field(default=None)
215
+ group_chat_created: Optional[bool] = Field(default=None)
216
+ supergroup_chat_created: Optional[bool] = Field(default=None)
217
+ channel_chat_created: Optional[bool] = Field(default=None)
218
+ message_auto_delete_timer_changed: Optional[MessageAutoDeleteTimerChanged] = Field(default=None)
219
+ migrate_to_chat_id: Optional[int] = Field(default=None)
220
+ migrate_from_chat_id: Optional[int] = Field(default=None)
221
+ pinned_message: Optional[MaybeInaccessibleMessage] = Field(default=None)
222
+ invoice: Optional[Invoice] = Field(default=None)
223
+ successful_payment: Optional[SuccessfulPayment] = Field(default=None)
224
+ refunded_payment: Optional[RefundedPayment] = Field(default=None)
225
+ users_shared: Optional[UsersShared] = Field(default=None)
226
+ chat_shared: Optional[ChatShared] = Field(default=None)
227
+ gift: Optional[GiftInfo] = Field(default=None)
228
+ unique_gift: Optional[UniqueGiftInfo] = Field(default=None)
229
+ connected_website: Optional[str] = Field(default=None)
230
+ write_access_allowed: Optional[WriteAccessAllowed] = Field(default=None)
231
+ passport_data: Optional[PassportData] = Field(default=None)
232
+ proximity_alert_triggered: Optional[ProximityAlertTriggered] = Field(default=None)
233
+ boost_added: Optional[ChatBoostAdded] = Field(default=None)
234
+ chat_background_set: Optional[ChatBackground] = Field(default=None)
235
+ checklist_tasks_done: Optional[ChecklistTasksDone] = Field(default=None)
236
+ checklist_tasks_added: Optional[ChecklistTasksAdded] = Field(default=None)
237
+ direct_message_price_changed: Optional[DirectMessagePriceChanged] = Field(default=None)
238
+ forum_topic_created: Optional[ForumTopicCreated] = Field(default=None)
239
+ forum_topic_edited: Optional[ForumTopicEdited] = Field(default=None)
240
+ forum_topic_closed: Optional[ForumTopicClosed] = Field(default=None)
241
+ forum_topic_reopened: Optional[ForumTopicReopened] = Field(default=None)
242
+ general_forum_topic_hidden: Optional[GeneralForumTopicHidden] = Field(default=None)
243
+ general_forum_topic_unhidden: Optional[GeneralForumTopicUnhidden] = Field(default=None)
244
+ giveaway_created: Optional[GiveawayCreated] = Field(default=None)
245
+ giveaway: Optional[Giveaway] = Field(default=None)
246
+ giveaway_winners: Optional[GiveawayWinners] = Field(default=None)
247
+ giveaway_completed: Optional[GiveawayCompleted] = Field(default=None)
248
+ paid_message_price_changed: Optional[PaidMessagePriceChanged] = Field(default=None)
249
+ suggested_post_approved: Optional[SuggestedPostApproved] = Field(default=None)
250
+ suggested_post_approval_failed: Optional[SuggestedPostApprovalFailed] = Field(default=None)
251
+ suggested_post_declined: Optional[SuggestedPostDeclined] = Field(default=None)
252
+ suggested_post_paid: Optional[SuggestedPostPaid] = Field(default=None)
253
+ suggested_post_refunded: Optional[SuggestedPostRefunded] = Field(default=None)
254
+ video_chat_scheduled: Optional[VideoChatScheduled] = Field(default=None)
255
+ video_chat_started: Optional[VideoChatStarted] = Field(default=None)
256
+ video_chat_ended: Optional[VideoChatEnded] = Field(default=None)
257
+ video_chat_participants_invited: Optional[VideoChatParticipantsInvited] = Field(default=None)
258
+ web_app_data: Optional[WebAppData] = Field(default=None)
259
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
260
+
261
+ class MessageId(BaseModel):
262
+ '''
263
+ This object represents a unique message identifier.
264
+
265
+ Reference: https://core.telegram.org/bots/api#messageid
266
+ '''
267
+
268
+ message_id: int
269
+
270
+ class InaccessibleMessage(BaseModel):
271
+ '''
272
+ This object describes a message that was deleted
273
+ or is otherwise inaccessible to the bot.
274
+
275
+ Reference: https://core.telegram.org/bots/api#inaccessiblemessage
276
+ '''
277
+
278
+ chat: Chat
279
+ message_id: int
280
+ date: int
281
+
282
+ class MessageEntity(BaseModel):
283
+ '''
284
+ This object represents one special entity in a
285
+ text message. For example, hashtags, usernames, URLs, etc.
286
+
287
+ Reference: https://core.telegram.org/bots/api#messageentity
288
+ '''
289
+
290
+ type: str
291
+ offset: int
292
+ length: int
293
+ url: Optional[str] = Field(default=None)
294
+ user: Optional[User] = Field(default=None)
295
+ language: Optional[str] = Field(default=None)
296
+ custom_emoji_id: Optional[str] = Field(default=None)
297
+
298
+ class TextQuote(BaseModel):
299
+ '''
300
+ This object contains information about the quoted part
301
+ of a message that is replied to by
302
+ the given message.
303
+
304
+ Reference: https://core.telegram.org/bots/api#textquote
305
+ '''
306
+
307
+ text: str
308
+ position: int
309
+ entities: Optional[List[MessageEntity]] = Field(default=None)
310
+ is_manual: Optional[bool] = Field(default=None)
311
+
312
+ class ExternalReplyInfo(BaseModel):
313
+ '''
314
+ This object contains information about a message that
315
+ is being replied to, which may come from
316
+ another chat or forum topic.
317
+
318
+ Reference: https://core.telegram.org/bots/api#externalreplyinfo
319
+ '''
320
+
321
+ origin: MessageOrigin
322
+ chat: Optional[Chat] = Field(default=None)
323
+ message_id: Optional[int] = Field(default=None)
324
+ link_preview_options: Optional[LinkPreviewOptions] = Field(default=None)
325
+ animation: Optional[Animation] = Field(default=None)
326
+ audio: Optional[Audio] = Field(default=None)
327
+ document: Optional[Document] = Field(default=None)
328
+ paid_media: Optional[PaidMediaInfo] = Field(default=None)
329
+ photo: Optional[List[PhotoSize]] = Field(default=None)
330
+ sticker: Optional[Sticker] = Field(default=None)
331
+ story: Optional[Story] = Field(default=None)
332
+ video: Optional[Video] = Field(default=None)
333
+ video_note: Optional[VideoNote] = Field(default=None)
334
+ voice: Optional[Voice] = Field(default=None)
335
+ has_media_spoiler: Optional[bool] = Field(default=None)
336
+ checklist: Optional[Checklist] = Field(default=None)
337
+ contact: Optional[Contact] = Field(default=None)
338
+ dice: Optional[Dice] = Field(default=None)
339
+ game: Optional[Game] = Field(default=None)
340
+ giveaway: Optional[Giveaway] = Field(default=None)
341
+ giveaway_winners: Optional[GiveawayWinners] = Field(default=None)
342
+ invoice: Optional[Invoice] = Field(default=None)
343
+ location: Optional[Location] = Field(default=None)
344
+ poll: Optional[Poll] = Field(default=None)
345
+ venue: Optional[Venue] = Field(default=None)
346
+
347
+ class ReplyParameters(BaseModel):
348
+ '''
349
+ Describes reply parameters for the message that is
350
+ being sent.
351
+
352
+ Reference: https://core.telegram.org/bots/api#replyparameters
353
+ '''
354
+
355
+ message_id: int
356
+ chat_id: Optional[Union[int, str]] = Field(default=None)
357
+ allow_sending_without_reply: Optional[bool] = Field(default=None)
358
+ quote: Optional[str] = Field(default=None)
359
+ quote_parse_mode: Optional[str] = Field(default=None)
360
+ quote_entities: Optional[List[MessageEntity]] = Field(default=None)
361
+ quote_position: Optional[int] = Field(default=None)
362
+ checklist_task_id: Optional[int] = Field(default=None)
363
+
364
+ class MessageOriginUser(BaseModel):
365
+ '''
366
+ The message was originally sent by a known
367
+ user.
368
+
369
+ Reference: https://core.telegram.org/bots/api#messageoriginuser
370
+ '''
371
+
372
+ type: Literal['user'] = 'user'
373
+ date: int
374
+ sender_user: User
375
+
376
+ class MessageOriginHiddenUser(BaseModel):
377
+ '''
378
+ The message was originally sent by an unknown
379
+ user.
380
+
381
+ Reference: https://core.telegram.org/bots/api#messageoriginhiddenuser
382
+ '''
383
+
384
+ type: Literal['hidden_user'] = 'hidden_user'
385
+ date: int
386
+ sender_user_name: str
387
+
388
+ class MessageOriginChat(BaseModel):
389
+ '''
390
+ The message was originally sent on behalf of
391
+ a chat to a group chat.
392
+
393
+ Reference: https://core.telegram.org/bots/api#messageoriginchat
394
+ '''
395
+
396
+ type: Literal['chat'] = 'chat'
397
+ date: int
398
+ sender_chat: Chat
399
+ author_signature: Optional[str] = Field(default=None)
400
+
401
+ class MessageOriginChannel(BaseModel):
402
+ '''
403
+ The message was originally sent to a channel
404
+ chat.
405
+
406
+ Reference: https://core.telegram.org/bots/api#messageoriginchannel
407
+ '''
408
+
409
+ type: Literal['channel'] = 'channel'
410
+ date: int
411
+ chat: Chat
412
+ message_id: int
413
+ author_signature: Optional[str] = Field(default=None)
414
+
415
+ class PhotoSize(BaseModel):
416
+ '''
417
+ This object represents one size of a photo
418
+ or a file / sticker thumbnail.
419
+
420
+ Reference: https://core.telegram.org/bots/api#photosize
421
+ '''
422
+
423
+ file_id: str
424
+ file_unique_id: str
425
+ width: int
426
+ height: int
427
+ file_size: Optional[int] = Field(default=None)
428
+
429
+ class Animation(BaseModel):
430
+ '''
431
+ This object represents an animation file (GIF or
432
+ H.264/MPEG-4 AVC video without sound).
433
+
434
+ Reference: https://core.telegram.org/bots/api#animation
435
+ '''
436
+
437
+ file_id: str
438
+ file_unique_id: str
439
+ width: int
440
+ height: int
441
+ duration: int
442
+ thumbnail: Optional[PhotoSize] = Field(default=None)
443
+ file_name: Optional[str] = Field(default=None)
444
+ mime_type: Optional[str] = Field(default=None)
445
+ file_size: Optional[int] = Field(default=None)
446
+
447
+ class Audio(BaseModel):
448
+ '''
449
+ This object represents an audio file to be
450
+ treated as music by the Telegram clients.
451
+
452
+ Reference: https://core.telegram.org/bots/api#audio
453
+ '''
454
+
455
+ file_id: str
456
+ file_unique_id: str
457
+ duration: int
458
+ performer: Optional[str] = Field(default=None)
459
+ title: Optional[str] = Field(default=None)
460
+ file_name: Optional[str] = Field(default=None)
461
+ mime_type: Optional[str] = Field(default=None)
462
+ file_size: Optional[int] = Field(default=None)
463
+ thumbnail: Optional[PhotoSize] = Field(default=None)
464
+
465
+ class Document(BaseModel):
466
+ '''
467
+ This object represents a general file (as opposed
468
+ to photos, voice messages and audio files).
469
+
470
+ Reference: https://core.telegram.org/bots/api#document
471
+ '''
472
+
473
+ file_id: str
474
+ file_unique_id: str
475
+ thumbnail: Optional[PhotoSize] = Field(default=None)
476
+ file_name: Optional[str] = Field(default=None)
477
+ mime_type: Optional[str] = Field(default=None)
478
+ file_size: Optional[int] = Field(default=None)
479
+
480
+ class Story(BaseModel):
481
+ '''
482
+ This object represents a story.
483
+
484
+ Reference: https://core.telegram.org/bots/api#story
485
+ '''
486
+
487
+ chat: Chat
488
+ id: int
489
+
490
+ class Video(BaseModel):
491
+ '''
492
+ This object represents a video file.
493
+
494
+ Reference: https://core.telegram.org/bots/api#video
495
+ '''
496
+
497
+ file_id: str
498
+ file_unique_id: str
499
+ width: int
500
+ height: int
501
+ duration: int
502
+ thumbnail: Optional[PhotoSize] = Field(default=None)
503
+ cover: Optional[List[PhotoSize]] = Field(default=None)
504
+ start_timestamp: Optional[int] = Field(default=None)
505
+ file_name: Optional[str] = Field(default=None)
506
+ mime_type: Optional[str] = Field(default=None)
507
+ file_size: Optional[int] = Field(default=None)
508
+
509
+ class VideoNote(BaseModel):
510
+ '''
511
+ This object represents a video message (available in
512
+ Telegram apps as of v.4.0).
513
+
514
+ Reference: https://core.telegram.org/bots/api#videonote
515
+ '''
516
+
517
+ file_id: str
518
+ file_unique_id: str
519
+ length: int
520
+ duration: int
521
+ thumbnail: Optional[PhotoSize] = Field(default=None)
522
+ file_size: Optional[int] = Field(default=None)
523
+
524
+ class Voice(BaseModel):
525
+ '''
526
+ This object represents a voice note.
527
+
528
+ Reference: https://core.telegram.org/bots/api#voice
529
+ '''
530
+
531
+ file_id: str
532
+ file_unique_id: str
533
+ duration: int
534
+ mime_type: Optional[str] = Field(default=None)
535
+ file_size: Optional[int] = Field(default=None)
536
+
537
+ class PaidMediaInfo(BaseModel):
538
+ '''
539
+ Describes the paid media added to a message.
540
+
541
+ Reference: https://core.telegram.org/bots/api#paidmediainfo
542
+ '''
543
+
544
+ star_count: int
545
+ paid_media: List[PaidMedia]
546
+
547
+ class PaidMediaPreview(BaseModel):
548
+ '''
549
+ The paid media isn't available before the payment.
550
+
551
+ Reference: https://core.telegram.org/bots/api#paidmediapreview
552
+ '''
553
+
554
+ type: Literal['preview'] = 'preview'
555
+ width: Optional[int] = Field(default=None)
556
+ height: Optional[int] = Field(default=None)
557
+ duration: Optional[int] = Field(default=None)
558
+
559
+ class PaidMediaPhoto(BaseModel):
560
+ '''
561
+ The paid media is a photo.
562
+
563
+ Reference: https://core.telegram.org/bots/api#paidmediaphoto
564
+ '''
565
+
566
+ type: Literal['photo'] = 'photo'
567
+ photo: List[PhotoSize]
568
+
569
+ class PaidMediaVideo(BaseModel):
570
+ '''
571
+ The paid media is a video.
572
+
573
+ Reference: https://core.telegram.org/bots/api#paidmediavideo
574
+ '''
575
+
576
+ type: Literal['video'] = 'video'
577
+ video: Video
578
+
579
+ class Contact(BaseModel):
580
+ '''
581
+ This object represents a phone contact.
582
+
583
+ Reference: https://core.telegram.org/bots/api#contact
584
+ '''
585
+
586
+ phone_number: str
587
+ first_name: str
588
+ last_name: Optional[str] = Field(default=None)
589
+ user_id: Optional[int] = Field(default=None)
590
+ vcard: Optional[str] = Field(default=None)
591
+
592
+ class Dice(BaseModel):
593
+ '''
594
+ This object represents an animated emoji that displays
595
+ a random value.
596
+
597
+ Reference: https://core.telegram.org/bots/api#dice
598
+ '''
599
+
600
+ emoji: str
601
+ value: int
602
+
603
+ class PollOption(BaseModel):
604
+ '''
605
+ This object contains information about one answer option
606
+ in a poll.
607
+
608
+ Reference: https://core.telegram.org/bots/api#polloption
609
+ '''
610
+
611
+ text: str
612
+ voter_count: int
613
+ text_entities: Optional[List[MessageEntity]] = Field(default=None)
614
+
615
+ class InputPollOption(BaseModel):
616
+ '''
617
+ This object contains information about one answer option
618
+ in a poll to be sent.
619
+
620
+ Reference: https://core.telegram.org/bots/api#inputpolloption
621
+ '''
622
+
623
+ text: str
624
+ text_parse_mode: Optional[str] = Field(default=None)
625
+ text_entities: Optional[List[MessageEntity]] = Field(default=None)
626
+
627
+ class PollAnswer(BaseModel):
628
+ '''
629
+ This object represents an answer of a user
630
+ in a non-anonymous poll.
631
+
632
+ Reference: https://core.telegram.org/bots/api#pollanswer
633
+ '''
634
+
635
+ poll_id: str
636
+ option_ids: List[int]
637
+ voter_chat: Optional[Chat] = Field(default=None)
638
+ user: Optional[User] = Field(default=None)
639
+
640
+ class Poll(BaseModel):
641
+ '''
642
+ This object contains information about a poll.
643
+
644
+ Reference: https://core.telegram.org/bots/api#poll
645
+ '''
646
+
647
+ id: str
648
+ question: str
649
+ options: List[PollOption]
650
+ total_voter_count: int
651
+ is_closed: bool
652
+ is_anonymous: bool
653
+ type: str
654
+ allows_multiple_answers: bool
655
+ question_entities: Optional[List[MessageEntity]] = Field(default=None)
656
+ correct_option_id: Optional[int] = Field(default=None)
657
+ explanation: Optional[str] = Field(default=None)
658
+ explanation_entities: Optional[List[MessageEntity]] = Field(default=None)
659
+ open_period: Optional[int] = Field(default=None)
660
+ close_date: Optional[int] = Field(default=None)
661
+
662
+ class ChecklistTask(BaseModel):
663
+ '''
664
+ Describes a task in a checklist.
665
+
666
+ Reference: https://core.telegram.org/bots/api#checklisttask
667
+ '''
668
+
669
+ id: int
670
+ text: str
671
+ text_entities: Optional[List[MessageEntity]] = Field(default=None)
672
+ completed_by_user: Optional[User] = Field(default=None)
673
+ completion_date: Optional[int] = Field(default=None)
674
+
675
+ class Checklist(BaseModel):
676
+ '''
677
+ Describes a checklist.
678
+
679
+ Reference: https://core.telegram.org/bots/api#checklist
680
+ '''
681
+
682
+ title: str
683
+ tasks: List[ChecklistTask]
684
+ title_entities: Optional[List[MessageEntity]] = Field(default=None)
685
+ others_can_add_tasks: Optional[bool] = Field(default=None)
686
+ others_can_mark_tasks_as_done: Optional[bool] = Field(default=None)
687
+
688
+ class InputChecklistTask(BaseModel):
689
+ '''
690
+ Describes a task to add to a checklist.
691
+
692
+ Reference: https://core.telegram.org/bots/api#inputchecklisttask
693
+ '''
694
+
695
+ id: int
696
+ text: str
697
+ parse_mode: Optional[str] = Field(default='HTML')
698
+ text_entities: Optional[List[MessageEntity]] = Field(default=None)
699
+
700
+ class InputChecklist(BaseModel):
701
+ '''
702
+ Describes a checklist to create.
703
+
704
+ Reference: https://core.telegram.org/bots/api#inputchecklist
705
+ '''
706
+
707
+ title: str
708
+ tasks: List[InputChecklistTask]
709
+ parse_mode: Optional[str] = Field(default='HTML')
710
+ title_entities: Optional[List[MessageEntity]] = Field(default=None)
711
+ others_can_add_tasks: Optional[bool] = Field(default=None)
712
+ others_can_mark_tasks_as_done: Optional[bool] = Field(default=None)
713
+
714
+ class ChecklistTasksDone(BaseModel):
715
+ '''
716
+ Describes a service message about checklist tasks marked
717
+ as done or not done.
718
+
719
+ Reference: https://core.telegram.org/bots/api#checklisttasksdone
720
+ '''
721
+
722
+ checklist_message: Optional[Message] = Field(default=None)
723
+ marked_as_done_task_ids: Optional[List[int]] = Field(default=None)
724
+ marked_as_not_done_task_ids: Optional[List[int]] = Field(default=None)
725
+
726
+ class ChecklistTasksAdded(BaseModel):
727
+ '''
728
+ Describes a service message about tasks added to
729
+ a checklist.
730
+
731
+ Reference: https://core.telegram.org/bots/api#checklisttasksadded
732
+ '''
733
+
734
+ tasks: List[ChecklistTask]
735
+ checklist_message: Optional[Message] = Field(default=None)
736
+
737
+ class Location(BaseModel):
738
+ '''
739
+ This object represents a point on the map.
740
+
741
+ Reference: https://core.telegram.org/bots/api#location
742
+ '''
743
+
744
+ latitude: float
745
+ longitude: float
746
+ horizontal_accuracy: Optional[float] = Field(default=None)
747
+ live_period: Optional[int] = Field(default=None)
748
+ heading: Optional[int] = Field(default=None)
749
+ proximity_alert_radius: Optional[int] = Field(default=None)
750
+
751
+ class Venue(BaseModel):
752
+ '''
753
+ This object represents a venue.
754
+
755
+ Reference: https://core.telegram.org/bots/api#venue
756
+ '''
757
+
758
+ location: Location
759
+ title: str
760
+ address: str
761
+ foursquare_id: Optional[str] = Field(default=None)
762
+ foursquare_type: Optional[str] = Field(default=None)
763
+ google_place_id: Optional[str] = Field(default=None)
764
+ google_place_type: Optional[str] = Field(default=None)
765
+
766
+ class WebAppData(BaseModel):
767
+ '''
768
+ Describes data sent from a Web App to
769
+ the bot.
770
+
771
+ Reference: https://core.telegram.org/bots/api#webappdata
772
+ '''
773
+
774
+ data: str
775
+ button_text: str
776
+
777
+ class ProximityAlertTriggered(BaseModel):
778
+ '''
779
+ This object represents the content of a service
780
+ message, sent whenever a user in the chat
781
+ triggers a proximity alert set by another user.
782
+
783
+ Reference: https://core.telegram.org/bots/api#proximityalerttriggered
784
+ '''
785
+
786
+ traveler: User
787
+ watcher: User
788
+ distance: int
789
+
790
+ class MessageAutoDeleteTimerChanged(BaseModel):
791
+ '''
792
+ This object represents a service message about a
793
+ change in auto-delete timer settings.
794
+
795
+ Reference: https://core.telegram.org/bots/api#messageautodeletetimerchanged
796
+ '''
797
+
798
+ message_auto_delete_time: int
799
+
800
+ class ChatBoostAdded(BaseModel):
801
+ '''
802
+ This object represents a service message about a
803
+ user boosting a chat.
804
+
805
+ Reference: https://core.telegram.org/bots/api#chatboostadded
806
+ '''
807
+
808
+ boost_count: int
809
+
810
+ class BackgroundFillSolid(BaseModel):
811
+ '''
812
+ The background is filled using the selected color.
813
+
814
+ Reference: https://core.telegram.org/bots/api#backgroundfillsolid
815
+ '''
816
+
817
+ type: Literal['solid'] = 'solid'
818
+ color: int
819
+
820
+ class BackgroundFillGradient(BaseModel):
821
+ '''
822
+ The background is a gradient fill.
823
+
824
+ Reference: https://core.telegram.org/bots/api#backgroundfillgradient
825
+ '''
826
+
827
+ type: Literal['gradient'] = 'gradient'
828
+ top_color: int
829
+ bottom_color: int
830
+ rotation_angle: int
831
+
832
+ class BackgroundFillFreeformGradient(BaseModel):
833
+ '''
834
+ The background is a freeform gradient that rotates
835
+ after every message in the chat.
836
+
837
+ Reference: https://core.telegram.org/bots/api#backgroundfillfreeformgradient
838
+ '''
839
+
840
+ type: Literal['freeform_gradient'] = 'freeform_gradient'
841
+ colors: List[int]
842
+
843
+ class BackgroundTypeFill(BaseModel):
844
+ '''
845
+ The background is automatically filled based on the
846
+ selected colors.
847
+
848
+ Reference: https://core.telegram.org/bots/api#backgroundtypefill
849
+ '''
850
+
851
+ type: Literal['fill'] = 'fill'
852
+ fill: BackgroundFill
853
+ dark_theme_dimming: int
854
+
855
+ class BackgroundTypeWallpaper(BaseModel):
856
+ '''
857
+ The background is a wallpaper in the JPEG
858
+ format.
859
+
860
+ Reference: https://core.telegram.org/bots/api#backgroundtypewallpaper
861
+ '''
862
+
863
+ type: Literal['wallpaper'] = 'wallpaper'
864
+ document: Document
865
+ dark_theme_dimming: int
866
+ is_blurred: Optional[bool] = Field(default=None)
867
+ is_moving: Optional[bool] = Field(default=None)
868
+
869
+ class BackgroundTypePattern(BaseModel):
870
+ '''
871
+ The background is a .PNG or .TGV (gzipped
872
+ subset of SVG with MIME type “application/x-tgwallpattern”) pattern
873
+ to be combined with the background fill chosen
874
+ by the user.
875
+
876
+ Reference: https://core.telegram.org/bots/api#backgroundtypepattern
877
+ '''
878
+
879
+ type: Literal['pattern'] = 'pattern'
880
+ document: Document
881
+ fill: BackgroundFill
882
+ intensity: int
883
+ is_inverted: Optional[bool] = Field(default=None)
884
+ is_moving: Optional[bool] = Field(default=None)
885
+
886
+ class BackgroundTypeChatTheme(BaseModel):
887
+ '''
888
+ The background is taken directly from a built-in
889
+ chat theme.
890
+
891
+ Reference: https://core.telegram.org/bots/api#backgroundtypechattheme
892
+ '''
893
+
894
+ type: Literal['chat_theme'] = 'chat_theme'
895
+ theme_name: str
896
+
897
+ class ChatBackground(BaseModel):
898
+ '''
899
+ This object represents a chat background.
900
+
901
+ Reference: https://core.telegram.org/bots/api#chatbackground
902
+ '''
903
+
904
+ type: BackgroundType
905
+
906
+ class ForumTopicCreated(BaseModel):
907
+ '''
908
+ This object represents a service message about a
909
+ new forum topic created in the chat.
910
+
911
+ Reference: https://core.telegram.org/bots/api#forumtopiccreated
912
+ '''
913
+
914
+ name: str
915
+ icon_color: int
916
+ icon_custom_emoji_id: Optional[str] = Field(default=None)
917
+
918
+ class ForumTopicClosed(BaseModel):
919
+ '''
920
+ This object represents a service message about a
921
+ forum topic closed in the chat. Currently holds
922
+ no information.
923
+
924
+ Reference: https://core.telegram.org/bots/api#forumtopicclosed
925
+ '''
926
+
927
+ pass
928
+
929
+
930
+ class ForumTopicEdited(BaseModel):
931
+ '''
932
+ This object represents a service message about an
933
+ edited forum topic.
934
+
935
+ Reference: https://core.telegram.org/bots/api#forumtopicedited
936
+ '''
937
+
938
+ name: Optional[str] = Field(default=None)
939
+ icon_custom_emoji_id: Optional[str] = Field(default=None)
940
+
941
+ class ForumTopicReopened(BaseModel):
942
+ '''
943
+ This object represents a service message about a
944
+ forum topic reopened in the chat. Currently holds
945
+ no information.
946
+
947
+ Reference: https://core.telegram.org/bots/api#forumtopicreopened
948
+ '''
949
+
950
+ pass
951
+
952
+
953
+ class GeneralForumTopicHidden(BaseModel):
954
+ '''
955
+ This object represents a service message about General
956
+ forum topic hidden in the chat. Currently holds
957
+ no information.
958
+
959
+ Reference: https://core.telegram.org/bots/api#generalforumtopichidden
960
+ '''
961
+
962
+ pass
963
+
964
+
965
+ class GeneralForumTopicUnhidden(BaseModel):
966
+ '''
967
+ This object represents a service message about General
968
+ forum topic unhidden in the chat. Currently holds
969
+ no information.
970
+
971
+ Reference: https://core.telegram.org/bots/api#generalforumtopicunhidden
972
+ '''
973
+
974
+ pass
975
+
976
+
977
+ class SharedUser(BaseModel):
978
+ '''
979
+ This object contains information about a user that
980
+ was shared with the bot using a KeyboardButtonRequestUsers
981
+ button.
982
+
983
+ Reference: https://core.telegram.org/bots/api#shareduser
984
+ '''
985
+
986
+ user_id: int
987
+ first_name: Optional[str] = Field(default=None)
988
+ last_name: Optional[str] = Field(default=None)
989
+ username: Optional[str] = Field(default=None)
990
+ photo: Optional[List[PhotoSize]] = Field(default=None)
991
+
992
+ class UsersShared(BaseModel):
993
+ '''
994
+ This object contains information about the users whose
995
+ identifiers were shared with the bot using a
996
+ KeyboardButtonRequestUsers button.
997
+
998
+ Reference: https://core.telegram.org/bots/api#usersshared
999
+ '''
1000
+
1001
+ request_id: int
1002
+ users: List[SharedUser]
1003
+
1004
+ class ChatShared(BaseModel):
1005
+ '''
1006
+ This object contains information about a chat that
1007
+ was shared with the bot using a KeyboardButtonRequestChat
1008
+ button.
1009
+
1010
+ Reference: https://core.telegram.org/bots/api#chatshared
1011
+ '''
1012
+
1013
+ request_id: int
1014
+ chat_id: int
1015
+ title: Optional[str] = Field(default=None)
1016
+ username: Optional[str] = Field(default=None)
1017
+ photo: Optional[List[PhotoSize]] = Field(default=None)
1018
+
1019
+ class WriteAccessAllowed(BaseModel):
1020
+ '''
1021
+ This object represents a service message about a
1022
+ user allowing a bot to write messages after
1023
+ adding it to the attachment menu, launching a
1024
+ Web App from a link, or accepting an
1025
+ explicit request from a Web App sent by
1026
+ the method requestWriteAccess.
1027
+
1028
+ Reference: https://core.telegram.org/bots/api#writeaccessallowed
1029
+ '''
1030
+
1031
+ from_request: Optional[bool] = Field(default=None)
1032
+ web_app_name: Optional[str] = Field(default=None)
1033
+ from_attachment_menu: Optional[bool] = Field(default=None)
1034
+
1035
+ class VideoChatScheduled(BaseModel):
1036
+ '''
1037
+ This object represents a service message about a
1038
+ video chat scheduled in the chat.
1039
+
1040
+ Reference: https://core.telegram.org/bots/api#videochatscheduled
1041
+ '''
1042
+
1043
+ start_date: int
1044
+
1045
+ class VideoChatStarted(BaseModel):
1046
+ '''
1047
+ This object represents a service message about a
1048
+ video chat started in the chat. Currently holds
1049
+ no information.
1050
+
1051
+ Reference: https://core.telegram.org/bots/api#videochatstarted
1052
+ '''
1053
+
1054
+ pass
1055
+
1056
+
1057
+ class VideoChatEnded(BaseModel):
1058
+ '''
1059
+ This object represents a service message about a
1060
+ video chat ended in the chat.
1061
+
1062
+ Reference: https://core.telegram.org/bots/api#videochatended
1063
+ '''
1064
+
1065
+ duration: int
1066
+
1067
+ class VideoChatParticipantsInvited(BaseModel):
1068
+ '''
1069
+ This object represents a service message about new
1070
+ members invited to a video chat.
1071
+
1072
+ Reference: https://core.telegram.org/bots/api#videochatparticipantsinvited
1073
+ '''
1074
+
1075
+ users: List[User]
1076
+
1077
+ class PaidMessagePriceChanged(BaseModel):
1078
+ '''
1079
+ Describes a service message about a change in
1080
+ the price of paid messages within a chat.
1081
+
1082
+ Reference: https://core.telegram.org/bots/api#paidmessagepricechanged
1083
+ '''
1084
+
1085
+ paid_message_star_count: int
1086
+
1087
+ class DirectMessagePriceChanged(BaseModel):
1088
+ '''
1089
+ Describes a service message about a change in
1090
+ the price of direct messages sent to a
1091
+ channel chat.
1092
+
1093
+ Reference: https://core.telegram.org/bots/api#directmessagepricechanged
1094
+ '''
1095
+
1096
+ are_direct_messages_enabled: bool
1097
+ direct_message_star_count: Optional[int] = Field(default=None)
1098
+
1099
+ class SuggestedPostApproved(BaseModel):
1100
+ '''
1101
+ Describes a service message about the approval of
1102
+ a suggested post.
1103
+
1104
+ Reference: https://core.telegram.org/bots/api#suggestedpostapproved
1105
+ '''
1106
+
1107
+ send_date: int
1108
+ suggested_post_message: Optional[Message] = Field(default=None)
1109
+ price: Optional[SuggestedPostPrice] = Field(default=None)
1110
+
1111
+ class SuggestedPostApprovalFailed(BaseModel):
1112
+ '''
1113
+ Describes a service message about the failed approval
1114
+ of a suggested post. Currently, only caused by
1115
+ insufficient user funds at the time of approval.
1116
+
1117
+ Reference: https://core.telegram.org/bots/api#suggestedpostapprovalfailed
1118
+ '''
1119
+
1120
+ price: SuggestedPostPrice
1121
+ suggested_post_message: Optional[Message] = Field(default=None)
1122
+
1123
+ class SuggestedPostDeclined(BaseModel):
1124
+ '''
1125
+ Describes a service message about the rejection of
1126
+ a suggested post.
1127
+
1128
+ Reference: https://core.telegram.org/bots/api#suggestedpostdeclined
1129
+ '''
1130
+
1131
+ suggested_post_message: Optional[Message] = Field(default=None)
1132
+ comment: Optional[str] = Field(default=None)
1133
+
1134
+ class SuggestedPostPaid(BaseModel):
1135
+ '''
1136
+ Describes a service message about a successful payment
1137
+ for a suggested post.
1138
+
1139
+ Reference: https://core.telegram.org/bots/api#suggestedpostpaid
1140
+ '''
1141
+
1142
+ currency: str
1143
+ suggested_post_message: Optional[Message] = Field(default=None)
1144
+ amount: Optional[int] = Field(default=None)
1145
+ star_amount: Optional[StarAmount] = Field(default=None)
1146
+
1147
+ class SuggestedPostRefunded(BaseModel):
1148
+ '''
1149
+ Describes a service message about a payment refund
1150
+ for a suggested post.
1151
+
1152
+ Reference: https://core.telegram.org/bots/api#suggestedpostrefunded
1153
+ '''
1154
+
1155
+ reason: str
1156
+ suggested_post_message: Optional[Message] = Field(default=None)
1157
+
1158
+ class GiveawayCreated(BaseModel):
1159
+ '''
1160
+ This object represents a service message about the
1161
+ creation of a scheduled giveaway.
1162
+
1163
+ Reference: https://core.telegram.org/bots/api#giveawaycreated
1164
+ '''
1165
+
1166
+ prize_star_count: Optional[int] = Field(default=None)
1167
+
1168
+ class Giveaway(BaseModel):
1169
+ '''
1170
+ This object represents a message about a scheduled
1171
+ giveaway.
1172
+
1173
+ Reference: https://core.telegram.org/bots/api#giveaway
1174
+ '''
1175
+
1176
+ chats: List[Chat]
1177
+ winners_selection_date: int
1178
+ winner_count: int
1179
+ only_new_members: Optional[bool] = Field(default=None)
1180
+ has_public_winners: Optional[bool] = Field(default=None)
1181
+ prize_description: Optional[str] = Field(default=None)
1182
+ country_codes: Optional[List[str]] = Field(default=None)
1183
+ prize_star_count: Optional[int] = Field(default=None)
1184
+ premium_subscription_month_count: Optional[int] = Field(default=None)
1185
+
1186
+ class GiveawayWinners(BaseModel):
1187
+ '''
1188
+ This object represents a message about the completion
1189
+ of a giveaway with public winners.
1190
+
1191
+ Reference: https://core.telegram.org/bots/api#giveawaywinners
1192
+ '''
1193
+
1194
+ chat: Chat
1195
+ giveaway_message_id: int
1196
+ winners_selection_date: int
1197
+ winner_count: int
1198
+ winners: List[User]
1199
+ additional_chat_count: Optional[int] = Field(default=None)
1200
+ prize_star_count: Optional[int] = Field(default=None)
1201
+ premium_subscription_month_count: Optional[int] = Field(default=None)
1202
+ unclaimed_prize_count: Optional[int] = Field(default=None)
1203
+ only_new_members: Optional[bool] = Field(default=None)
1204
+ was_refunded: Optional[bool] = Field(default=None)
1205
+ prize_description: Optional[str] = Field(default=None)
1206
+
1207
+ class GiveawayCompleted(BaseModel):
1208
+ '''
1209
+ This object represents a service message about the
1210
+ completion of a giveaway without public winners.
1211
+
1212
+ Reference: https://core.telegram.org/bots/api#giveawaycompleted
1213
+ '''
1214
+
1215
+ winner_count: int
1216
+ unclaimed_prize_count: Optional[int] = Field(default=None)
1217
+ giveaway_message: Optional[Message] = Field(default=None)
1218
+ is_star_giveaway: Optional[bool] = Field(default=None)
1219
+
1220
+ class LinkPreviewOptions(BaseModel):
1221
+ '''
1222
+ Describes the options used for link preview generation.
1223
+
1224
+ Reference: https://core.telegram.org/bots/api#linkpreviewoptions
1225
+ '''
1226
+
1227
+ is_disabled: Optional[bool] = Field(default=None)
1228
+ url: Optional[str] = Field(default=None)
1229
+ prefer_small_media: Optional[bool] = Field(default=None)
1230
+ prefer_large_media: Optional[bool] = Field(default=None)
1231
+ show_above_text: Optional[bool] = Field(default=None)
1232
+
1233
+ class SuggestedPostPrice(BaseModel):
1234
+ '''
1235
+ Describes the price of a suggested post.
1236
+
1237
+ Reference: https://core.telegram.org/bots/api#suggestedpostprice
1238
+ '''
1239
+
1240
+ currency: str
1241
+ amount: int
1242
+
1243
+ class SuggestedPostInfo(BaseModel):
1244
+ '''
1245
+ Contains information about a suggested post.
1246
+
1247
+ Reference: https://core.telegram.org/bots/api#suggestedpostinfo
1248
+ '''
1249
+
1250
+ state: str
1251
+ price: Optional[SuggestedPostPrice] = Field(default=None)
1252
+ send_date: Optional[int] = Field(default=None)
1253
+
1254
+ class SuggestedPostParameters(BaseModel):
1255
+ '''
1256
+ Contains parameters of a post that is being
1257
+ suggested by the bot.
1258
+
1259
+ Reference: https://core.telegram.org/bots/api#suggestedpostparameters
1260
+ '''
1261
+
1262
+ price: Optional[SuggestedPostPrice] = Field(default=None)
1263
+ send_date: Optional[int] = Field(default=None)
1264
+
1265
+ class DirectMessagesTopic(BaseModel):
1266
+ '''
1267
+ Describes a topic of a direct messages chat.
1268
+
1269
+ Reference: https://core.telegram.org/bots/api#directmessagestopic
1270
+ '''
1271
+
1272
+ topic_id: int
1273
+ user: Optional[User] = Field(default=None)
1274
+
1275
+ class UserProfilePhotos(BaseModel):
1276
+ '''
1277
+ This object represent a user's profile pictures.
1278
+
1279
+ Reference: https://core.telegram.org/bots/api#userprofilephotos
1280
+ '''
1281
+
1282
+ total_count: int
1283
+ photos: List[List[PhotoSize]]
1284
+
1285
+ class File(BaseModel):
1286
+ '''
1287
+ This object represents a file ready to be
1288
+ downloaded. The file can be downloaded via the
1289
+ link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link
1290
+ will be valid for at least 1 hour.
1291
+ When the link expires, a new one can
1292
+ be requested by calling getFile.
1293
+
1294
+ Reference: https://core.telegram.org/bots/api#file
1295
+ '''
1296
+
1297
+ file_id: str
1298
+ file_unique_id: str
1299
+ file_size: Optional[int] = Field(default=None)
1300
+ file_path: Optional[str] = Field(default=None)
1301
+
1302
+ class WebAppInfo(BaseModel):
1303
+ '''
1304
+ Describes a Web App.
1305
+
1306
+ Reference: https://core.telegram.org/bots/api#webappinfo
1307
+ '''
1308
+
1309
+ url: str
1310
+
1311
+ class ReplyKeyboardMarkup(BaseModel):
1312
+ '''
1313
+ This object represents a custom keyboard with reply
1314
+ options (see Introduction to bots for details and
1315
+ examples). Not supported in channels and for messages
1316
+ sent on behalf of a Telegram Business account.
1317
+
1318
+ Reference: https://core.telegram.org/bots/api#replykeyboardmarkup
1319
+ '''
1320
+
1321
+ keyboard: List[List[KeyboardButton]]
1322
+ is_persistent: Optional[bool] = Field(default=None)
1323
+ resize_keyboard: Optional[bool] = Field(default=None)
1324
+ one_time_keyboard: Optional[bool] = Field(default=None)
1325
+ input_field_placeholder: Optional[str] = Field(default=None)
1326
+ selective: Optional[bool] = Field(default=None)
1327
+
1328
+ class KeyboardButton(BaseModel):
1329
+ '''
1330
+ This object represents one button of the reply
1331
+ keyboard. At most one of the optional fields
1332
+ must be used to specify type of the
1333
+ button. For simple text buttons, String can be
1334
+ used instead of this object to specify the
1335
+ button text.
1336
+
1337
+ Reference: https://core.telegram.org/bots/api#keyboardbutton
1338
+ '''
1339
+
1340
+ text: str
1341
+ request_users: Optional[KeyboardButtonRequestUsers] = Field(default=None)
1342
+ request_chat: Optional[KeyboardButtonRequestChat] = Field(default=None)
1343
+ request_contact: Optional[bool] = Field(default=None)
1344
+ request_location: Optional[bool] = Field(default=None)
1345
+ request_poll: Optional[KeyboardButtonPollType] = Field(default=None)
1346
+ web_app: Optional[WebAppInfo] = Field(default=None)
1347
+
1348
+ class KeyboardButtonRequestUsers(BaseModel):
1349
+ '''
1350
+ This object defines the criteria used to request
1351
+ suitable users. Information about the selected users will
1352
+ be shared with the bot when the corresponding
1353
+ button is pressed. More about requesting users »
1354
+
1355
+ Reference: https://core.telegram.org/bots/api#keyboardbuttonrequestusers
1356
+ '''
1357
+
1358
+ request_id: int
1359
+ user_is_bot: Optional[bool] = Field(default=None)
1360
+ user_is_premium: Optional[bool] = Field(default=None)
1361
+ max_quantity: Optional[int] = Field(default=None)
1362
+ request_name: Optional[bool] = Field(default=None)
1363
+ request_username: Optional[bool] = Field(default=None)
1364
+ request_photo: Optional[bool] = Field(default=None)
1365
+
1366
+ class KeyboardButtonRequestChat(BaseModel):
1367
+ '''
1368
+ This object defines the criteria used to request
1369
+ a suitable chat. Information about the selected chat
1370
+ will be shared with the bot when the
1371
+ corresponding button is pressed. The bot will be
1372
+ granted requested rights in the chat if appropriate.
1373
+ More about requesting chats ».
1374
+
1375
+ Reference: https://core.telegram.org/bots/api#keyboardbuttonrequestchat
1376
+ '''
1377
+
1378
+ request_id: int
1379
+ chat_is_channel: bool
1380
+ chat_is_forum: Optional[bool] = Field(default=None)
1381
+ chat_has_username: Optional[bool] = Field(default=None)
1382
+ chat_is_created: Optional[bool] = Field(default=None)
1383
+ user_administrator_rights: Optional[ChatAdministratorRights] = Field(default=None)
1384
+ bot_administrator_rights: Optional[ChatAdministratorRights] = Field(default=None)
1385
+ bot_is_member: Optional[bool] = Field(default=None)
1386
+ request_title: Optional[bool] = Field(default=None)
1387
+ request_username: Optional[bool] = Field(default=None)
1388
+ request_photo: Optional[bool] = Field(default=None)
1389
+
1390
+ class KeyboardButtonPollType(BaseModel):
1391
+ '''
1392
+ This object represents type of a poll, which
1393
+ is allowed to be created and sent when
1394
+ the corresponding button is pressed.
1395
+
1396
+ Reference: https://core.telegram.org/bots/api#keyboardbuttonpolltype
1397
+ '''
1398
+
1399
+ type: Optional[str] = Field(default=None)
1400
+
1401
+ class ReplyKeyboardRemove(BaseModel):
1402
+ '''
1403
+ Upon receiving a message with this object, Telegram
1404
+ clients will remove the current custom keyboard and
1405
+ display the default letter-keyboard. By default, custom keyboards
1406
+ are displayed until a new keyboard is sent
1407
+ by a bot. An exception is made for
1408
+ one-time keyboards that are hidden immediately after the
1409
+ user presses a button (see ReplyKeyboardMarkup). Not supported
1410
+ in channels and for messages sent on behalf
1411
+ of a Telegram Business account.
1412
+
1413
+ Reference: https://core.telegram.org/bots/api#replykeyboardremove
1414
+ '''
1415
+
1416
+ remove_keyboard: bool
1417
+ selective: Optional[bool] = Field(default=None)
1418
+
1419
+ class InlineKeyboardMarkup(BaseModel):
1420
+ '''
1421
+ This object represents an inline keyboard that appears
1422
+ right next to the message it belongs to.
1423
+
1424
+ Reference: https://core.telegram.org/bots/api#inlinekeyboardmarkup
1425
+ '''
1426
+
1427
+ inline_keyboard: List[List[InlineKeyboardButton]]
1428
+
1429
+ class InlineKeyboardButton(BaseModel):
1430
+ '''
1431
+ This object represents one button of an inline
1432
+ keyboard. Exactly one of the optional fields must
1433
+ be used to specify type of the button.
1434
+
1435
+ Reference: https://core.telegram.org/bots/api#inlinekeyboardbutton
1436
+ '''
1437
+
1438
+ text: str
1439
+ url: Optional[str] = Field(default=None)
1440
+ callback_data: Optional[str] = Field(default=None)
1441
+ web_app: Optional[WebAppInfo] = Field(default=None)
1442
+ login_url: Optional[LoginUrl] = Field(default=None)
1443
+ switch_inline_query: Optional[str] = Field(default=None)
1444
+ switch_inline_query_current_chat: Optional[str] = Field(default=None)
1445
+ switch_inline_query_chosen_chat: Optional[SwitchInlineQueryChosenChat] = Field(default=None)
1446
+ copy_text: Optional[CopyTextButton] = Field(default=None)
1447
+ callback_game: Optional[CallbackGame] = Field(default=None)
1448
+ pay: Optional[bool] = Field(default=None)
1449
+
1450
+ class LoginUrl(BaseModel):
1451
+ '''
1452
+ This object represents a parameter of the inline
1453
+ keyboard button used to automatically authorize a user.
1454
+ Serves as a great replacement for the Telegram
1455
+ Login Widget when the user is coming from
1456
+ Telegram. All the user needs to do is
1457
+ tap/click a button and confirm that they want
1458
+ to log in:
1459
+
1460
+ Reference: https://core.telegram.org/bots/api#loginurl
1461
+ '''
1462
+
1463
+ url: str
1464
+ forward_text: Optional[str] = Field(default=None)
1465
+ bot_username: Optional[str] = Field(default=None)
1466
+ request_write_access: Optional[bool] = Field(default=None)
1467
+
1468
+ class SwitchInlineQueryChosenChat(BaseModel):
1469
+ '''
1470
+ This object represents an inline button that switches
1471
+ the current user to inline mode in a
1472
+ chosen chat, with an optional default inline query.
1473
+
1474
+ Reference: https://core.telegram.org/bots/api#switchinlinequerychosenchat
1475
+ '''
1476
+
1477
+ query: Optional[str] = Field(default=None)
1478
+ allow_user_chats: Optional[bool] = Field(default=None)
1479
+ allow_bot_chats: Optional[bool] = Field(default=None)
1480
+ allow_group_chats: Optional[bool] = Field(default=None)
1481
+ allow_channel_chats: Optional[bool] = Field(default=None)
1482
+
1483
+ class CopyTextButton(BaseModel):
1484
+ '''
1485
+ This object represents an inline keyboard button that
1486
+ copies specified text to the clipboard.
1487
+
1488
+ Reference: https://core.telegram.org/bots/api#copytextbutton
1489
+ '''
1490
+
1491
+ text: str
1492
+
1493
+ class CallbackQuery(BaseModel):
1494
+ '''
1495
+ This object represents an incoming callback query from
1496
+ a callback button in an inline keyboard. If
1497
+ the button that originated the query was attached
1498
+ to a message sent by the bot, the
1499
+ field message will be present. If the button
1500
+ was attached to a message sent via the
1501
+ bot (in inline mode), the field inline_message_id will
1502
+ be present. Exactly one of the fields data
1503
+ or game_short_name will be present.
1504
+
1505
+ Reference: https://core.telegram.org/bots/api#callbackquery
1506
+ '''
1507
+
1508
+ id: str
1509
+ from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
1510
+ chat_instance: str
1511
+ message: Optional[MaybeInaccessibleMessage] = Field(default=None)
1512
+ inline_message_id: Optional[str] = Field(default=None)
1513
+ data: Optional[str] = Field(default=None)
1514
+ game_short_name: Optional[str] = Field(default=None)
1515
+
1516
+ class ForceReply(BaseModel):
1517
+ '''
1518
+ Upon receiving a message with this object, Telegram
1519
+ clients will display a reply interface to the
1520
+ user (act as if the user has selected
1521
+ the bot's message and tapped 'Reply'). This can
1522
+ be extremely useful if you want to create
1523
+ user-friendly step-by-step interfaces without having to sacrifice privacy
1524
+ mode. Not supported in channels and for messages
1525
+ sent on behalf of a Telegram Business account.
1526
+
1527
+ Reference: https://core.telegram.org/bots/api#forcereply
1528
+ '''
1529
+
1530
+ force_reply: bool
1531
+ input_field_placeholder: Optional[str] = Field(default=None)
1532
+ selective: Optional[bool] = Field(default=None)
1533
+
1534
+ class ChatPhoto(BaseModel):
1535
+ '''
1536
+ This object represents a chat photo.
1537
+
1538
+ Reference: https://core.telegram.org/bots/api#chatphoto
1539
+ '''
1540
+
1541
+ small_file_id: str
1542
+ small_file_unique_id: str
1543
+ big_file_id: str
1544
+ big_file_unique_id: str
1545
+
1546
+ class ChatInviteLink(BaseModel):
1547
+ '''
1548
+ Represents an invite link for a chat.
1549
+
1550
+ Reference: https://core.telegram.org/bots/api#chatinvitelink
1551
+ '''
1552
+
1553
+ invite_link: str
1554
+ creator: User
1555
+ creates_join_request: bool
1556
+ is_primary: bool
1557
+ is_revoked: bool
1558
+ name: Optional[str] = Field(default=None)
1559
+ expire_date: Optional[int] = Field(default=None)
1560
+ member_limit: Optional[int] = Field(default=None)
1561
+ pending_join_request_count: Optional[int] = Field(default=None)
1562
+ subscription_period: Optional[int] = Field(default=None)
1563
+ subscription_price: Optional[int] = Field(default=None)
1564
+
1565
+ class ChatAdministratorRights(BaseModel):
1566
+ '''
1567
+ Represents the rights of an administrator in a
1568
+ chat.
1569
+
1570
+ Reference: https://core.telegram.org/bots/api#chatadministratorrights
1571
+ '''
1572
+
1573
+ is_anonymous: bool
1574
+ can_manage_chat: bool
1575
+ can_delete_messages: bool
1576
+ can_manage_video_chats: bool
1577
+ can_restrict_members: bool
1578
+ can_promote_members: bool
1579
+ can_change_info: bool
1580
+ can_invite_users: bool
1581
+ can_post_stories: bool
1582
+ can_edit_stories: bool
1583
+ can_delete_stories: bool
1584
+ can_post_messages: Optional[bool] = Field(default=None)
1585
+ can_edit_messages: Optional[bool] = Field(default=None)
1586
+ can_pin_messages: Optional[bool] = Field(default=None)
1587
+ can_manage_topics: Optional[bool] = Field(default=None)
1588
+ can_manage_direct_messages: Optional[bool] = Field(default=None)
1589
+
1590
+ class ChatMemberUpdated(BaseModel):
1591
+ '''
1592
+ This object represents changes in the status of
1593
+ a chat member.
1594
+
1595
+ Reference: https://core.telegram.org/bots/api#chatmemberupdated
1596
+ '''
1597
+
1598
+ chat: Chat
1599
+ from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
1600
+ date: int
1601
+ old_chat_member: ChatMember
1602
+ new_chat_member: ChatMember
1603
+ invite_link: Optional[ChatInviteLink] = Field(default=None)
1604
+ via_join_request: Optional[bool] = Field(default=None)
1605
+ via_chat_folder_invite_link: Optional[bool] = Field(default=None)
1606
+
1607
+ class ChatMemberOwner(BaseModel):
1608
+ '''
1609
+ Represents a chat member that owns the chat
1610
+ and has all administrator privileges.
1611
+
1612
+ Reference: https://core.telegram.org/bots/api#chatmemberowner
1613
+ '''
1614
+
1615
+ status: Literal['creator'] = 'creator'
1616
+ user: User
1617
+ is_anonymous: bool
1618
+ custom_title: Optional[str] = Field(default=None)
1619
+
1620
+ class ChatMemberAdministrator(BaseModel):
1621
+ '''
1622
+ Represents a chat member that has some additional
1623
+ privileges.
1624
+
1625
+ Reference: https://core.telegram.org/bots/api#chatmemberadministrator
1626
+ '''
1627
+
1628
+ status: Literal['administrator'] = 'administrator'
1629
+ user: User
1630
+ can_be_edited: bool
1631
+ is_anonymous: bool
1632
+ can_manage_chat: bool
1633
+ can_delete_messages: bool
1634
+ can_manage_video_chats: bool
1635
+ can_restrict_members: bool
1636
+ can_promote_members: bool
1637
+ can_change_info: bool
1638
+ can_invite_users: bool
1639
+ can_post_stories: bool
1640
+ can_edit_stories: bool
1641
+ can_delete_stories: bool
1642
+ can_post_messages: Optional[bool] = Field(default=None)
1643
+ can_edit_messages: Optional[bool] = Field(default=None)
1644
+ can_pin_messages: Optional[bool] = Field(default=None)
1645
+ can_manage_topics: Optional[bool] = Field(default=None)
1646
+ can_manage_direct_messages: Optional[bool] = Field(default=None)
1647
+ custom_title: Optional[str] = Field(default=None)
1648
+
1649
+ class ChatMemberMember(BaseModel):
1650
+ '''
1651
+ Represents a chat member that has no additional
1652
+ privileges or restrictions.
1653
+
1654
+ Reference: https://core.telegram.org/bots/api#chatmembermember
1655
+ '''
1656
+
1657
+ status: Literal['member'] = 'member'
1658
+ user: User
1659
+ until_date: Optional[int] = Field(default=None)
1660
+
1661
+ class ChatMemberRestricted(BaseModel):
1662
+ '''
1663
+ Represents a chat member that is under certain
1664
+ restrictions in the chat. Supergroups only.
1665
+
1666
+ Reference: https://core.telegram.org/bots/api#chatmemberrestricted
1667
+ '''
1668
+
1669
+ status: Literal['restricted'] = 'restricted'
1670
+ user: User
1671
+ is_member: bool
1672
+ can_send_messages: bool
1673
+ can_send_audios: bool
1674
+ can_send_documents: bool
1675
+ can_send_photos: bool
1676
+ can_send_videos: bool
1677
+ can_send_video_notes: bool
1678
+ can_send_voice_notes: bool
1679
+ can_send_polls: bool
1680
+ can_send_other_messages: bool
1681
+ can_add_web_page_previews: bool
1682
+ can_change_info: bool
1683
+ can_invite_users: bool
1684
+ can_pin_messages: bool
1685
+ can_manage_topics: bool
1686
+ until_date: int
1687
+
1688
+ class ChatMemberLeft(BaseModel):
1689
+ '''
1690
+ Represents a chat member that isn't currently a
1691
+ member of the chat, but may join it
1692
+ themselves.
1693
+
1694
+ Reference: https://core.telegram.org/bots/api#chatmemberleft
1695
+ '''
1696
+
1697
+ status: Literal['left'] = 'left'
1698
+ user: User
1699
+
1700
+ class ChatMemberBanned(BaseModel):
1701
+ '''
1702
+ Represents a chat member that was banned in
1703
+ the chat and can't return to the chat
1704
+ or view chat messages.
1705
+
1706
+ Reference: https://core.telegram.org/bots/api#chatmemberbanned
1707
+ '''
1708
+
1709
+ status: Literal['kicked'] = 'kicked'
1710
+ user: User
1711
+ until_date: int
1712
+
1713
+ class ChatJoinRequest(BaseModel):
1714
+ '''
1715
+ Represents a join request sent to a chat.
1716
+
1717
+ Reference: https://core.telegram.org/bots/api#chatjoinrequest
1718
+ '''
1719
+
1720
+ chat: Chat
1721
+ from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
1722
+ user_chat_id: int
1723
+ date: int
1724
+ bio: Optional[str] = Field(default=None)
1725
+ invite_link: Optional[ChatInviteLink] = Field(default=None)
1726
+
1727
+ class ChatPermissions(BaseModel):
1728
+ '''
1729
+ Describes actions that a non-administrator user is allowed
1730
+ to take in a chat.
1731
+
1732
+ Reference: https://core.telegram.org/bots/api#chatpermissions
1733
+ '''
1734
+
1735
+ can_send_messages: Optional[bool] = Field(default=None)
1736
+ can_send_audios: Optional[bool] = Field(default=None)
1737
+ can_send_documents: Optional[bool] = Field(default=None)
1738
+ can_send_photos: Optional[bool] = Field(default=None)
1739
+ can_send_videos: Optional[bool] = Field(default=None)
1740
+ can_send_video_notes: Optional[bool] = Field(default=None)
1741
+ can_send_voice_notes: Optional[bool] = Field(default=None)
1742
+ can_send_polls: Optional[bool] = Field(default=None)
1743
+ can_send_other_messages: Optional[bool] = Field(default=None)
1744
+ can_add_web_page_previews: Optional[bool] = Field(default=None)
1745
+ can_change_info: Optional[bool] = Field(default=None)
1746
+ can_invite_users: Optional[bool] = Field(default=None)
1747
+ can_pin_messages: Optional[bool] = Field(default=None)
1748
+ can_manage_topics: Optional[bool] = Field(default=None)
1749
+
1750
+ class Birthdate(BaseModel):
1751
+ '''
1752
+ Describes the birthdate of a user.
1753
+
1754
+ Reference: https://core.telegram.org/bots/api#birthdate
1755
+ '''
1756
+
1757
+ day: int
1758
+ month: int
1759
+ year: Optional[int] = Field(default=None)
1760
+
1761
+ class BusinessIntro(BaseModel):
1762
+ '''
1763
+ Contains information about the start page settings of
1764
+ a Telegram Business account.
1765
+
1766
+ Reference: https://core.telegram.org/bots/api#businessintro
1767
+ '''
1768
+
1769
+ title: Optional[str] = Field(default=None)
1770
+ message: Optional[str] = Field(default=None)
1771
+ sticker: Optional[Sticker] = Field(default=None)
1772
+
1773
+ class BusinessLocation(BaseModel):
1774
+ '''
1775
+ Contains information about the location of a Telegram
1776
+ Business account.
1777
+
1778
+ Reference: https://core.telegram.org/bots/api#businesslocation
1779
+ '''
1780
+
1781
+ address: str
1782
+ location: Optional[Location] = Field(default=None)
1783
+
1784
+ class BusinessOpeningHoursInterval(BaseModel):
1785
+ '''
1786
+ Describes an interval of time during which a
1787
+ business is open.
1788
+
1789
+ Reference: https://core.telegram.org/bots/api#businessopeninghoursinterval
1790
+ '''
1791
+
1792
+ opening_minute: int
1793
+ closing_minute: int
1794
+
1795
+ class BusinessOpeningHours(BaseModel):
1796
+ '''
1797
+ Describes the opening hours of a business.
1798
+
1799
+ Reference: https://core.telegram.org/bots/api#businessopeninghours
1800
+ '''
1801
+
1802
+ time_zone_name: str
1803
+ opening_hours: List[BusinessOpeningHoursInterval]
1804
+
1805
+ class StoryAreaPosition(BaseModel):
1806
+ '''
1807
+ Describes the position of a clickable area within
1808
+ a story.
1809
+
1810
+ Reference: https://core.telegram.org/bots/api#storyareaposition
1811
+ '''
1812
+
1813
+ x_percentage: float
1814
+ y_percentage: float
1815
+ width_percentage: float
1816
+ height_percentage: float
1817
+ rotation_angle: float
1818
+ corner_radius_percentage: float
1819
+
1820
+ class LocationAddress(BaseModel):
1821
+ '''
1822
+ Describes the physical address of a location.
1823
+
1824
+ Reference: https://core.telegram.org/bots/api#locationaddress
1825
+ '''
1826
+
1827
+ country_code: str
1828
+ state: Optional[str] = Field(default=None)
1829
+ city: Optional[str] = Field(default=None)
1830
+ street: Optional[str] = Field(default=None)
1831
+
1832
+ class StoryAreaTypeLocation(BaseModel):
1833
+ '''
1834
+ Describes a story area pointing to a location.
1835
+ Currently, a story can have up to 10
1836
+ location areas.
1837
+
1838
+ Reference: https://core.telegram.org/bots/api#storyareatypelocation
1839
+ '''
1840
+
1841
+ type: Literal['location'] = 'location'
1842
+ latitude: float
1843
+ longitude: float
1844
+ address: Optional[LocationAddress] = Field(default=None)
1845
+
1846
+ class StoryAreaTypeSuggestedReaction(BaseModel):
1847
+ '''
1848
+ Describes a story area pointing to a suggested
1849
+ reaction. Currently, a story can have up to
1850
+ 5 suggested reaction areas.
1851
+
1852
+ Reference: https://core.telegram.org/bots/api#storyareatypesuggestedreaction
1853
+ '''
1854
+
1855
+ type: Literal['suggested_reaction'] = 'suggested_reaction'
1856
+ reaction_type: ReactionType
1857
+ is_dark: Optional[bool] = Field(default=None)
1858
+ is_flipped: Optional[bool] = Field(default=None)
1859
+
1860
+ class StoryAreaTypeLink(BaseModel):
1861
+ '''
1862
+ Describes a story area pointing to an HTTP
1863
+ or tg:// link. Currently, a story can have
1864
+ up to 3 link areas.
1865
+
1866
+ Reference: https://core.telegram.org/bots/api#storyareatypelink
1867
+ '''
1868
+
1869
+ type: Literal['link'] = 'link'
1870
+ url: str
1871
+
1872
+ class StoryAreaTypeWeather(BaseModel):
1873
+ '''
1874
+ Describes a story area containing weather information. Currently,
1875
+ a story can have up to 3 weather
1876
+ areas.
1877
+
1878
+ Reference: https://core.telegram.org/bots/api#storyareatypeweather
1879
+ '''
1880
+
1881
+ type: Literal['weather'] = 'weather'
1882
+ temperature: float
1883
+ emoji: str
1884
+ background_color: int
1885
+
1886
+ class StoryAreaTypeUniqueGift(BaseModel):
1887
+ '''
1888
+ Describes a story area pointing to a unique
1889
+ gift. Currently, a story can have at most
1890
+ 1 unique gift area.
1891
+
1892
+ Reference: https://core.telegram.org/bots/api#storyareatypeuniquegift
1893
+ '''
1894
+
1895
+ type: Literal['unique_gift'] = 'unique_gift'
1896
+ name: str
1897
+
1898
+ class StoryArea(BaseModel):
1899
+ '''
1900
+ Describes a clickable area on a story media.
1901
+
1902
+ Reference: https://core.telegram.org/bots/api#storyarea
1903
+ '''
1904
+
1905
+ position: StoryAreaPosition
1906
+ type: StoryAreaType
1907
+
1908
+ class ChatLocation(BaseModel):
1909
+ '''
1910
+ Represents a location to which a chat is
1911
+ connected.
1912
+
1913
+ Reference: https://core.telegram.org/bots/api#chatlocation
1914
+ '''
1915
+
1916
+ location: Location
1917
+ address: str
1918
+
1919
+ class ReactionTypeEmoji(BaseModel):
1920
+ '''
1921
+ The reaction is based on an emoji.
1922
+
1923
+ Reference: https://core.telegram.org/bots/api#reactiontypeemoji
1924
+ '''
1925
+
1926
+ type: Literal['emoji'] = 'emoji'
1927
+ emoji: str
1928
+
1929
+ class ReactionTypeCustomEmoji(BaseModel):
1930
+ '''
1931
+ The reaction is based on a custom emoji.
1932
+
1933
+ Reference: https://core.telegram.org/bots/api#reactiontypecustomemoji
1934
+ '''
1935
+
1936
+ type: Literal['custom_emoji'] = 'custom_emoji'
1937
+ custom_emoji_id: str
1938
+
1939
+ class ReactionTypePaid(BaseModel):
1940
+ '''
1941
+ The reaction is paid.
1942
+
1943
+ Reference: https://core.telegram.org/bots/api#reactiontypepaid
1944
+ '''
1945
+
1946
+ type: Literal['paid'] = 'paid'
1947
+
1948
+ class ReactionCount(BaseModel):
1949
+ '''
1950
+ Represents a reaction added to a message along
1951
+ with the number of times it was added.
1952
+
1953
+ Reference: https://core.telegram.org/bots/api#reactioncount
1954
+ '''
1955
+
1956
+ type: ReactionType
1957
+ total_count: int
1958
+
1959
+ class MessageReactionUpdated(BaseModel):
1960
+ '''
1961
+ This object represents a change of a reaction
1962
+ on a message performed by a user.
1963
+
1964
+ Reference: https://core.telegram.org/bots/api#messagereactionupdated
1965
+ '''
1966
+
1967
+ chat: Chat
1968
+ message_id: int
1969
+ date: int
1970
+ old_reaction: List[ReactionType]
1971
+ new_reaction: List[ReactionType]
1972
+ user: Optional[User] = Field(default=None)
1973
+ actor_chat: Optional[Chat] = Field(default=None)
1974
+
1975
+ class MessageReactionCountUpdated(BaseModel):
1976
+ '''
1977
+ This object represents reaction changes on a message
1978
+ with anonymous reactions.
1979
+
1980
+ Reference: https://core.telegram.org/bots/api#messagereactioncountupdated
1981
+ '''
1982
+
1983
+ chat: Chat
1984
+ message_id: int
1985
+ date: int
1986
+ reactions: List[ReactionCount]
1987
+
1988
+ class ForumTopic(BaseModel):
1989
+ '''
1990
+ This object represents a forum topic.
1991
+
1992
+ Reference: https://core.telegram.org/bots/api#forumtopic
1993
+ '''
1994
+
1995
+ message_thread_id: int
1996
+ name: str
1997
+ icon_color: int
1998
+ icon_custom_emoji_id: Optional[str] = Field(default=None)
1999
+
2000
+ class Gift(BaseModel):
2001
+ '''
2002
+ This object represents a gift that can be
2003
+ sent by the bot.
2004
+
2005
+ Reference: https://core.telegram.org/bots/api#gift
2006
+ '''
2007
+
2008
+ id: str
2009
+ sticker: Sticker
2010
+ star_count: int
2011
+ upgrade_star_count: Optional[int] = Field(default=None)
2012
+ total_count: Optional[int] = Field(default=None)
2013
+ remaining_count: Optional[int] = Field(default=None)
2014
+ publisher_chat: Optional[Chat] = Field(default=None)
2015
+
2016
+ class Gifts(BaseModel):
2017
+ '''
2018
+ This object represent a list of gifts.
2019
+
2020
+ Reference: https://core.telegram.org/bots/api#gifts
2021
+ '''
2022
+
2023
+ gifts: List[Gift]
2024
+
2025
+ class UniqueGiftModel(BaseModel):
2026
+ '''
2027
+ This object describes the model of a unique
2028
+ gift.
2029
+
2030
+ Reference: https://core.telegram.org/bots/api#uniquegiftmodel
2031
+ '''
2032
+
2033
+ name: str
2034
+ sticker: Sticker
2035
+ rarity_per_mille: int
2036
+
2037
+ class UniqueGiftSymbol(BaseModel):
2038
+ '''
2039
+ This object describes the symbol shown on the
2040
+ pattern of a unique gift.
2041
+
2042
+ Reference: https://core.telegram.org/bots/api#uniquegiftsymbol
2043
+ '''
2044
+
2045
+ name: str
2046
+ sticker: Sticker
2047
+ rarity_per_mille: int
2048
+
2049
+ class UniqueGiftBackdropColors(BaseModel):
2050
+ '''
2051
+ This object describes the colors of the backdrop
2052
+ of a unique gift.
2053
+
2054
+ Reference: https://core.telegram.org/bots/api#uniquegiftbackdropcolors
2055
+ '''
2056
+
2057
+ center_color: int
2058
+ edge_color: int
2059
+ symbol_color: int
2060
+ text_color: int
2061
+
2062
+ class UniqueGiftBackdrop(BaseModel):
2063
+ '''
2064
+ This object describes the backdrop of a unique
2065
+ gift.
2066
+
2067
+ Reference: https://core.telegram.org/bots/api#uniquegiftbackdrop
2068
+ '''
2069
+
2070
+ name: str
2071
+ colors: UniqueGiftBackdropColors
2072
+ rarity_per_mille: int
2073
+
2074
+ class UniqueGift(BaseModel):
2075
+ '''
2076
+ This object describes a unique gift that was
2077
+ upgraded from a regular gift.
2078
+
2079
+ Reference: https://core.telegram.org/bots/api#uniquegift
2080
+ '''
2081
+
2082
+ base_name: str
2083
+ name: str
2084
+ number: int
2085
+ model: UniqueGiftModel
2086
+ symbol: UniqueGiftSymbol
2087
+ backdrop: UniqueGiftBackdrop
2088
+ publisher_chat: Optional[Chat] = Field(default=None)
2089
+
2090
+ class GiftInfo(BaseModel):
2091
+ '''
2092
+ Describes a service message about a regular gift
2093
+ that was sent or received.
2094
+
2095
+ Reference: https://core.telegram.org/bots/api#giftinfo
2096
+ '''
2097
+
2098
+ gift: Gift
2099
+ owned_gift_id: Optional[str] = Field(default=None)
2100
+ convert_star_count: Optional[int] = Field(default=None)
2101
+ prepaid_upgrade_star_count: Optional[int] = Field(default=None)
2102
+ can_be_upgraded: Optional[bool] = Field(default=None)
2103
+ text: Optional[str] = Field(default=None)
2104
+ entities: Optional[List[MessageEntity]] = Field(default=None)
2105
+ is_private: Optional[bool] = Field(default=None)
2106
+
2107
+ class UniqueGiftInfo(BaseModel):
2108
+ '''
2109
+ Describes a service message about a unique gift
2110
+ that was sent or received.
2111
+
2112
+ Reference: https://core.telegram.org/bots/api#uniquegiftinfo
2113
+ '''
2114
+
2115
+ gift: UniqueGift
2116
+ origin: str
2117
+ last_resale_star_count: Optional[int] = Field(default=None)
2118
+ owned_gift_id: Optional[str] = Field(default=None)
2119
+ transfer_star_count: Optional[int] = Field(default=None)
2120
+ next_transfer_date: Optional[int] = Field(default=None)
2121
+
2122
+ class OwnedGiftRegular(BaseModel):
2123
+ '''
2124
+ Describes a regular gift owned by a user
2125
+ or a chat.
2126
+
2127
+ Reference: https://core.telegram.org/bots/api#ownedgiftregular
2128
+ '''
2129
+
2130
+ type: Literal['regular'] = 'regular'
2131
+ gift: Gift
2132
+ send_date: int
2133
+ owned_gift_id: Optional[str] = Field(default=None)
2134
+ sender_user: Optional[User] = Field(default=None)
2135
+ text: Optional[str] = Field(default=None)
2136
+ entities: Optional[List[MessageEntity]] = Field(default=None)
2137
+ is_private: Optional[bool] = Field(default=None)
2138
+ is_saved: Optional[bool] = Field(default=None)
2139
+ can_be_upgraded: Optional[bool] = Field(default=None)
2140
+ was_refunded: Optional[bool] = Field(default=None)
2141
+ convert_star_count: Optional[int] = Field(default=None)
2142
+ prepaid_upgrade_star_count: Optional[int] = Field(default=None)
2143
+
2144
+ class OwnedGiftUnique(BaseModel):
2145
+ '''
2146
+ Describes a unique gift received and owned by
2147
+ a user or a chat.
2148
+
2149
+ Reference: https://core.telegram.org/bots/api#ownedgiftunique
2150
+ '''
2151
+
2152
+ type: Literal['unique'] = 'unique'
2153
+ gift: UniqueGift
2154
+ send_date: int
2155
+ owned_gift_id: Optional[str] = Field(default=None)
2156
+ sender_user: Optional[User] = Field(default=None)
2157
+ is_saved: Optional[bool] = Field(default=None)
2158
+ can_be_transferred: Optional[bool] = Field(default=None)
2159
+ transfer_star_count: Optional[int] = Field(default=None)
2160
+ next_transfer_date: Optional[int] = Field(default=None)
2161
+
2162
+ class OwnedGifts(BaseModel):
2163
+ '''
2164
+ Contains the list of gifts received and owned
2165
+ by a user or a chat.
2166
+
2167
+ Reference: https://core.telegram.org/bots/api#ownedgifts
2168
+ '''
2169
+
2170
+ total_count: int
2171
+ gifts: List[OwnedGift]
2172
+ next_offset: Optional[str] = Field(default=None)
2173
+
2174
+ class AcceptedGiftTypes(BaseModel):
2175
+ '''
2176
+ This object describes the types of gifts that
2177
+ can be gifted to a user or a
2178
+ chat.
2179
+
2180
+ Reference: https://core.telegram.org/bots/api#acceptedgifttypes
2181
+ '''
2182
+
2183
+ unlimited_gifts: bool
2184
+ limited_gifts: bool
2185
+ unique_gifts: bool
2186
+ premium_subscription: bool
2187
+
2188
+ class StarAmount(BaseModel):
2189
+ '''
2190
+ Describes an amount of Telegram Stars.
2191
+
2192
+ Reference: https://core.telegram.org/bots/api#staramount
2193
+ '''
2194
+
2195
+ amount: int
2196
+ nanostar_amount: Optional[int] = Field(default=None)
2197
+
2198
+ class BotCommand(BaseModel):
2199
+ '''
2200
+ This object represents a bot command.
2201
+
2202
+ Reference: https://core.telegram.org/bots/api#botcommand
2203
+ '''
2204
+
2205
+ command: str
2206
+ description: str
2207
+
2208
+ class BotCommandScopeDefault(BaseModel):
2209
+ '''
2210
+ Represents the default scope of bot commands. Default
2211
+ commands are used if no commands with a
2212
+ narrower scope are specified for the user.
2213
+
2214
+ Reference: https://core.telegram.org/bots/api#botcommandscopedefault
2215
+ '''
2216
+
2217
+ type: Literal['default'] = 'default'
2218
+
2219
+ class BotCommandScopeAllPrivateChats(BaseModel):
2220
+ '''
2221
+ Represents the scope of bot commands, covering all
2222
+ private chats.
2223
+
2224
+ Reference: https://core.telegram.org/bots/api#botcommandscopeallprivatechats
2225
+ '''
2226
+
2227
+ type: Literal['all_private_chats'] = 'all_private_chats'
2228
+
2229
+ class BotCommandScopeAllGroupChats(BaseModel):
2230
+ '''
2231
+ Represents the scope of bot commands, covering all
2232
+ group and supergroup chats.
2233
+
2234
+ Reference: https://core.telegram.org/bots/api#botcommandscopeallgroupchats
2235
+ '''
2236
+
2237
+ type: Literal['all_group_chats'] = 'all_group_chats'
2238
+
2239
+ class BotCommandScopeAllChatAdministrators(BaseModel):
2240
+ '''
2241
+ Represents the scope of bot commands, covering all
2242
+ group and supergroup chat administrators.
2243
+
2244
+ Reference: https://core.telegram.org/bots/api#botcommandscopeallchatadministrators
2245
+ '''
2246
+
2247
+ type: Literal['all_chat_administrators'] = 'all_chat_administrators'
2248
+
2249
+ class BotCommandScopeChat(BaseModel):
2250
+ '''
2251
+ Represents the scope of bot commands, covering a
2252
+ specific chat.
2253
+
2254
+ Reference: https://core.telegram.org/bots/api#botcommandscopechat
2255
+ '''
2256
+
2257
+ type: Literal['chat'] = 'chat'
2258
+ chat_id: Union[int, str]
2259
+
2260
+ class BotCommandScopeChatAdministrators(BaseModel):
2261
+ '''
2262
+ Represents the scope of bot commands, covering all
2263
+ administrators of a specific group or supergroup chat.
2264
+
2265
+ Reference: https://core.telegram.org/bots/api#botcommandscopechatadministrators
2266
+ '''
2267
+
2268
+ type: Literal['chat_administrators'] = 'chat_administrators'
2269
+ chat_id: Union[int, str]
2270
+
2271
+ class BotCommandScopeChatMember(BaseModel):
2272
+ '''
2273
+ Represents the scope of bot commands, covering a
2274
+ specific member of a group or supergroup chat.
2275
+
2276
+ Reference: https://core.telegram.org/bots/api#botcommandscopechatmember
2277
+ '''
2278
+
2279
+ type: Literal['chat_member'] = 'chat_member'
2280
+ chat_id: Union[int, str]
2281
+ user_id: int
2282
+
2283
+ class BotName(BaseModel):
2284
+ '''
2285
+ This object represents the bot's name.
2286
+
2287
+ Reference: https://core.telegram.org/bots/api#botname
2288
+ '''
2289
+
2290
+ name: str
2291
+
2292
+ class BotDescription(BaseModel):
2293
+ '''
2294
+ This object represents the bot's description.
2295
+
2296
+ Reference: https://core.telegram.org/bots/api#botdescription
2297
+ '''
2298
+
2299
+ description: str
2300
+
2301
+ class BotShortDescription(BaseModel):
2302
+ '''
2303
+ This object represents the bot's short description.
2304
+
2305
+ Reference: https://core.telegram.org/bots/api#botshortdescription
2306
+ '''
2307
+
2308
+ short_description: str
2309
+
2310
+ class MenuButtonCommands(BaseModel):
2311
+ '''
2312
+ Represents a menu button, which opens the bot's
2313
+ list of commands.
2314
+
2315
+ Reference: https://core.telegram.org/bots/api#menubuttoncommands
2316
+ '''
2317
+
2318
+ type: Literal['commands'] = 'commands'
2319
+
2320
+ class MenuButtonWebApp(BaseModel):
2321
+ '''
2322
+ Represents a menu button, which launches a Web
2323
+ App.
2324
+
2325
+ Reference: https://core.telegram.org/bots/api#menubuttonwebapp
2326
+ '''
2327
+
2328
+ type: Literal['web_app'] = 'web_app'
2329
+ text: str
2330
+ web_app: WebAppInfo
2331
+
2332
+ class MenuButtonDefault(BaseModel):
2333
+ '''
2334
+ Describes that no specific value for the menu
2335
+ button was set.
2336
+
2337
+ Reference: https://core.telegram.org/bots/api#menubuttondefault
2338
+ '''
2339
+
2340
+ type: Literal['default'] = 'default'
2341
+
2342
+ class ChatBoostSourcePremium(BaseModel):
2343
+ '''
2344
+ The boost was obtained by subscribing to Telegram
2345
+ Premium or by gifting a Telegram Premium subscription
2346
+ to another user.
2347
+
2348
+ Reference: https://core.telegram.org/bots/api#chatboostsourcepremium
2349
+ '''
2350
+
2351
+ source: Literal['premium'] = 'premium'
2352
+ user: User
2353
+
2354
+ class ChatBoostSourceGiftCode(BaseModel):
2355
+ '''
2356
+ The boost was obtained by the creation of
2357
+ Telegram Premium gift codes to boost a chat.
2358
+ Each such code boosts the chat 4 times
2359
+ for the duration of the corresponding Telegram Premium
2360
+ subscription.
2361
+
2362
+ Reference: https://core.telegram.org/bots/api#chatboostsourcegiftcode
2363
+ '''
2364
+
2365
+ source: Literal['gift_code'] = 'gift_code'
2366
+ user: User
2367
+
2368
+ class ChatBoostSourceGiveaway(BaseModel):
2369
+ '''
2370
+ The boost was obtained by the creation of
2371
+ a Telegram Premium or a Telegram Star giveaway.
2372
+ This boosts the chat 4 times for the
2373
+ duration of the corresponding Telegram Premium subscription for
2374
+ Telegram Premium giveaways and prize_star_count / 500 times
2375
+ for one year for Telegram Star giveaways.
2376
+
2377
+ Reference: https://core.telegram.org/bots/api#chatboostsourcegiveaway
2378
+ '''
2379
+
2380
+ source: Literal['giveaway'] = 'giveaway'
2381
+ giveaway_message_id: int
2382
+ user: Optional[User] = Field(default=None)
2383
+ prize_star_count: Optional[int] = Field(default=None)
2384
+ is_unclaimed: Optional[bool] = Field(default=None)
2385
+
2386
+ class ChatBoost(BaseModel):
2387
+ '''
2388
+ This object contains information about a chat boost.
2389
+
2390
+ Reference: https://core.telegram.org/bots/api#chatboost
2391
+ '''
2392
+
2393
+ boost_id: str
2394
+ add_date: int
2395
+ expiration_date: int
2396
+ source: ChatBoostSource
2397
+
2398
+ class ChatBoostUpdated(BaseModel):
2399
+ '''
2400
+ This object represents a boost added to a
2401
+ chat or changed.
2402
+
2403
+ Reference: https://core.telegram.org/bots/api#chatboostupdated
2404
+ '''
2405
+
2406
+ chat: Chat
2407
+ boost: ChatBoost
2408
+
2409
+ class ChatBoostRemoved(BaseModel):
2410
+ '''
2411
+ This object represents a boost removed from a
2412
+ chat.
2413
+
2414
+ Reference: https://core.telegram.org/bots/api#chatboostremoved
2415
+ '''
2416
+
2417
+ chat: Chat
2418
+ boost_id: str
2419
+ remove_date: int
2420
+ source: ChatBoostSource
2421
+
2422
+ class UserChatBoosts(BaseModel):
2423
+ '''
2424
+ This object represents a list of boosts added
2425
+ to a chat by a user.
2426
+
2427
+ Reference: https://core.telegram.org/bots/api#userchatboosts
2428
+ '''
2429
+
2430
+ boosts: List[ChatBoost]
2431
+
2432
+ class BusinessBotRights(BaseModel):
2433
+ '''
2434
+ Represents the rights of a business bot.
2435
+
2436
+ Reference: https://core.telegram.org/bots/api#businessbotrights
2437
+ '''
2438
+
2439
+ can_reply: Optional[bool] = Field(default=None)
2440
+ can_read_messages: Optional[bool] = Field(default=None)
2441
+ can_delete_sent_messages: Optional[bool] = Field(default=None)
2442
+ can_delete_all_messages: Optional[bool] = Field(default=None)
2443
+ can_edit_name: Optional[bool] = Field(default=None)
2444
+ can_edit_bio: Optional[bool] = Field(default=None)
2445
+ can_edit_profile_photo: Optional[bool] = Field(default=None)
2446
+ can_edit_username: Optional[bool] = Field(default=None)
2447
+ can_change_gift_settings: Optional[bool] = Field(default=None)
2448
+ can_view_gifts_and_stars: Optional[bool] = Field(default=None)
2449
+ can_convert_gifts_to_stars: Optional[bool] = Field(default=None)
2450
+ can_transfer_and_upgrade_gifts: Optional[bool] = Field(default=None)
2451
+ can_transfer_stars: Optional[bool] = Field(default=None)
2452
+ can_manage_stories: Optional[bool] = Field(default=None)
2453
+
2454
+ class BusinessConnection(BaseModel):
2455
+ '''
2456
+ Describes the connection of the bot with a
2457
+ business account.
2458
+
2459
+ Reference: https://core.telegram.org/bots/api#businessconnection
2460
+ '''
2461
+
2462
+ id: str
2463
+ user: User
2464
+ user_chat_id: int
2465
+ date: int
2466
+ is_enabled: bool
2467
+ rights: Optional[BusinessBotRights] = Field(default=None)
2468
+
2469
+ class BusinessMessagesDeleted(BaseModel):
2470
+ '''
2471
+ This object is received when messages are deleted
2472
+ from a connected business account.
2473
+
2474
+ Reference: https://core.telegram.org/bots/api#businessmessagesdeleted
2475
+ '''
2476
+
2477
+ business_connection_id: str
2478
+ chat: Chat
2479
+ message_ids: List[int]
2480
+
2481
+ class ResponseParameters(BaseModel):
2482
+ '''
2483
+ Describes why a request was unsuccessful.
2484
+
2485
+ Reference: https://core.telegram.org/bots/api#responseparameters
2486
+ '''
2487
+
2488
+ migrate_to_chat_id: Optional[int] = Field(default=None)
2489
+ retry_after: Optional[int] = Field(default=None)
2490
+
2491
+ class InputMediaPhoto(BaseModel):
2492
+ '''
2493
+ Represents a photo to be sent.
2494
+
2495
+ Reference: https://core.telegram.org/bots/api#inputmediaphoto
2496
+ '''
2497
+
2498
+ type: Literal['photo'] = 'photo'
2499
+ media: str
2500
+ caption: Optional[str] = Field(default=None)
2501
+ parse_mode: Optional[str] = Field(default='HTML')
2502
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2503
+ show_caption_above_media: Optional[bool] = Field(default=None)
2504
+ has_spoiler: Optional[bool] = Field(default=None)
2505
+
2506
+ class InputMediaVideo(BaseModel):
2507
+ '''
2508
+ Represents a video to be sent.
2509
+
2510
+ Reference: https://core.telegram.org/bots/api#inputmediavideo
2511
+ '''
2512
+
2513
+ type: Literal['video'] = 'video'
2514
+ media: str
2515
+ thumbnail: Optional[str] = Field(default=None)
2516
+ cover: Optional[str] = Field(default=None)
2517
+ start_timestamp: Optional[int] = Field(default=None)
2518
+ caption: Optional[str] = Field(default=None)
2519
+ parse_mode: Optional[str] = Field(default='HTML')
2520
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2521
+ show_caption_above_media: Optional[bool] = Field(default=None)
2522
+ width: Optional[int] = Field(default=None)
2523
+ height: Optional[int] = Field(default=None)
2524
+ duration: Optional[int] = Field(default=None)
2525
+ supports_streaming: Optional[bool] = Field(default=None)
2526
+ has_spoiler: Optional[bool] = Field(default=None)
2527
+
2528
+ class InputMediaAnimation(BaseModel):
2529
+ '''
2530
+ Represents an animation file (GIF or H.264/MPEG-4 AVC
2531
+ video without sound) to be sent.
2532
+
2533
+ Reference: https://core.telegram.org/bots/api#inputmediaanimation
2534
+ '''
2535
+
2536
+ type: Literal['animation'] = 'animation'
2537
+ media: str
2538
+ thumbnail: Optional[str] = Field(default=None)
2539
+ caption: Optional[str] = Field(default=None)
2540
+ parse_mode: Optional[str] = Field(default='HTML')
2541
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2542
+ show_caption_above_media: Optional[bool] = Field(default=None)
2543
+ width: Optional[int] = Field(default=None)
2544
+ height: Optional[int] = Field(default=None)
2545
+ duration: Optional[int] = Field(default=None)
2546
+ has_spoiler: Optional[bool] = Field(default=None)
2547
+
2548
+ class InputMediaAudio(BaseModel):
2549
+ '''
2550
+ Represents an audio file to be treated as
2551
+ music to be sent.
2552
+
2553
+ Reference: https://core.telegram.org/bots/api#inputmediaaudio
2554
+ '''
2555
+
2556
+ type: Literal['audio'] = 'audio'
2557
+ media: str
2558
+ thumbnail: Optional[str] = Field(default=None)
2559
+ caption: Optional[str] = Field(default=None)
2560
+ parse_mode: Optional[str] = Field(default='HTML')
2561
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2562
+ duration: Optional[int] = Field(default=None)
2563
+ performer: Optional[str] = Field(default=None)
2564
+ title: Optional[str] = Field(default=None)
2565
+
2566
+ class InputMediaDocument(BaseModel):
2567
+ '''
2568
+ Represents a general file to be sent.
2569
+
2570
+ Reference: https://core.telegram.org/bots/api#inputmediadocument
2571
+ '''
2572
+
2573
+ type: Literal['document'] = 'document'
2574
+ media: str
2575
+ thumbnail: Optional[str] = Field(default=None)
2576
+ caption: Optional[str] = Field(default=None)
2577
+ parse_mode: Optional[str] = Field(default='HTML')
2578
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2579
+ disable_content_type_detection: Optional[bool] = Field(default=None)
2580
+
2581
+ class InputFile(BaseModel):
2582
+ '''
2583
+ CUSTOM CLASS TO UPLOAD LOCAL FILES WITH MULTIPART.
2584
+
2585
+ This object represents the contents of a file
2586
+ to be uploaded. Must be posted using multipart/form-data
2587
+ in the usual way that files are uploaded
2588
+ via the browser.
2589
+
2590
+ Reference: https://core.telegram.org/bots/api#inputfile
2591
+ '''
2592
+
2593
+ file_content: bytes # Raw file content as bytes.
2594
+ file_name: str # File name, including its extension.
2595
+ mime_type: Optional[str] = Field(default=None) # File MIME type.
2596
+
2597
+ class InputPaidMediaPhoto(BaseModel):
2598
+ '''
2599
+ The paid media to send is a photo.
2600
+
2601
+ Reference: https://core.telegram.org/bots/api#inputpaidmediaphoto
2602
+ '''
2603
+
2604
+ type: Literal['photo'] = 'photo'
2605
+ media: str
2606
+
2607
+ class InputPaidMediaVideo(BaseModel):
2608
+ '''
2609
+ The paid media to send is a video.
2610
+
2611
+ Reference: https://core.telegram.org/bots/api#inputpaidmediavideo
2612
+ '''
2613
+
2614
+ type: Literal['video'] = 'video'
2615
+ media: str
2616
+ thumbnail: Optional[str] = Field(default=None)
2617
+ cover: Optional[str] = Field(default=None)
2618
+ start_timestamp: Optional[int] = Field(default=None)
2619
+ width: Optional[int] = Field(default=None)
2620
+ height: Optional[int] = Field(default=None)
2621
+ duration: Optional[int] = Field(default=None)
2622
+ supports_streaming: Optional[bool] = Field(default=None)
2623
+
2624
+ class InputProfilePhotoStatic(BaseModel):
2625
+ '''
2626
+ A static profile photo in the .JPG format.
2627
+
2628
+ Reference: https://core.telegram.org/bots/api#inputprofilephotostatic
2629
+ '''
2630
+
2631
+ type: Literal['static'] = 'static'
2632
+ photo: str
2633
+
2634
+ class InputProfilePhotoAnimated(BaseModel):
2635
+ '''
2636
+ An animated profile photo in the MPEG4 format.
2637
+
2638
+ Reference: https://core.telegram.org/bots/api#inputprofilephotoanimated
2639
+ '''
2640
+
2641
+ type: Literal['animated'] = 'animated'
2642
+ animation: str
2643
+ main_frame_timestamp: Optional[float] = Field(default=None)
2644
+
2645
+ class InputStoryContentPhoto(BaseModel):
2646
+ '''
2647
+ Describes a photo to post as a story.
2648
+
2649
+ Reference: https://core.telegram.org/bots/api#inputstorycontentphoto
2650
+ '''
2651
+
2652
+ type: Literal['photo'] = 'photo'
2653
+ photo: str
2654
+
2655
+ class InputStoryContentVideo(BaseModel):
2656
+ '''
2657
+ Describes a video to post as a story.
2658
+
2659
+ Reference: https://core.telegram.org/bots/api#inputstorycontentvideo
2660
+ '''
2661
+
2662
+ type: Literal['video'] = 'video'
2663
+ video: str
2664
+ duration: Optional[float] = Field(default=None)
2665
+ cover_frame_timestamp: Optional[float] = Field(default=None)
2666
+ is_animation: Optional[bool] = Field(default=None)
2667
+
2668
+ class Sticker(BaseModel):
2669
+ '''
2670
+ This object represents a sticker.
2671
+
2672
+ Reference: https://core.telegram.org/bots/api#sticker
2673
+ '''
2674
+
2675
+ file_id: str
2676
+ file_unique_id: str
2677
+ type: str
2678
+ width: int
2679
+ height: int
2680
+ is_animated: bool
2681
+ is_video: bool
2682
+ thumbnail: Optional[PhotoSize] = Field(default=None)
2683
+ emoji: Optional[str] = Field(default=None)
2684
+ set_name: Optional[str] = Field(default=None)
2685
+ premium_animation: Optional[File] = Field(default=None)
2686
+ mask_position: Optional[MaskPosition] = Field(default=None)
2687
+ custom_emoji_id: Optional[str] = Field(default=None)
2688
+ needs_repainting: Optional[bool] = Field(default=None)
2689
+ file_size: Optional[int] = Field(default=None)
2690
+
2691
+ class StickerSet(BaseModel):
2692
+ '''
2693
+ This object represents a sticker set.
2694
+
2695
+ Reference: https://core.telegram.org/bots/api#stickerset
2696
+ '''
2697
+
2698
+ name: str
2699
+ title: str
2700
+ sticker_type: str
2701
+ stickers: List[Sticker]
2702
+ thumbnail: Optional[PhotoSize] = Field(default=None)
2703
+
2704
+ class MaskPosition(BaseModel):
2705
+ '''
2706
+ This object describes the position on faces where
2707
+ a mask should be placed by default.
2708
+
2709
+ Reference: https://core.telegram.org/bots/api#maskposition
2710
+ '''
2711
+
2712
+ point: str
2713
+ x_shift: float
2714
+ y_shift: float
2715
+ scale: float
2716
+
2717
+ class InputSticker(BaseModel):
2718
+ '''
2719
+ This object describes a sticker to be added
2720
+ to a sticker set.
2721
+
2722
+ Reference: https://core.telegram.org/bots/api#inputsticker
2723
+ '''
2724
+
2725
+ sticker: str
2726
+ format: str
2727
+ emoji_list: List[str]
2728
+ mask_position: Optional[MaskPosition] = Field(default=None)
2729
+ keywords: Optional[List[str]] = Field(default=None)
2730
+
2731
+ class InlineQuery(BaseModel):
2732
+ '''
2733
+ This object represents an incoming inline query. When
2734
+ the user sends an empty query, your bot
2735
+ could return some default or trending results.
2736
+
2737
+ Reference: https://core.telegram.org/bots/api#inlinequery
2738
+ '''
2739
+
2740
+ id: str
2741
+ from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
2742
+ query: str
2743
+ offset: str
2744
+ chat_type: Optional[str] = Field(default=None)
2745
+ location: Optional[Location] = Field(default=None)
2746
+
2747
+ class InlineQueryResultsButton(BaseModel):
2748
+ '''
2749
+ This object represents a button to be shown
2750
+ above inline query results. You must use exactly
2751
+ one of the optional fields.
2752
+
2753
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultsbutton
2754
+ '''
2755
+
2756
+ text: str
2757
+ web_app: Optional[WebAppInfo] = Field(default=None)
2758
+ start_parameter: Optional[str] = Field(default=None)
2759
+
2760
+ class InlineQueryResultArticle(BaseModel):
2761
+ '''
2762
+ Represents a link to an article or web
2763
+ page.
2764
+
2765
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultarticle
2766
+ '''
2767
+
2768
+ type: Literal['article'] = 'article'
2769
+ id: str
2770
+ title: str
2771
+ input_message_content: InputMessageContent
2772
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2773
+ url: Optional[str] = Field(default=None)
2774
+ description: Optional[str] = Field(default=None)
2775
+ thumbnail_url: Optional[str] = Field(default=None)
2776
+ thumbnail_width: Optional[int] = Field(default=None)
2777
+ thumbnail_height: Optional[int] = Field(default=None)
2778
+
2779
+ class InlineQueryResultPhoto(BaseModel):
2780
+ '''
2781
+ Represents a link to a photo. By default,
2782
+ this photo will be sent by the user
2783
+ with optional caption. Alternatively, you can use input_message_content
2784
+ to send a message with the specified content
2785
+ instead of the photo.
2786
+
2787
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultphoto
2788
+ '''
2789
+
2790
+ type: Literal['photo'] = 'photo'
2791
+ id: str
2792
+ photo_url: str
2793
+ thumbnail_url: str
2794
+ photo_width: Optional[int] = Field(default=None)
2795
+ photo_height: Optional[int] = Field(default=None)
2796
+ title: Optional[str] = Field(default=None)
2797
+ description: Optional[str] = Field(default=None)
2798
+ caption: Optional[str] = Field(default=None)
2799
+ parse_mode: Optional[str] = Field(default='HTML')
2800
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2801
+ show_caption_above_media: Optional[bool] = Field(default=None)
2802
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2803
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
2804
+
2805
+ class InlineQueryResultGif(BaseModel):
2806
+ '''
2807
+ Represents a link to an animated GIF file.
2808
+ By default, this animated GIF file will be
2809
+ sent by the user with optional caption. Alternatively,
2810
+ you can use input_message_content to send a message
2811
+ with the specified content instead of the animation.
2812
+
2813
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultgif
2814
+ '''
2815
+
2816
+ type: Literal['gif'] = 'gif'
2817
+ id: str
2818
+ gif_url: str
2819
+ thumbnail_url: str
2820
+ gif_width: Optional[int] = Field(default=None)
2821
+ gif_height: Optional[int] = Field(default=None)
2822
+ gif_duration: Optional[int] = Field(default=None)
2823
+ thumbnail_mime_type: Optional[str] = Field(default=None)
2824
+ title: Optional[str] = Field(default=None)
2825
+ caption: Optional[str] = Field(default=None)
2826
+ parse_mode: Optional[str] = Field(default='HTML')
2827
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2828
+ show_caption_above_media: Optional[bool] = Field(default=None)
2829
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2830
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
2831
+
2832
+ class InlineQueryResultMpeg4Gif(BaseModel):
2833
+ '''
2834
+ Represents a link to a video animation (H.264/MPEG-4
2835
+ AVC video without sound). By default, this animated
2836
+ MPEG-4 file will be sent by the user
2837
+ with optional caption. Alternatively, you can use input_message_content
2838
+ to send a message with the specified content
2839
+ instead of the animation.
2840
+
2841
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif
2842
+ '''
2843
+
2844
+ type: Literal['mpeg4_gif'] = 'mpeg4_gif'
2845
+ id: str
2846
+ mpeg4_url: str
2847
+ thumbnail_url: str
2848
+ mpeg4_width: Optional[int] = Field(default=None)
2849
+ mpeg4_height: Optional[int] = Field(default=None)
2850
+ mpeg4_duration: Optional[int] = Field(default=None)
2851
+ thumbnail_mime_type: Optional[str] = Field(default=None)
2852
+ title: Optional[str] = Field(default=None)
2853
+ caption: Optional[str] = Field(default=None)
2854
+ parse_mode: Optional[str] = Field(default='HTML')
2855
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2856
+ show_caption_above_media: Optional[bool] = Field(default=None)
2857
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2858
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
2859
+
2860
+ class InlineQueryResultVideo(BaseModel):
2861
+ '''
2862
+ Represents a link to a page containing an
2863
+ embedded video player or a video file. By
2864
+ default, this video file will be sent by
2865
+ the user with an optional caption. Alternatively, you
2866
+ can use input_message_content to send a message with
2867
+ the specified content instead of the video.
2868
+
2869
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultvideo
2870
+ '''
2871
+
2872
+ type: Literal['video'] = 'video'
2873
+ id: str
2874
+ video_url: str
2875
+ mime_type: str
2876
+ thumbnail_url: str
2877
+ title: str
2878
+ caption: Optional[str] = Field(default=None)
2879
+ parse_mode: Optional[str] = Field(default='HTML')
2880
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2881
+ show_caption_above_media: Optional[bool] = Field(default=None)
2882
+ video_width: Optional[int] = Field(default=None)
2883
+ video_height: Optional[int] = Field(default=None)
2884
+ video_duration: Optional[int] = Field(default=None)
2885
+ description: Optional[str] = Field(default=None)
2886
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2887
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
2888
+
2889
+ class InlineQueryResultAudio(BaseModel):
2890
+ '''
2891
+ Represents a link to an MP3 audio file.
2892
+ By default, this audio file will be sent
2893
+ by the user. Alternatively, you can use input_message_content
2894
+ to send a message with the specified content
2895
+ instead of the audio.
2896
+
2897
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultaudio
2898
+ '''
2899
+
2900
+ type: Literal['audio'] = 'audio'
2901
+ id: str
2902
+ audio_url: str
2903
+ title: str
2904
+ caption: Optional[str] = Field(default=None)
2905
+ parse_mode: Optional[str] = Field(default='HTML')
2906
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2907
+ performer: Optional[str] = Field(default=None)
2908
+ audio_duration: Optional[int] = Field(default=None)
2909
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2910
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
2911
+
2912
+ class InlineQueryResultVoice(BaseModel):
2913
+ '''
2914
+ Represents a link to a voice recording in
2915
+ an .OGG container encoded with OPUS. By default,
2916
+ this voice recording will be sent by the
2917
+ user. Alternatively, you can use input_message_content to send
2918
+ a message with the specified content instead of
2919
+ the the voice message.
2920
+
2921
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultvoice
2922
+ '''
2923
+
2924
+ type: Literal['voice'] = 'voice'
2925
+ id: str
2926
+ voice_url: str
2927
+ title: str
2928
+ caption: Optional[str] = Field(default=None)
2929
+ parse_mode: Optional[str] = Field(default='HTML')
2930
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2931
+ voice_duration: Optional[int] = Field(default=None)
2932
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2933
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
2934
+
2935
+ class InlineQueryResultDocument(BaseModel):
2936
+ '''
2937
+ Represents a link to a file. By default,
2938
+ this file will be sent by the user
2939
+ with an optional caption. Alternatively, you can use
2940
+ input_message_content to send a message with the specified
2941
+ content instead of the file. Currently, only .PDF
2942
+ and .ZIP files can be sent using this
2943
+ method.
2944
+
2945
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultdocument
2946
+ '''
2947
+
2948
+ type: Literal['document'] = 'document'
2949
+ id: str
2950
+ title: str
2951
+ document_url: str
2952
+ mime_type: str
2953
+ caption: Optional[str] = Field(default=None)
2954
+ parse_mode: Optional[str] = Field(default='HTML')
2955
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
2956
+ description: Optional[str] = Field(default=None)
2957
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2958
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
2959
+ thumbnail_url: Optional[str] = Field(default=None)
2960
+ thumbnail_width: Optional[int] = Field(default=None)
2961
+ thumbnail_height: Optional[int] = Field(default=None)
2962
+
2963
+ class InlineQueryResultLocation(BaseModel):
2964
+ '''
2965
+ Represents a location on a map. By default,
2966
+ the location will be sent by the user.
2967
+ Alternatively, you can use input_message_content to send a
2968
+ message with the specified content instead of the
2969
+ location.
2970
+
2971
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultlocation
2972
+ '''
2973
+
2974
+ type: Literal['location'] = 'location'
2975
+ id: str
2976
+ latitude: float
2977
+ longitude: float
2978
+ title: str
2979
+ horizontal_accuracy: Optional[float] = Field(default=None)
2980
+ live_period: Optional[int] = Field(default=None)
2981
+ heading: Optional[int] = Field(default=None)
2982
+ proximity_alert_radius: Optional[int] = Field(default=None)
2983
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
2984
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
2985
+ thumbnail_url: Optional[str] = Field(default=None)
2986
+ thumbnail_width: Optional[int] = Field(default=None)
2987
+ thumbnail_height: Optional[int] = Field(default=None)
2988
+
2989
+ class InlineQueryResultVenue(BaseModel):
2990
+ '''
2991
+ Represents a venue. By default, the venue will
2992
+ be sent by the user. Alternatively, you can
2993
+ use input_message_content to send a message with the
2994
+ specified content instead of the venue.
2995
+
2996
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultvenue
2997
+ '''
2998
+
2999
+ type: Literal['venue'] = 'venue'
3000
+ id: str
3001
+ latitude: float
3002
+ longitude: float
3003
+ title: str
3004
+ address: str
3005
+ foursquare_id: Optional[str] = Field(default=None)
3006
+ foursquare_type: Optional[str] = Field(default=None)
3007
+ google_place_id: Optional[str] = Field(default=None)
3008
+ google_place_type: Optional[str] = Field(default=None)
3009
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3010
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3011
+ thumbnail_url: Optional[str] = Field(default=None)
3012
+ thumbnail_width: Optional[int] = Field(default=None)
3013
+ thumbnail_height: Optional[int] = Field(default=None)
3014
+
3015
+ class InlineQueryResultContact(BaseModel):
3016
+ '''
3017
+ Represents a contact with a phone number. By
3018
+ default, this contact will be sent by the
3019
+ user. Alternatively, you can use input_message_content to send
3020
+ a message with the specified content instead of
3021
+ the contact.
3022
+
3023
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcontact
3024
+ '''
3025
+
3026
+ type: Literal['contact'] = 'contact'
3027
+ id: str
3028
+ phone_number: str
3029
+ first_name: str
3030
+ last_name: Optional[str] = Field(default=None)
3031
+ vcard: Optional[str] = Field(default=None)
3032
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3033
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3034
+ thumbnail_url: Optional[str] = Field(default=None)
3035
+ thumbnail_width: Optional[int] = Field(default=None)
3036
+ thumbnail_height: Optional[int] = Field(default=None)
3037
+
3038
+ class InlineQueryResultGame(BaseModel):
3039
+ '''
3040
+ Represents a Game.
3041
+
3042
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultgame
3043
+ '''
3044
+
3045
+ type: Literal['game'] = 'game'
3046
+ id: str
3047
+ game_short_name: str
3048
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3049
+
3050
+ class InlineQueryResultCachedPhoto(BaseModel):
3051
+ '''
3052
+ Represents a link to a photo stored on
3053
+ the Telegram servers. By default, this photo will
3054
+ be sent by the user with an optional
3055
+ caption. Alternatively, you can use input_message_content to send
3056
+ a message with the specified content instead of
3057
+ the photo.
3058
+
3059
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcachedphoto
3060
+ '''
3061
+
3062
+ type: Literal['photo'] = 'photo'
3063
+ id: str
3064
+ photo_file_id: str
3065
+ title: Optional[str] = Field(default=None)
3066
+ description: Optional[str] = Field(default=None)
3067
+ caption: Optional[str] = Field(default=None)
3068
+ parse_mode: Optional[str] = Field(default='HTML')
3069
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
3070
+ show_caption_above_media: Optional[bool] = Field(default=None)
3071
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3072
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3073
+
3074
+ class InlineQueryResultCachedGif(BaseModel):
3075
+ '''
3076
+ Represents a link to an animated GIF file
3077
+ stored on the Telegram servers. By default, this
3078
+ animated GIF file will be sent by the
3079
+ user with an optional caption. Alternatively, you can
3080
+ use input_message_content to send a message with specified
3081
+ content instead of the animation.
3082
+
3083
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcachedgif
3084
+ '''
3085
+
3086
+ type: Literal['gif'] = 'gif'
3087
+ id: str
3088
+ gif_file_id: str
3089
+ title: Optional[str] = Field(default=None)
3090
+ caption: Optional[str] = Field(default=None)
3091
+ parse_mode: Optional[str] = Field(default='HTML')
3092
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
3093
+ show_caption_above_media: Optional[bool] = Field(default=None)
3094
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3095
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3096
+
3097
+ class InlineQueryResultCachedMpeg4Gif(BaseModel):
3098
+ '''
3099
+ Represents a link to a video animation (H.264/MPEG-4
3100
+ AVC video without sound) stored on the Telegram
3101
+ servers. By default, this animated MPEG-4 file will
3102
+ be sent by the user with an optional
3103
+ caption. Alternatively, you can use input_message_content to send
3104
+ a message with the specified content instead of
3105
+ the animation.
3106
+
3107
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif
3108
+ '''
3109
+
3110
+ type: Literal['mpeg4_gif'] = 'mpeg4_gif'
3111
+ id: str
3112
+ mpeg4_file_id: str
3113
+ title: Optional[str] = Field(default=None)
3114
+ caption: Optional[str] = Field(default=None)
3115
+ parse_mode: Optional[str] = Field(default='HTML')
3116
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
3117
+ show_caption_above_media: Optional[bool] = Field(default=None)
3118
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3119
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3120
+
3121
+ class InlineQueryResultCachedSticker(BaseModel):
3122
+ '''
3123
+ Represents a link to a sticker stored on
3124
+ the Telegram servers. By default, this sticker will
3125
+ be sent by the user. Alternatively, you can
3126
+ use input_message_content to send a message with the
3127
+ specified content instead of the sticker.
3128
+
3129
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcachedsticker
3130
+ '''
3131
+
3132
+ type: Literal['sticker'] = 'sticker'
3133
+ id: str
3134
+ sticker_file_id: str
3135
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3136
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3137
+
3138
+ class InlineQueryResultCachedDocument(BaseModel):
3139
+ '''
3140
+ Represents a link to a file stored on
3141
+ the Telegram servers. By default, this file will
3142
+ be sent by the user with an optional
3143
+ caption. Alternatively, you can use input_message_content to send
3144
+ a message with the specified content instead of
3145
+ the file.
3146
+
3147
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcacheddocument
3148
+ '''
3149
+
3150
+ type: Literal['document'] = 'document'
3151
+ id: str
3152
+ title: str
3153
+ document_file_id: str
3154
+ description: Optional[str] = Field(default=None)
3155
+ caption: Optional[str] = Field(default=None)
3156
+ parse_mode: Optional[str] = Field(default='HTML')
3157
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
3158
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3159
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3160
+
3161
+ class InlineQueryResultCachedVideo(BaseModel):
3162
+ '''
3163
+ Represents a link to a video file stored
3164
+ on the Telegram servers. By default, this video
3165
+ file will be sent by the user with
3166
+ an optional caption. Alternatively, you can use input_message_content
3167
+ to send a message with the specified content
3168
+ instead of the video.
3169
+
3170
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcachedvideo
3171
+ '''
3172
+
3173
+ type: Literal['video'] = 'video'
3174
+ id: str
3175
+ video_file_id: str
3176
+ title: str
3177
+ description: Optional[str] = Field(default=None)
3178
+ caption: Optional[str] = Field(default=None)
3179
+ parse_mode: Optional[str] = Field(default='HTML')
3180
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
3181
+ show_caption_above_media: Optional[bool] = Field(default=None)
3182
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3183
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3184
+
3185
+ class InlineQueryResultCachedVoice(BaseModel):
3186
+ '''
3187
+ Represents a link to a voice message stored
3188
+ on the Telegram servers. By default, this voice
3189
+ message will be sent by the user. Alternatively,
3190
+ you can use input_message_content to send a message
3191
+ with the specified content instead of the voice
3192
+ message.
3193
+
3194
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcachedvoice
3195
+ '''
3196
+
3197
+ type: Literal['voice'] = 'voice'
3198
+ id: str
3199
+ voice_file_id: str
3200
+ title: str
3201
+ caption: Optional[str] = Field(default=None)
3202
+ parse_mode: Optional[str] = Field(default='HTML')
3203
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
3204
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3205
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3206
+
3207
+ class InlineQueryResultCachedAudio(BaseModel):
3208
+ '''
3209
+ Represents a link to an MP3 audio file
3210
+ stored on the Telegram servers. By default, this
3211
+ audio file will be sent by the user.
3212
+ Alternatively, you can use input_message_content to send a
3213
+ message with the specified content instead of the
3214
+ audio.
3215
+
3216
+ Reference: https://core.telegram.org/bots/api#inlinequeryresultcachedaudio
3217
+ '''
3218
+
3219
+ type: Literal['audio'] = 'audio'
3220
+ id: str
3221
+ audio_file_id: str
3222
+ caption: Optional[str] = Field(default=None)
3223
+ parse_mode: Optional[str] = Field(default='HTML')
3224
+ caption_entities: Optional[List[MessageEntity]] = Field(default=None)
3225
+ reply_markup: Optional[InlineKeyboardMarkup] = Field(default=None)
3226
+ input_message_content: Optional[InputMessageContent] = Field(default=None)
3227
+
3228
+ class InputTextMessageContent(BaseModel):
3229
+ '''
3230
+ Represents the content of a text message to
3231
+ be sent as the result of an inline
3232
+ query.
3233
+
3234
+ Reference: https://core.telegram.org/bots/api#inputtextmessagecontent
3235
+ '''
3236
+
3237
+ message_text: str
3238
+ parse_mode: Optional[str] = Field(default='HTML')
3239
+ entities: Optional[List[MessageEntity]] = Field(default=None)
3240
+ link_preview_options: Optional[LinkPreviewOptions] = Field(default=None)
3241
+
3242
+ class InputLocationMessageContent(BaseModel):
3243
+ '''
3244
+ Represents the content of a location message to
3245
+ be sent as the result of an inline
3246
+ query.
3247
+
3248
+ Reference: https://core.telegram.org/bots/api#inputlocationmessagecontent
3249
+ '''
3250
+
3251
+ latitude: float
3252
+ longitude: float
3253
+ horizontal_accuracy: Optional[float] = Field(default=None)
3254
+ live_period: Optional[int] = Field(default=None)
3255
+ heading: Optional[int] = Field(default=None)
3256
+ proximity_alert_radius: Optional[int] = Field(default=None)
3257
+
3258
+ class InputVenueMessageContent(BaseModel):
3259
+ '''
3260
+ Represents the content of a venue message to
3261
+ be sent as the result of an inline
3262
+ query.
3263
+
3264
+ Reference: https://core.telegram.org/bots/api#inputvenuemessagecontent
3265
+ '''
3266
+
3267
+ latitude: float
3268
+ longitude: float
3269
+ title: str
3270
+ address: str
3271
+ foursquare_id: Optional[str] = Field(default=None)
3272
+ foursquare_type: Optional[str] = Field(default=None)
3273
+ google_place_id: Optional[str] = Field(default=None)
3274
+ google_place_type: Optional[str] = Field(default=None)
3275
+
3276
+ class InputContactMessageContent(BaseModel):
3277
+ '''
3278
+ Represents the content of a contact message to
3279
+ be sent as the result of an inline
3280
+ query.
3281
+
3282
+ Reference: https://core.telegram.org/bots/api#inputcontactmessagecontent
3283
+ '''
3284
+
3285
+ phone_number: str
3286
+ first_name: str
3287
+ last_name: Optional[str] = Field(default=None)
3288
+ vcard: Optional[str] = Field(default=None)
3289
+
3290
+ class InputInvoiceMessageContent(BaseModel):
3291
+ '''
3292
+ Represents the content of an invoice message to
3293
+ be sent as the result of an inline
3294
+ query.
3295
+
3296
+ Reference: https://core.telegram.org/bots/api#inputinvoicemessagecontent
3297
+ '''
3298
+
3299
+ title: str
3300
+ description: str
3301
+ payload: str
3302
+ currency: str
3303
+ prices: List[LabeledPrice]
3304
+ provider_token: Optional[str] = Field(default=None)
3305
+ max_tip_amount: Optional[int] = Field(default=None)
3306
+ suggested_tip_amounts: Optional[List[int]] = Field(default=None)
3307
+ provider_data: Optional[str] = Field(default=None)
3308
+ photo_url: Optional[str] = Field(default=None)
3309
+ photo_size: Optional[int] = Field(default=None)
3310
+ photo_width: Optional[int] = Field(default=None)
3311
+ photo_height: Optional[int] = Field(default=None)
3312
+ need_name: Optional[bool] = Field(default=None)
3313
+ need_phone_number: Optional[bool] = Field(default=None)
3314
+ need_email: Optional[bool] = Field(default=None)
3315
+ need_shipping_address: Optional[bool] = Field(default=None)
3316
+ send_phone_number_to_provider: Optional[bool] = Field(default=None)
3317
+ send_email_to_provider: Optional[bool] = Field(default=None)
3318
+ is_flexible: Optional[bool] = Field(default=None)
3319
+
3320
+ class ChosenInlineResult(BaseModel):
3321
+ '''
3322
+ Represents a result of an inline query that
3323
+ was chosen by the user and sent to
3324
+ their chat partner.
3325
+
3326
+ Reference: https://core.telegram.org/bots/api#choseninlineresult
3327
+ '''
3328
+
3329
+ result_id: str
3330
+ from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
3331
+ query: str
3332
+ location: Optional[Location] = Field(default=None)
3333
+ inline_message_id: Optional[str] = Field(default=None)
3334
+
3335
+ class SentWebAppMessage(BaseModel):
3336
+ '''
3337
+ Describes an inline message sent by a Web
3338
+ App on behalf of a user.
3339
+
3340
+ Reference: https://core.telegram.org/bots/api#sentwebappmessage
3341
+ '''
3342
+
3343
+ inline_message_id: Optional[str] = Field(default=None)
3344
+
3345
+ class PreparedInlineMessage(BaseModel):
3346
+ '''
3347
+ Describes an inline message to be sent by
3348
+ a user of a Mini App.
3349
+
3350
+ Reference: https://core.telegram.org/bots/api#preparedinlinemessage
3351
+ '''
3352
+
3353
+ id: str
3354
+ expiration_date: int
3355
+
3356
+ class LabeledPrice(BaseModel):
3357
+ '''
3358
+ This object represents a portion of the price
3359
+ for goods or services.
3360
+
3361
+ Reference: https://core.telegram.org/bots/api#labeledprice
3362
+ '''
3363
+
3364
+ label: str
3365
+ amount: int
3366
+
3367
+ class Invoice(BaseModel):
3368
+ '''
3369
+ This object contains basic information about an invoice.
3370
+
3371
+ Reference: https://core.telegram.org/bots/api#invoice
3372
+ '''
3373
+
3374
+ title: str
3375
+ description: str
3376
+ start_parameter: str
3377
+ currency: str
3378
+ total_amount: int
3379
+
3380
+ class ShippingAddress(BaseModel):
3381
+ '''
3382
+ This object represents a shipping address.
3383
+
3384
+ Reference: https://core.telegram.org/bots/api#shippingaddress
3385
+ '''
3386
+
3387
+ country_code: str
3388
+ state: str
3389
+ city: str
3390
+ street_line1: str
3391
+ street_line2: str
3392
+ post_code: str
3393
+
3394
+ class OrderInfo(BaseModel):
3395
+ '''
3396
+ This object represents information about an order.
3397
+
3398
+ Reference: https://core.telegram.org/bots/api#orderinfo
3399
+ '''
3400
+
3401
+ name: Optional[str] = Field(default=None)
3402
+ phone_number: Optional[str] = Field(default=None)
3403
+ email: Optional[str] = Field(default=None)
3404
+ shipping_address: Optional[ShippingAddress] = Field(default=None)
3405
+
3406
+ class ShippingOption(BaseModel):
3407
+ '''
3408
+ This object represents one shipping option.
3409
+
3410
+ Reference: https://core.telegram.org/bots/api#shippingoption
3411
+ '''
3412
+
3413
+ id: str
3414
+ title: str
3415
+ prices: List[LabeledPrice]
3416
+
3417
+ class SuccessfulPayment(BaseModel):
3418
+ '''
3419
+ This object contains basic information about a successful
3420
+ payment. Note that if the buyer initiates a
3421
+ chargeback with the relevant payment provider following this
3422
+ transaction, the funds may be debited from your
3423
+ balance. This is outside of Telegram's control.
3424
+
3425
+ Reference: https://core.telegram.org/bots/api#successfulpayment
3426
+ '''
3427
+
3428
+ currency: str
3429
+ total_amount: int
3430
+ invoice_payload: str
3431
+ telegram_payment_charge_id: str
3432
+ provider_payment_charge_id: str
3433
+ subscription_expiration_date: Optional[int] = Field(default=None)
3434
+ is_recurring: Optional[bool] = Field(default=None)
3435
+ is_first_recurring: Optional[bool] = Field(default=None)
3436
+ shipping_option_id: Optional[str] = Field(default=None)
3437
+ order_info: Optional[OrderInfo] = Field(default=None)
3438
+
3439
+ class RefundedPayment(BaseModel):
3440
+ '''
3441
+ This object contains basic information about a refunded
3442
+ payment.
3443
+
3444
+ Reference: https://core.telegram.org/bots/api#refundedpayment
3445
+ '''
3446
+
3447
+ currency: Literal['XTR'] = 'XTR'
3448
+ total_amount: int
3449
+ invoice_payload: str
3450
+ telegram_payment_charge_id: str
3451
+ provider_payment_charge_id: Optional[str] = Field(default=None)
3452
+
3453
+ class ShippingQuery(BaseModel):
3454
+ '''
3455
+ This object contains information about an incoming shipping
3456
+ query.
3457
+
3458
+ Reference: https://core.telegram.org/bots/api#shippingquery
3459
+ '''
3460
+
3461
+ id: str
3462
+ from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
3463
+ invoice_payload: str
3464
+ shipping_address: ShippingAddress
3465
+
3466
+ class PreCheckoutQuery(BaseModel):
3467
+ '''
3468
+ This object contains information about an incoming pre-checkout
3469
+ query.
3470
+
3471
+ Reference: https://core.telegram.org/bots/api#precheckoutquery
3472
+ '''
3473
+
3474
+ id: str
3475
+ from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
3476
+ currency: str
3477
+ total_amount: int
3478
+ invoice_payload: str
3479
+ shipping_option_id: Optional[str] = Field(default=None)
3480
+ order_info: Optional[OrderInfo] = Field(default=None)
3481
+
3482
+ class PaidMediaPurchased(BaseModel):
3483
+ '''
3484
+ This object contains information about a paid media
3485
+ purchase.
3486
+
3487
+ Reference: https://core.telegram.org/bots/api#paidmediapurchased
3488
+ '''
3489
+
3490
+ from_user: User = Field(alias='from') # FIX `from` is a python reserved keyword
3491
+ paid_media_payload: str
3492
+
3493
+ class RevenueWithdrawalStatePending(BaseModel):
3494
+ '''
3495
+ The withdrawal is in progress.
3496
+
3497
+ Reference: https://core.telegram.org/bots/api#revenuewithdrawalstatepending
3498
+ '''
3499
+
3500
+ type: Literal['pending'] = 'pending'
3501
+
3502
+ class RevenueWithdrawalStateSucceeded(BaseModel):
3503
+ '''
3504
+ The withdrawal succeeded.
3505
+
3506
+ Reference: https://core.telegram.org/bots/api#revenuewithdrawalstatesucceeded
3507
+ '''
3508
+
3509
+ type: Literal['succeeded'] = 'succeeded'
3510
+ date: int
3511
+ url: str
3512
+
3513
+ class RevenueWithdrawalStateFailed(BaseModel):
3514
+ '''
3515
+ The withdrawal failed and the transaction was refunded.
3516
+
3517
+ Reference: https://core.telegram.org/bots/api#revenuewithdrawalstatefailed
3518
+ '''
3519
+
3520
+ type: Literal['failed'] = 'failed'
3521
+
3522
+ class AffiliateInfo(BaseModel):
3523
+ '''
3524
+ Contains information about the affiliate that received a
3525
+ commission via this transaction.
3526
+
3527
+ Reference: https://core.telegram.org/bots/api#affiliateinfo
3528
+ '''
3529
+
3530
+ commission_per_mille: int
3531
+ amount: int
3532
+ affiliate_user: Optional[User] = Field(default=None)
3533
+ affiliate_chat: Optional[Chat] = Field(default=None)
3534
+ nanostar_amount: Optional[int] = Field(default=None)
3535
+
3536
+ class TransactionPartnerUser(BaseModel):
3537
+ '''
3538
+ Describes a transaction with a user.
3539
+
3540
+ Reference: https://core.telegram.org/bots/api#transactionpartneruser
3541
+ '''
3542
+
3543
+ type: Literal['user'] = 'user'
3544
+ transaction_type: str
3545
+ user: User
3546
+ affiliate: Optional[AffiliateInfo] = Field(default=None)
3547
+ invoice_payload: Optional[str] = Field(default=None)
3548
+ subscription_period: Optional[int] = Field(default=None)
3549
+ paid_media: Optional[List[PaidMedia]] = Field(default=None)
3550
+ paid_media_payload: Optional[str] = Field(default=None)
3551
+ gift: Optional[Gift] = Field(default=None)
3552
+ premium_subscription_duration: Optional[int] = Field(default=None)
3553
+
3554
+ class TransactionPartnerChat(BaseModel):
3555
+ '''
3556
+ Describes a transaction with a chat.
3557
+
3558
+ Reference: https://core.telegram.org/bots/api#transactionpartnerchat
3559
+ '''
3560
+
3561
+ type: Literal['chat'] = 'chat'
3562
+ chat: Chat
3563
+ gift: Optional[Gift] = Field(default=None)
3564
+
3565
+ class TransactionPartnerAffiliateProgram(BaseModel):
3566
+ '''
3567
+ Describes the affiliate program that issued the affiliate
3568
+ commission received via this transaction.
3569
+
3570
+ Reference: https://core.telegram.org/bots/api#transactionpartneraffiliateprogram
3571
+ '''
3572
+
3573
+ type: Literal['affiliate_program'] = 'affiliate_program'
3574
+ commission_per_mille: int
3575
+ sponsor_user: Optional[User] = Field(default=None)
3576
+
3577
+ class TransactionPartnerFragment(BaseModel):
3578
+ '''
3579
+ Describes a withdrawal transaction with Fragment.
3580
+
3581
+ Reference: https://core.telegram.org/bots/api#transactionpartnerfragment
3582
+ '''
3583
+
3584
+ type: Literal['fragment'] = 'fragment'
3585
+ withdrawal_state: Optional[RevenueWithdrawalState] = Field(default=None)
3586
+
3587
+ class TransactionPartnerTelegramAds(BaseModel):
3588
+ '''
3589
+ Describes a withdrawal transaction to the Telegram Ads
3590
+ platform.
3591
+
3592
+ Reference: https://core.telegram.org/bots/api#transactionpartnertelegramads
3593
+ '''
3594
+
3595
+ type: Literal['telegram_ads'] = 'telegram_ads'
3596
+
3597
+ class TransactionPartnerTelegramApi(BaseModel):
3598
+ '''
3599
+ Describes a transaction with payment for paid broadcasting.
3600
+
3601
+ Reference: https://core.telegram.org/bots/api#transactionpartnertelegramapi
3602
+ '''
3603
+
3604
+ type: Literal['telegram_api'] = 'telegram_api'
3605
+ request_count: int
3606
+
3607
+ class TransactionPartnerOther(BaseModel):
3608
+ '''
3609
+ Describes a transaction with an unknown source or
3610
+ recipient.
3611
+
3612
+ Reference: https://core.telegram.org/bots/api#transactionpartnerother
3613
+ '''
3614
+
3615
+ type: Literal['other'] = 'other'
3616
+
3617
+ class StarTransaction(BaseModel):
3618
+ '''
3619
+ Describes a Telegram Star transaction. Note that if
3620
+ the buyer initiates a chargeback with the payment
3621
+ provider from whom they acquired Stars (e.g., Apple,
3622
+ Google) following this transaction, the refunded Stars will
3623
+ be deducted from the bot's balance. This is
3624
+ outside of Telegram's control.
3625
+
3626
+ Reference: https://core.telegram.org/bots/api#startransaction
3627
+ '''
3628
+
3629
+ id: str
3630
+ amount: int
3631
+ date: int
3632
+ nanostar_amount: Optional[int] = Field(default=None)
3633
+ source: Optional[TransactionPartner] = Field(default=None)
3634
+ receiver: Optional[TransactionPartner] = Field(default=None)
3635
+
3636
+ class StarTransactions(BaseModel):
3637
+ '''
3638
+ Contains a list of Telegram Star transactions.
3639
+
3640
+ Reference: https://core.telegram.org/bots/api#startransactions
3641
+ '''
3642
+
3643
+ transactions: List[StarTransaction]
3644
+
3645
+ class PassportData(BaseModel):
3646
+ '''
3647
+ Describes Telegram Passport data shared with the bot
3648
+ by the user.
3649
+
3650
+ Reference: https://core.telegram.org/bots/api#passportdata
3651
+ '''
3652
+
3653
+ data: List[EncryptedPassportElement]
3654
+ credentials: EncryptedCredentials
3655
+
3656
+ class PassportFile(BaseModel):
3657
+ '''
3658
+ This object represents a file uploaded to Telegram
3659
+ Passport. Currently all Telegram Passport files are in
3660
+ JPEG format when decrypted and don't exceed 10MB.
3661
+
3662
+ Reference: https://core.telegram.org/bots/api#passportfile
3663
+ '''
3664
+
3665
+ file_id: str
3666
+ file_unique_id: str
3667
+ file_size: int
3668
+ file_date: int
3669
+
3670
+ class EncryptedPassportElement(BaseModel):
3671
+ '''
3672
+ Describes documents or other Telegram Passport elements shared
3673
+ with the bot by the user.
3674
+
3675
+ Reference: https://core.telegram.org/bots/api#encryptedpassportelement
3676
+ '''
3677
+
3678
+ type: str
3679
+ hash: str
3680
+ data: Optional[str] = Field(default=None)
3681
+ phone_number: Optional[str] = Field(default=None)
3682
+ email: Optional[str] = Field(default=None)
3683
+ files: Optional[List[PassportFile]] = Field(default=None)
3684
+ front_side: Optional[PassportFile] = Field(default=None)
3685
+ reverse_side: Optional[PassportFile] = Field(default=None)
3686
+ selfie: Optional[PassportFile] = Field(default=None)
3687
+ translation: Optional[List[PassportFile]] = Field(default=None)
3688
+
3689
+ class EncryptedCredentials(BaseModel):
3690
+ '''
3691
+ Describes data required for decrypting and authenticating EncryptedPassportElement.
3692
+ See the Telegram Passport Documentation for a complete
3693
+ description of the data decryption and authentication processes.
3694
+
3695
+ Reference: https://core.telegram.org/bots/api#encryptedcredentials
3696
+ '''
3697
+
3698
+ data: str
3699
+ hash: str
3700
+ secret: str
3701
+
3702
+ class PassportElementErrorDataField(BaseModel):
3703
+ '''
3704
+ Represents an issue in one of the data
3705
+ fields that was provided by the user. The
3706
+ error is considered resolved when the field's value
3707
+ changes.
3708
+
3709
+ Reference: https://core.telegram.org/bots/api#passportelementerrordatafield
3710
+ '''
3711
+
3712
+ source: Literal['data'] = 'data'
3713
+ type: str
3714
+ field_name: str
3715
+ data_hash: str
3716
+ message: str
3717
+
3718
+ class PassportElementErrorFrontSide(BaseModel):
3719
+ '''
3720
+ Represents an issue with the front side of
3721
+ a document. The error is considered resolved when
3722
+ the file with the front side of the
3723
+ document changes.
3724
+
3725
+ Reference: https://core.telegram.org/bots/api#passportelementerrorfrontside
3726
+ '''
3727
+
3728
+ source: Literal['front_side'] = 'front_side'
3729
+ type: str
3730
+ file_hash: str
3731
+ message: str
3732
+
3733
+ class PassportElementErrorReverseSide(BaseModel):
3734
+ '''
3735
+ Represents an issue with the reverse side of
3736
+ a document. The error is considered resolved when
3737
+ the file with reverse side of the document
3738
+ changes.
3739
+
3740
+ Reference: https://core.telegram.org/bots/api#passportelementerrorreverseside
3741
+ '''
3742
+
3743
+ source: Literal['reverse_side'] = 'reverse_side'
3744
+ type: str
3745
+ file_hash: str
3746
+ message: str
3747
+
3748
+ class PassportElementErrorSelfie(BaseModel):
3749
+ '''
3750
+ Represents an issue with the selfie with a
3751
+ document. The error is considered resolved when the
3752
+ file with the selfie changes.
3753
+
3754
+ Reference: https://core.telegram.org/bots/api#passportelementerrorselfie
3755
+ '''
3756
+
3757
+ source: Literal['selfie'] = 'selfie'
3758
+ type: str
3759
+ file_hash: str
3760
+ message: str
3761
+
3762
+ class PassportElementErrorFile(BaseModel):
3763
+ '''
3764
+ Represents an issue with a document scan. The
3765
+ error is considered resolved when the file with
3766
+ the document scan changes.
3767
+
3768
+ Reference: https://core.telegram.org/bots/api#passportelementerrorfile
3769
+ '''
3770
+
3771
+ source: Literal['file'] = 'file'
3772
+ type: str
3773
+ file_hash: str
3774
+ message: str
3775
+
3776
+ class PassportElementErrorFiles(BaseModel):
3777
+ '''
3778
+ Represents an issue with a list of scans.
3779
+ The error is considered resolved when the list
3780
+ of files containing the scans changes.
3781
+
3782
+ Reference: https://core.telegram.org/bots/api#passportelementerrorfiles
3783
+ '''
3784
+
3785
+ source: Literal['files'] = 'files'
3786
+ type: str
3787
+ file_hashes: List[str]
3788
+ message: str
3789
+
3790
+ class PassportElementErrorTranslationFile(BaseModel):
3791
+ '''
3792
+ Represents an issue with one of the files
3793
+ that constitute the translation of a document. The
3794
+ error is considered resolved when the file changes.
3795
+
3796
+ Reference: https://core.telegram.org/bots/api#passportelementerrortranslationfile
3797
+ '''
3798
+
3799
+ source: Literal['translation_file'] = 'translation_file'
3800
+ type: str
3801
+ file_hash: str
3802
+ message: str
3803
+
3804
+ class PassportElementErrorTranslationFiles(BaseModel):
3805
+ '''
3806
+ Represents an issue with the translated version of
3807
+ a document. The error is considered resolved when
3808
+ a file with the document translation change.
3809
+
3810
+ Reference: https://core.telegram.org/bots/api#passportelementerrortranslationfiles
3811
+ '''
3812
+
3813
+ source: Literal['translation_files'] = 'translation_files'
3814
+ type: str
3815
+ file_hashes: List[str]
3816
+ message: str
3817
+
3818
+ class PassportElementErrorUnspecified(BaseModel):
3819
+ '''
3820
+ Represents an issue in an unspecified place. The
3821
+ error is considered resolved when new data is
3822
+ added.
3823
+
3824
+ Reference: https://core.telegram.org/bots/api#passportelementerrorunspecified
3825
+ '''
3826
+
3827
+ source: Literal['unspecified'] = 'unspecified'
3828
+ type: str
3829
+ element_hash: str
3830
+ message: str
3831
+
3832
+ class Game(BaseModel):
3833
+ '''
3834
+ This object represents a game. Use BotFather to
3835
+ create and edit games, their short names will
3836
+ act as unique identifiers.
3837
+
3838
+ Reference: https://core.telegram.org/bots/api#game
3839
+ '''
3840
+
3841
+ title: str
3842
+ description: str
3843
+ photo: List[PhotoSize]
3844
+ text: Optional[str] = Field(default=None)
3845
+ text_entities: Optional[List[MessageEntity]] = Field(default=None)
3846
+ animation: Optional[Animation] = Field(default=None)
3847
+
3848
+ class CallbackGame(BaseModel):
3849
+ '''
3850
+ A placeholder, currently holds no information. Use BotFather
3851
+ to set up your game.
3852
+
3853
+ Reference: https://core.telegram.org/bots/api#callbackgame
3854
+ '''
3855
+
3856
+ pass
3857
+
3858
+
3859
+ class GameHighScore(BaseModel):
3860
+ '''
3861
+ This object represents one row of the high
3862
+ scores table for a game.
3863
+
3864
+ Reference: https://core.telegram.org/bots/api#gamehighscore
3865
+ '''
3866
+
3867
+ position: int
3868
+ user: User
3869
+ score: int
3870
+
3871
+ MaybeInaccessibleMessage = Union[
3872
+ Message,
3873
+ InaccessibleMessage,
3874
+ ]
3875
+ MaybeInaccessibleMessageAdapter = TypeAdapter[MaybeInaccessibleMessage](MaybeInaccessibleMessage)
3876
+
3877
+ MessageOrigin = Union[
3878
+ MessageOriginUser,
3879
+ MessageOriginHiddenUser,
3880
+ MessageOriginChat,
3881
+ MessageOriginChannel,
3882
+ ]
3883
+ MessageOriginAdapter = TypeAdapter[MessageOrigin](MessageOrigin)
3884
+
3885
+ PaidMedia = Union[
3886
+ PaidMediaPreview,
3887
+ PaidMediaPhoto,
3888
+ PaidMediaVideo,
3889
+ ]
3890
+ PaidMediaAdapter = TypeAdapter[PaidMedia](PaidMedia)
3891
+
3892
+ BackgroundFill = Union[
3893
+ BackgroundFillSolid,
3894
+ BackgroundFillGradient,
3895
+ BackgroundFillFreeformGradient,
3896
+ ]
3897
+ BackgroundFillAdapter = TypeAdapter[BackgroundFill](BackgroundFill)
3898
+
3899
+ BackgroundType = Union[
3900
+ BackgroundTypeFill,
3901
+ BackgroundTypeWallpaper,
3902
+ BackgroundTypePattern,
3903
+ BackgroundTypeChatTheme,
3904
+ ]
3905
+ BackgroundTypeAdapter = TypeAdapter[BackgroundType](BackgroundType)
3906
+
3907
+ ChatMember = Union[
3908
+ ChatMemberOwner,
3909
+ ChatMemberAdministrator,
3910
+ ChatMemberMember,
3911
+ ChatMemberRestricted,
3912
+ ChatMemberLeft,
3913
+ ChatMemberBanned,
3914
+ ]
3915
+ ChatMemberAdapter = TypeAdapter[ChatMember](ChatMember)
3916
+
3917
+ StoryAreaType = Union[
3918
+ StoryAreaTypeLocation,
3919
+ StoryAreaTypeSuggestedReaction,
3920
+ StoryAreaTypeLink,
3921
+ StoryAreaTypeWeather,
3922
+ StoryAreaTypeUniqueGift,
3923
+ ]
3924
+ StoryAreaTypeAdapter = TypeAdapter[StoryAreaType](StoryAreaType)
3925
+
3926
+ ReactionType = Union[
3927
+ ReactionTypeEmoji,
3928
+ ReactionTypeCustomEmoji,
3929
+ ReactionTypePaid,
3930
+ ]
3931
+ ReactionTypeAdapter = TypeAdapter[ReactionType](ReactionType)
3932
+
3933
+ OwnedGift = Union[
3934
+ OwnedGiftRegular,
3935
+ OwnedGiftUnique,
3936
+ ]
3937
+ OwnedGiftAdapter = TypeAdapter[OwnedGift](OwnedGift)
3938
+
3939
+ BotCommandScope = Union[
3940
+ BotCommandScopeDefault,
3941
+ BotCommandScopeAllPrivateChats,
3942
+ BotCommandScopeAllGroupChats,
3943
+ BotCommandScopeAllChatAdministrators,
3944
+ BotCommandScopeChat,
3945
+ BotCommandScopeChatAdministrators,
3946
+ BotCommandScopeChatMember,
3947
+ ]
3948
+ BotCommandScopeAdapter = TypeAdapter[BotCommandScope](BotCommandScope)
3949
+
3950
+ MenuButton = Union[
3951
+ MenuButtonCommands,
3952
+ MenuButtonWebApp,
3953
+ MenuButtonDefault,
3954
+ ]
3955
+ MenuButtonAdapter = TypeAdapter[MenuButton](MenuButton)
3956
+
3957
+ ChatBoostSource = Union[
3958
+ ChatBoostSourcePremium,
3959
+ ChatBoostSourceGiftCode,
3960
+ ChatBoostSourceGiveaway,
3961
+ ]
3962
+ ChatBoostSourceAdapter = TypeAdapter[ChatBoostSource](ChatBoostSource)
3963
+
3964
+ InputMedia = Union[
3965
+ InputMediaAnimation,
3966
+ InputMediaDocument,
3967
+ InputMediaAudio,
3968
+ InputMediaPhoto,
3969
+ InputMediaVideo,
3970
+ ]
3971
+ InputMediaAdapter = TypeAdapter[InputMedia](InputMedia)
3972
+
3973
+ InputPaidMedia = Union[
3974
+ InputPaidMediaPhoto,
3975
+ InputPaidMediaVideo,
3976
+ ]
3977
+ InputPaidMediaAdapter = TypeAdapter[InputPaidMedia](InputPaidMedia)
3978
+
3979
+ InputProfilePhoto = Union[
3980
+ InputProfilePhotoStatic,
3981
+ InputProfilePhotoAnimated,
3982
+ ]
3983
+ InputProfilePhotoAdapter = TypeAdapter[InputProfilePhoto](InputProfilePhoto)
3984
+
3985
+ InputStoryContent = Union[
3986
+ InputStoryContentPhoto,
3987
+ InputStoryContentVideo,
3988
+ ]
3989
+ InputStoryContentAdapter = TypeAdapter[InputStoryContent](InputStoryContent)
3990
+
3991
+ InlineQueryResult = Union[
3992
+ InlineQueryResultCachedAudio,
3993
+ InlineQueryResultCachedDocument,
3994
+ InlineQueryResultCachedGif,
3995
+ InlineQueryResultCachedMpeg4Gif,
3996
+ InlineQueryResultCachedPhoto,
3997
+ InlineQueryResultCachedSticker,
3998
+ InlineQueryResultCachedVideo,
3999
+ InlineQueryResultCachedVoice,
4000
+ InlineQueryResultArticle,
4001
+ InlineQueryResultAudio,
4002
+ InlineQueryResultContact,
4003
+ InlineQueryResultGame,
4004
+ InlineQueryResultDocument,
4005
+ InlineQueryResultGif,
4006
+ InlineQueryResultLocation,
4007
+ InlineQueryResultMpeg4Gif,
4008
+ InlineQueryResultPhoto,
4009
+ InlineQueryResultVenue,
4010
+ InlineQueryResultVideo,
4011
+ InlineQueryResultVoice,
4012
+ ]
4013
+ InlineQueryResultAdapter = TypeAdapter[InlineQueryResult](InlineQueryResult)
4014
+
4015
+ InputMessageContent = Union[
4016
+ InputTextMessageContent,
4017
+ InputLocationMessageContent,
4018
+ InputVenueMessageContent,
4019
+ InputContactMessageContent,
4020
+ InputInvoiceMessageContent,
4021
+ ]
4022
+ InputMessageContentAdapter = TypeAdapter[InputMessageContent](InputMessageContent)
4023
+
4024
+ RevenueWithdrawalState = Union[
4025
+ RevenueWithdrawalStatePending,
4026
+ RevenueWithdrawalStateSucceeded,
4027
+ RevenueWithdrawalStateFailed,
4028
+ ]
4029
+ RevenueWithdrawalStateAdapter = TypeAdapter[RevenueWithdrawalState](RevenueWithdrawalState)
4030
+
4031
+ TransactionPartner = Union[
4032
+ TransactionPartnerUser,
4033
+ TransactionPartnerChat,
4034
+ TransactionPartnerAffiliateProgram,
4035
+ TransactionPartnerFragment,
4036
+ TransactionPartnerTelegramAds,
4037
+ TransactionPartnerTelegramApi,
4038
+ TransactionPartnerOther,
4039
+ ]
4040
+ TransactionPartnerAdapter = TypeAdapter[TransactionPartner](TransactionPartner)
4041
+
4042
+ PassportElementError = Union[
4043
+ PassportElementErrorDataField,
4044
+ PassportElementErrorFrontSide,
4045
+ PassportElementErrorReverseSide,
4046
+ PassportElementErrorSelfie,
4047
+ PassportElementErrorFile,
4048
+ PassportElementErrorFiles,
4049
+ PassportElementErrorTranslationFile,
4050
+ PassportElementErrorTranslationFiles,
4051
+ PassportElementErrorUnspecified,
4052
+ ]
4053
+ PassportElementErrorAdapter = TypeAdapter[PassportElementError](PassportElementError)
4054
+
4055
+ # Raw Python type adapters
4056
+ IntAdapter = TypeAdapter[int](int)
4057
+ StrAdapter = TypeAdapter[str](str)
4058
+ FloatAdapter = TypeAdapter[float](float)
4059
+ BoolAdapter = TypeAdapter[bool](bool)
4060
+ Update.model_rebuild()
4061
+ WebhookInfo.model_rebuild()
4062
+ User.model_rebuild()
4063
+ Chat.model_rebuild()
4064
+ ChatFullInfo.model_rebuild()
4065
+ Message.model_rebuild()
4066
+ MessageId.model_rebuild()
4067
+ InaccessibleMessage.model_rebuild()
4068
+ MessageEntity.model_rebuild()
4069
+ TextQuote.model_rebuild()
4070
+ ExternalReplyInfo.model_rebuild()
4071
+ ReplyParameters.model_rebuild()
4072
+ MessageOriginUser.model_rebuild()
4073
+ MessageOriginHiddenUser.model_rebuild()
4074
+ MessageOriginChat.model_rebuild()
4075
+ MessageOriginChannel.model_rebuild()
4076
+ PhotoSize.model_rebuild()
4077
+ Animation.model_rebuild()
4078
+ Audio.model_rebuild()
4079
+ Document.model_rebuild()
4080
+ Story.model_rebuild()
4081
+ Video.model_rebuild()
4082
+ VideoNote.model_rebuild()
4083
+ Voice.model_rebuild()
4084
+ PaidMediaInfo.model_rebuild()
4085
+ PaidMediaPreview.model_rebuild()
4086
+ PaidMediaPhoto.model_rebuild()
4087
+ PaidMediaVideo.model_rebuild()
4088
+ Contact.model_rebuild()
4089
+ Dice.model_rebuild()
4090
+ PollOption.model_rebuild()
4091
+ InputPollOption.model_rebuild()
4092
+ PollAnswer.model_rebuild()
4093
+ Poll.model_rebuild()
4094
+ ChecklistTask.model_rebuild()
4095
+ Checklist.model_rebuild()
4096
+ InputChecklistTask.model_rebuild()
4097
+ InputChecklist.model_rebuild()
4098
+ ChecklistTasksDone.model_rebuild()
4099
+ ChecklistTasksAdded.model_rebuild()
4100
+ Location.model_rebuild()
4101
+ Venue.model_rebuild()
4102
+ WebAppData.model_rebuild()
4103
+ ProximityAlertTriggered.model_rebuild()
4104
+ MessageAutoDeleteTimerChanged.model_rebuild()
4105
+ ChatBoostAdded.model_rebuild()
4106
+ BackgroundFillSolid.model_rebuild()
4107
+ BackgroundFillGradient.model_rebuild()
4108
+ BackgroundFillFreeformGradient.model_rebuild()
4109
+ BackgroundTypeFill.model_rebuild()
4110
+ BackgroundTypeWallpaper.model_rebuild()
4111
+ BackgroundTypePattern.model_rebuild()
4112
+ BackgroundTypeChatTheme.model_rebuild()
4113
+ ChatBackground.model_rebuild()
4114
+ ForumTopicCreated.model_rebuild()
4115
+ ForumTopicClosed.model_rebuild()
4116
+ ForumTopicEdited.model_rebuild()
4117
+ ForumTopicReopened.model_rebuild()
4118
+ GeneralForumTopicHidden.model_rebuild()
4119
+ GeneralForumTopicUnhidden.model_rebuild()
4120
+ SharedUser.model_rebuild()
4121
+ UsersShared.model_rebuild()
4122
+ ChatShared.model_rebuild()
4123
+ WriteAccessAllowed.model_rebuild()
4124
+ VideoChatScheduled.model_rebuild()
4125
+ VideoChatStarted.model_rebuild()
4126
+ VideoChatEnded.model_rebuild()
4127
+ VideoChatParticipantsInvited.model_rebuild()
4128
+ PaidMessagePriceChanged.model_rebuild()
4129
+ DirectMessagePriceChanged.model_rebuild()
4130
+ SuggestedPostApproved.model_rebuild()
4131
+ SuggestedPostApprovalFailed.model_rebuild()
4132
+ SuggestedPostDeclined.model_rebuild()
4133
+ SuggestedPostPaid.model_rebuild()
4134
+ SuggestedPostRefunded.model_rebuild()
4135
+ GiveawayCreated.model_rebuild()
4136
+ Giveaway.model_rebuild()
4137
+ GiveawayWinners.model_rebuild()
4138
+ GiveawayCompleted.model_rebuild()
4139
+ LinkPreviewOptions.model_rebuild()
4140
+ SuggestedPostPrice.model_rebuild()
4141
+ SuggestedPostInfo.model_rebuild()
4142
+ SuggestedPostParameters.model_rebuild()
4143
+ DirectMessagesTopic.model_rebuild()
4144
+ UserProfilePhotos.model_rebuild()
4145
+ File.model_rebuild()
4146
+ WebAppInfo.model_rebuild()
4147
+ ReplyKeyboardMarkup.model_rebuild()
4148
+ KeyboardButton.model_rebuild()
4149
+ KeyboardButtonRequestUsers.model_rebuild()
4150
+ KeyboardButtonRequestChat.model_rebuild()
4151
+ KeyboardButtonPollType.model_rebuild()
4152
+ ReplyKeyboardRemove.model_rebuild()
4153
+ InlineKeyboardMarkup.model_rebuild()
4154
+ InlineKeyboardButton.model_rebuild()
4155
+ LoginUrl.model_rebuild()
4156
+ SwitchInlineQueryChosenChat.model_rebuild()
4157
+ CopyTextButton.model_rebuild()
4158
+ CallbackQuery.model_rebuild()
4159
+ ForceReply.model_rebuild()
4160
+ ChatPhoto.model_rebuild()
4161
+ ChatInviteLink.model_rebuild()
4162
+ ChatAdministratorRights.model_rebuild()
4163
+ ChatMemberUpdated.model_rebuild()
4164
+ ChatMemberOwner.model_rebuild()
4165
+ ChatMemberAdministrator.model_rebuild()
4166
+ ChatMemberMember.model_rebuild()
4167
+ ChatMemberRestricted.model_rebuild()
4168
+ ChatMemberLeft.model_rebuild()
4169
+ ChatMemberBanned.model_rebuild()
4170
+ ChatJoinRequest.model_rebuild()
4171
+ ChatPermissions.model_rebuild()
4172
+ Birthdate.model_rebuild()
4173
+ BusinessIntro.model_rebuild()
4174
+ BusinessLocation.model_rebuild()
4175
+ BusinessOpeningHoursInterval.model_rebuild()
4176
+ BusinessOpeningHours.model_rebuild()
4177
+ StoryAreaPosition.model_rebuild()
4178
+ LocationAddress.model_rebuild()
4179
+ StoryAreaTypeLocation.model_rebuild()
4180
+ StoryAreaTypeSuggestedReaction.model_rebuild()
4181
+ StoryAreaTypeLink.model_rebuild()
4182
+ StoryAreaTypeWeather.model_rebuild()
4183
+ StoryAreaTypeUniqueGift.model_rebuild()
4184
+ StoryArea.model_rebuild()
4185
+ ChatLocation.model_rebuild()
4186
+ ReactionTypeEmoji.model_rebuild()
4187
+ ReactionTypeCustomEmoji.model_rebuild()
4188
+ ReactionTypePaid.model_rebuild()
4189
+ ReactionCount.model_rebuild()
4190
+ MessageReactionUpdated.model_rebuild()
4191
+ MessageReactionCountUpdated.model_rebuild()
4192
+ ForumTopic.model_rebuild()
4193
+ Gift.model_rebuild()
4194
+ Gifts.model_rebuild()
4195
+ UniqueGiftModel.model_rebuild()
4196
+ UniqueGiftSymbol.model_rebuild()
4197
+ UniqueGiftBackdropColors.model_rebuild()
4198
+ UniqueGiftBackdrop.model_rebuild()
4199
+ UniqueGift.model_rebuild()
4200
+ GiftInfo.model_rebuild()
4201
+ UniqueGiftInfo.model_rebuild()
4202
+ OwnedGiftRegular.model_rebuild()
4203
+ OwnedGiftUnique.model_rebuild()
4204
+ OwnedGifts.model_rebuild()
4205
+ AcceptedGiftTypes.model_rebuild()
4206
+ StarAmount.model_rebuild()
4207
+ BotCommand.model_rebuild()
4208
+ BotCommandScopeDefault.model_rebuild()
4209
+ BotCommandScopeAllPrivateChats.model_rebuild()
4210
+ BotCommandScopeAllGroupChats.model_rebuild()
4211
+ BotCommandScopeAllChatAdministrators.model_rebuild()
4212
+ BotCommandScopeChat.model_rebuild()
4213
+ BotCommandScopeChatAdministrators.model_rebuild()
4214
+ BotCommandScopeChatMember.model_rebuild()
4215
+ BotName.model_rebuild()
4216
+ BotDescription.model_rebuild()
4217
+ BotShortDescription.model_rebuild()
4218
+ MenuButtonCommands.model_rebuild()
4219
+ MenuButtonWebApp.model_rebuild()
4220
+ MenuButtonDefault.model_rebuild()
4221
+ ChatBoostSourcePremium.model_rebuild()
4222
+ ChatBoostSourceGiftCode.model_rebuild()
4223
+ ChatBoostSourceGiveaway.model_rebuild()
4224
+ ChatBoost.model_rebuild()
4225
+ ChatBoostUpdated.model_rebuild()
4226
+ ChatBoostRemoved.model_rebuild()
4227
+ UserChatBoosts.model_rebuild()
4228
+ BusinessBotRights.model_rebuild()
4229
+ BusinessConnection.model_rebuild()
4230
+ BusinessMessagesDeleted.model_rebuild()
4231
+ ResponseParameters.model_rebuild()
4232
+ InputMediaPhoto.model_rebuild()
4233
+ InputMediaVideo.model_rebuild()
4234
+ InputMediaAnimation.model_rebuild()
4235
+ InputMediaAudio.model_rebuild()
4236
+ InputMediaDocument.model_rebuild()
4237
+ InputFile.model_rebuild()
4238
+ InputPaidMediaPhoto.model_rebuild()
4239
+ InputPaidMediaVideo.model_rebuild()
4240
+ InputProfilePhotoStatic.model_rebuild()
4241
+ InputProfilePhotoAnimated.model_rebuild()
4242
+ InputStoryContentPhoto.model_rebuild()
4243
+ InputStoryContentVideo.model_rebuild()
4244
+ Sticker.model_rebuild()
4245
+ StickerSet.model_rebuild()
4246
+ MaskPosition.model_rebuild()
4247
+ InputSticker.model_rebuild()
4248
+ InlineQuery.model_rebuild()
4249
+ InlineQueryResultsButton.model_rebuild()
4250
+ InlineQueryResultArticle.model_rebuild()
4251
+ InlineQueryResultPhoto.model_rebuild()
4252
+ InlineQueryResultGif.model_rebuild()
4253
+ InlineQueryResultMpeg4Gif.model_rebuild()
4254
+ InlineQueryResultVideo.model_rebuild()
4255
+ InlineQueryResultAudio.model_rebuild()
4256
+ InlineQueryResultVoice.model_rebuild()
4257
+ InlineQueryResultDocument.model_rebuild()
4258
+ InlineQueryResultLocation.model_rebuild()
4259
+ InlineQueryResultVenue.model_rebuild()
4260
+ InlineQueryResultContact.model_rebuild()
4261
+ InlineQueryResultGame.model_rebuild()
4262
+ InlineQueryResultCachedPhoto.model_rebuild()
4263
+ InlineQueryResultCachedGif.model_rebuild()
4264
+ InlineQueryResultCachedMpeg4Gif.model_rebuild()
4265
+ InlineQueryResultCachedSticker.model_rebuild()
4266
+ InlineQueryResultCachedDocument.model_rebuild()
4267
+ InlineQueryResultCachedVideo.model_rebuild()
4268
+ InlineQueryResultCachedVoice.model_rebuild()
4269
+ InlineQueryResultCachedAudio.model_rebuild()
4270
+ InputTextMessageContent.model_rebuild()
4271
+ InputLocationMessageContent.model_rebuild()
4272
+ InputVenueMessageContent.model_rebuild()
4273
+ InputContactMessageContent.model_rebuild()
4274
+ InputInvoiceMessageContent.model_rebuild()
4275
+ ChosenInlineResult.model_rebuild()
4276
+ SentWebAppMessage.model_rebuild()
4277
+ PreparedInlineMessage.model_rebuild()
4278
+ LabeledPrice.model_rebuild()
4279
+ Invoice.model_rebuild()
4280
+ ShippingAddress.model_rebuild()
4281
+ OrderInfo.model_rebuild()
4282
+ ShippingOption.model_rebuild()
4283
+ SuccessfulPayment.model_rebuild()
4284
+ RefundedPayment.model_rebuild()
4285
+ ShippingQuery.model_rebuild()
4286
+ PreCheckoutQuery.model_rebuild()
4287
+ PaidMediaPurchased.model_rebuild()
4288
+ RevenueWithdrawalStatePending.model_rebuild()
4289
+ RevenueWithdrawalStateSucceeded.model_rebuild()
4290
+ RevenueWithdrawalStateFailed.model_rebuild()
4291
+ AffiliateInfo.model_rebuild()
4292
+ TransactionPartnerUser.model_rebuild()
4293
+ TransactionPartnerChat.model_rebuild()
4294
+ TransactionPartnerAffiliateProgram.model_rebuild()
4295
+ TransactionPartnerFragment.model_rebuild()
4296
+ TransactionPartnerTelegramAds.model_rebuild()
4297
+ TransactionPartnerTelegramApi.model_rebuild()
4298
+ TransactionPartnerOther.model_rebuild()
4299
+ StarTransaction.model_rebuild()
4300
+ StarTransactions.model_rebuild()
4301
+ PassportData.model_rebuild()
4302
+ PassportFile.model_rebuild()
4303
+ EncryptedPassportElement.model_rebuild()
4304
+ EncryptedCredentials.model_rebuild()
4305
+ PassportElementErrorDataField.model_rebuild()
4306
+ PassportElementErrorFrontSide.model_rebuild()
4307
+ PassportElementErrorReverseSide.model_rebuild()
4308
+ PassportElementErrorSelfie.model_rebuild()
4309
+ PassportElementErrorFile.model_rebuild()
4310
+ PassportElementErrorFiles.model_rebuild()
4311
+ PassportElementErrorTranslationFile.model_rebuild()
4312
+ PassportElementErrorTranslationFiles.model_rebuild()
4313
+ PassportElementErrorUnspecified.model_rebuild()
4314
+ Game.model_rebuild()
4315
+ CallbackGame.model_rebuild()
4316
+ GameHighScore.model_rebuild()