telegrinder 0.3.4.post1__py3-none-any.whl → 0.4.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.

Potentially problematic release.


This version of telegrinder might be problematic. Click here for more details.

Files changed (169) hide show
  1. telegrinder/__init__.py +30 -31
  2. telegrinder/api/__init__.py +2 -1
  3. telegrinder/api/api.py +28 -20
  4. telegrinder/api/error.py +8 -4
  5. telegrinder/api/response.py +2 -2
  6. telegrinder/api/token.py +2 -2
  7. telegrinder/bot/__init__.py +6 -0
  8. telegrinder/bot/bot.py +38 -31
  9. telegrinder/bot/cute_types/__init__.py +2 -0
  10. telegrinder/bot/cute_types/base.py +54 -128
  11. telegrinder/bot/cute_types/callback_query.py +76 -61
  12. telegrinder/bot/cute_types/chat_join_request.py +4 -3
  13. telegrinder/bot/cute_types/chat_member_updated.py +28 -31
  14. telegrinder/bot/cute_types/inline_query.py +5 -4
  15. telegrinder/bot/cute_types/message.py +555 -602
  16. telegrinder/bot/cute_types/pre_checkout_query.py +42 -0
  17. telegrinder/bot/cute_types/update.py +20 -12
  18. telegrinder/bot/cute_types/utils.py +3 -36
  19. telegrinder/bot/dispatch/__init__.py +4 -0
  20. telegrinder/bot/dispatch/abc.py +8 -9
  21. telegrinder/bot/dispatch/context.py +5 -7
  22. telegrinder/bot/dispatch/dispatch.py +85 -33
  23. telegrinder/bot/dispatch/handler/abc.py +5 -6
  24. telegrinder/bot/dispatch/handler/audio_reply.py +2 -2
  25. telegrinder/bot/dispatch/handler/base.py +3 -3
  26. telegrinder/bot/dispatch/handler/document_reply.py +2 -2
  27. telegrinder/bot/dispatch/handler/func.py +36 -42
  28. telegrinder/bot/dispatch/handler/media_group_reply.py +5 -4
  29. telegrinder/bot/dispatch/handler/message_reply.py +2 -2
  30. telegrinder/bot/dispatch/handler/photo_reply.py +2 -2
  31. telegrinder/bot/dispatch/handler/sticker_reply.py +2 -2
  32. telegrinder/bot/dispatch/handler/video_reply.py +2 -2
  33. telegrinder/bot/dispatch/middleware/abc.py +83 -8
  34. telegrinder/bot/dispatch/middleware/global_middleware.py +70 -0
  35. telegrinder/bot/dispatch/process.py +44 -50
  36. telegrinder/bot/dispatch/return_manager/__init__.py +2 -0
  37. telegrinder/bot/dispatch/return_manager/abc.py +6 -10
  38. telegrinder/bot/dispatch/return_manager/pre_checkout_query.py +20 -0
  39. telegrinder/bot/dispatch/view/__init__.py +2 -0
  40. telegrinder/bot/dispatch/view/abc.py +10 -6
  41. telegrinder/bot/dispatch/view/base.py +81 -50
  42. telegrinder/bot/dispatch/view/box.py +20 -9
  43. telegrinder/bot/dispatch/view/callback_query.py +3 -4
  44. telegrinder/bot/dispatch/view/chat_join_request.py +2 -7
  45. telegrinder/bot/dispatch/view/chat_member.py +3 -5
  46. telegrinder/bot/dispatch/view/inline_query.py +3 -4
  47. telegrinder/bot/dispatch/view/message.py +3 -4
  48. telegrinder/bot/dispatch/view/pre_checkout_query.py +16 -0
  49. telegrinder/bot/dispatch/view/raw.py +42 -40
  50. telegrinder/bot/dispatch/waiter_machine/actions.py +5 -4
  51. telegrinder/bot/dispatch/waiter_machine/hasher/__init__.py +0 -0
  52. telegrinder/bot/dispatch/waiter_machine/hasher/callback.py +0 -0
  53. telegrinder/bot/dispatch/waiter_machine/hasher/hasher.py +9 -7
  54. telegrinder/bot/dispatch/waiter_machine/hasher/message.py +0 -0
  55. telegrinder/bot/dispatch/waiter_machine/hasher/state.py +3 -2
  56. telegrinder/bot/dispatch/waiter_machine/machine.py +113 -34
  57. telegrinder/bot/dispatch/waiter_machine/middleware.py +15 -10
  58. telegrinder/bot/dispatch/waiter_machine/short_state.py +7 -18
  59. telegrinder/bot/polling/polling.py +62 -54
  60. telegrinder/bot/rules/__init__.py +24 -1
  61. telegrinder/bot/rules/abc.py +17 -10
  62. telegrinder/bot/rules/callback_data.py +20 -61
  63. telegrinder/bot/rules/chat_join.py +6 -4
  64. telegrinder/bot/rules/command.py +4 -4
  65. telegrinder/bot/rules/enum_text.py +1 -4
  66. telegrinder/bot/rules/func.py +5 -3
  67. telegrinder/bot/rules/fuzzy.py +1 -1
  68. telegrinder/bot/rules/id.py +24 -0
  69. telegrinder/bot/rules/inline.py +6 -4
  70. telegrinder/bot/rules/integer.py +2 -1
  71. telegrinder/bot/rules/logic.py +18 -0
  72. telegrinder/bot/rules/markup.py +5 -6
  73. telegrinder/bot/rules/message.py +2 -4
  74. telegrinder/bot/rules/message_entities.py +1 -3
  75. telegrinder/bot/rules/node.py +15 -9
  76. telegrinder/bot/rules/payload.py +81 -0
  77. telegrinder/bot/rules/payment_invoice.py +29 -0
  78. telegrinder/bot/rules/regex.py +5 -6
  79. telegrinder/bot/rules/state.py +1 -3
  80. telegrinder/bot/rules/text.py +10 -5
  81. telegrinder/bot/rules/update.py +0 -0
  82. telegrinder/bot/scenario/abc.py +2 -4
  83. telegrinder/bot/scenario/checkbox.py +12 -14
  84. telegrinder/bot/scenario/choice.py +6 -9
  85. telegrinder/client/__init__.py +9 -1
  86. telegrinder/client/abc.py +35 -10
  87. telegrinder/client/aiohttp.py +28 -24
  88. telegrinder/client/form_data.py +31 -0
  89. telegrinder/client/sonic.py +212 -0
  90. telegrinder/model.py +38 -145
  91. telegrinder/modules.py +3 -1
  92. telegrinder/msgspec_utils.py +136 -68
  93. telegrinder/node/__init__.py +74 -13
  94. telegrinder/node/attachment.py +92 -16
  95. telegrinder/node/base.py +196 -68
  96. telegrinder/node/callback_query.py +17 -16
  97. telegrinder/node/command.py +3 -2
  98. telegrinder/node/composer.py +40 -75
  99. telegrinder/node/container.py +13 -7
  100. telegrinder/node/either.py +82 -0
  101. telegrinder/node/event.py +20 -31
  102. telegrinder/node/file.py +51 -0
  103. telegrinder/node/me.py +4 -5
  104. telegrinder/node/payload.py +78 -0
  105. telegrinder/node/polymorphic.py +27 -8
  106. telegrinder/node/rule.py +2 -6
  107. telegrinder/node/scope.py +4 -6
  108. telegrinder/node/source.py +37 -21
  109. telegrinder/node/text.py +20 -8
  110. telegrinder/node/tools/generator.py +7 -11
  111. telegrinder/py.typed +0 -0
  112. telegrinder/rules.py +0 -61
  113. telegrinder/tools/__init__.py +97 -38
  114. telegrinder/tools/adapter/__init__.py +19 -0
  115. telegrinder/tools/adapter/abc.py +49 -0
  116. telegrinder/tools/adapter/dataclass.py +56 -0
  117. telegrinder/{bot/rules → tools}/adapter/event.py +8 -10
  118. telegrinder/{bot/rules → tools}/adapter/node.py +8 -10
  119. telegrinder/{bot/rules → tools}/adapter/raw_event.py +2 -2
  120. telegrinder/{bot/rules → tools}/adapter/raw_update.py +2 -2
  121. telegrinder/tools/buttons.py +52 -26
  122. telegrinder/tools/callback_data_serilization/__init__.py +5 -0
  123. telegrinder/tools/callback_data_serilization/abc.py +51 -0
  124. telegrinder/tools/callback_data_serilization/json_ser.py +60 -0
  125. telegrinder/tools/callback_data_serilization/msgpack_ser.py +172 -0
  126. telegrinder/tools/error_handler/abc.py +4 -7
  127. telegrinder/tools/error_handler/error.py +0 -0
  128. telegrinder/tools/error_handler/error_handler.py +34 -48
  129. telegrinder/tools/formatting/__init__.py +57 -37
  130. telegrinder/tools/formatting/deep_links.py +541 -0
  131. telegrinder/tools/formatting/{html.py → html_formatter.py} +51 -79
  132. telegrinder/tools/formatting/spec_html_formats.py +14 -60
  133. telegrinder/tools/functional.py +1 -5
  134. telegrinder/tools/global_context/global_context.py +26 -51
  135. telegrinder/tools/global_context/telegrinder_ctx.py +3 -3
  136. telegrinder/tools/i18n/abc.py +0 -0
  137. telegrinder/tools/i18n/middleware/abc.py +3 -6
  138. telegrinder/tools/input_file_directory.py +30 -0
  139. telegrinder/tools/keyboard.py +9 -9
  140. telegrinder/tools/lifespan.py +105 -0
  141. telegrinder/tools/limited_dict.py +5 -10
  142. telegrinder/tools/loop_wrapper/abc.py +7 -2
  143. telegrinder/tools/loop_wrapper/loop_wrapper.py +40 -95
  144. telegrinder/tools/magic.py +184 -34
  145. telegrinder/tools/state_storage/__init__.py +0 -0
  146. telegrinder/tools/state_storage/abc.py +5 -9
  147. telegrinder/tools/state_storage/memory.py +1 -1
  148. telegrinder/tools/strings.py +13 -0
  149. telegrinder/types/__init__.py +8 -0
  150. telegrinder/types/enums.py +31 -21
  151. telegrinder/types/input_file.py +51 -0
  152. telegrinder/types/methods.py +531 -109
  153. telegrinder/types/objects.py +934 -826
  154. telegrinder/verification_utils.py +0 -2
  155. {telegrinder-0.3.4.post1.dist-info → telegrinder-0.4.0.dist-info}/LICENSE +2 -2
  156. telegrinder-0.4.0.dist-info/METADATA +144 -0
  157. telegrinder-0.4.0.dist-info/RECORD +182 -0
  158. {telegrinder-0.3.4.post1.dist-info → telegrinder-0.4.0.dist-info}/WHEEL +1 -1
  159. telegrinder/bot/rules/adapter/__init__.py +0 -17
  160. telegrinder/bot/rules/adapter/abc.py +0 -31
  161. telegrinder/node/message.py +0 -14
  162. telegrinder/node/update.py +0 -15
  163. telegrinder/tools/formatting/links.py +0 -38
  164. telegrinder/tools/kb_set/__init__.py +0 -4
  165. telegrinder/tools/kb_set/base.py +0 -15
  166. telegrinder/tools/kb_set/yaml.py +0 -63
  167. telegrinder-0.3.4.post1.dist-info/METADATA +0 -110
  168. telegrinder-0.3.4.post1.dist-info/RECORD +0 -165
  169. /telegrinder/{bot/rules → tools}/adapter/errors.py +0 -0
@@ -1,14 +1,15 @@
1
1
  from __future__ import annotations
2
2
 
3
- import pathlib
3
+ import secrets
4
4
  import typing
5
5
  from functools import cached_property
6
6
 
7
- from fntypes.variative import Variative
7
+ from fntypes.co import Nothing, Variative
8
8
 
9
- from telegrinder.model import From, Model, field, generate_random_id
10
- from telegrinder.msgspec_utils import Nothing, Option, datetime
9
+ from telegrinder.model import UNSET, From, Model, field
10
+ from telegrinder.msgspec_utils import Option, datetime
11
11
  from telegrinder.types.enums import * # noqa: F403
12
+ from telegrinder.types.input_file import InputFile
12
13
 
13
14
 
14
15
  class TransactionPartner(Model):
@@ -16,8 +17,11 @@ class TransactionPartner(Model):
16
17
 
17
18
  This object describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
18
19
  - TransactionPartnerUser
20
+ - TransactionPartnerChat
21
+ - TransactionPartnerAffiliateProgram
19
22
  - TransactionPartnerFragment
20
23
  - TransactionPartnerTelegramAds
24
+ - TransactionPartnerTelegramApi
21
25
  - TransactionPartnerOther
22
26
  """
23
27
 
@@ -233,42 +237,42 @@ class Update(Model):
233
237
  If there are no new updates for at least a week, then identifier of the next
234
238
  update will be chosen randomly instead of sequentially."""
235
239
 
236
- message: Option[Message] = field(default=Nothing, converter=From["Message | None"])
240
+ message: Option[Message] = field(default=UNSET, converter=From["Message | None"])
237
241
  """Optional. New incoming message of any kind - text, photo, sticker, etc."""
238
242
 
239
- edited_message: Option[Message] = field(default=Nothing, converter=From["Message | None"])
243
+ edited_message: Option[Message] = field(default=UNSET, converter=From["Message | None"])
240
244
  """Optional. New version of a message that is known to the bot and was edited.
241
245
  This update may at times be triggered by changes to message fields that are
242
246
  either unavailable or not actively used by your bot."""
243
247
 
244
- channel_post: Option[Message] = field(default=Nothing, converter=From["Message | None"])
248
+ channel_post: Option[Message] = field(default=UNSET, converter=From["Message | None"])
245
249
  """Optional. New incoming channel post of any kind - text, photo, sticker,
246
250
  etc."""
247
251
 
248
- edited_channel_post: Option[Message] = field(default=Nothing, converter=From["Message | None"])
252
+ edited_channel_post: Option[Message] = field(default=UNSET, converter=From["Message | None"])
249
253
  """Optional. New version of a channel post that is known to the bot and was edited.
250
254
  This update may at times be triggered by changes to message fields that are
251
255
  either unavailable or not actively used by your bot."""
252
256
 
253
257
  business_connection: Option[BusinessConnection] = field(
254
- default=Nothing, converter=From["BusinessConnection | None"]
258
+ default=UNSET, converter=From["BusinessConnection | None"]
255
259
  )
256
260
  """Optional. The bot was connected to or disconnected from a business account,
257
261
  or a user edited an existing connection with the bot."""
258
262
 
259
- business_message: Option[Message] = field(default=Nothing, converter=From["Message | None"])
263
+ business_message: Option[Message] = field(default=UNSET, converter=From["Message | None"])
260
264
  """Optional. New message from a connected business account."""
261
265
 
262
- edited_business_message: Option[Message] = field(default=Nothing, converter=From["Message | None"])
266
+ edited_business_message: Option[Message] = field(default=UNSET, converter=From["Message | None"])
263
267
  """Optional. New version of a message from a connected business account."""
264
268
 
265
269
  deleted_business_messages: Option[BusinessMessagesDeleted] = field(
266
- default=Nothing, converter=From["BusinessMessagesDeleted | None"]
270
+ default=UNSET, converter=From["BusinessMessagesDeleted | None"]
267
271
  )
268
272
  """Optional. Messages were deleted from a connected business account."""
269
273
 
270
274
  message_reaction: Option[MessageReactionUpdated] = field(
271
- default=Nothing, converter=From["MessageReactionUpdated | None"]
275
+ default=UNSET, converter=From["MessageReactionUpdated | None"]
272
276
  )
273
277
  """Optional. A reaction to a message was changed by a user. The bot must be an
274
278
  administrator in the chat and must explicitly specify `message_reaction`
@@ -276,93 +280,82 @@ class Update(Model):
276
280
  received for reactions set by bots."""
277
281
 
278
282
  message_reaction_count: Option[MessageReactionCountUpdated] = field(
279
- default=Nothing, converter=From["MessageReactionCountUpdated | None"]
283
+ default=UNSET, converter=From["MessageReactionCountUpdated | None"]
280
284
  )
281
285
  """Optional. Reactions to a message with anonymous reactions were changed.
282
286
  The bot must be an administrator in the chat and must explicitly specify
283
287
  `message_reaction_count` in the list of allowed_updates to receive these
284
288
  updates. The updates are grouped and can be sent with delay up to a few minutes."""
285
289
 
286
- inline_query: Option[InlineQuery] = field(default=Nothing, converter=From["InlineQuery | None"])
290
+ inline_query: Option[InlineQuery] = field(default=UNSET, converter=From["InlineQuery | None"])
287
291
  """Optional. New incoming inline query."""
288
292
 
289
293
  chosen_inline_result: Option[ChosenInlineResult] = field(
290
- default=Nothing, converter=From["ChosenInlineResult | None"]
294
+ default=UNSET, converter=From["ChosenInlineResult | None"]
291
295
  )
292
296
  """Optional. The result of an inline query that was chosen by a user and sent
293
297
  to their chat partner. Please see our documentation on the feedback collecting
294
298
  for details on how to enable these updates for your bot."""
295
299
 
296
- callback_query: Option[CallbackQuery] = field(default=Nothing, converter=From["CallbackQuery | None"])
300
+ callback_query: Option[CallbackQuery] = field(default=UNSET, converter=From["CallbackQuery | None"])
297
301
  """Optional. New incoming callback query."""
298
302
 
299
- shipping_query: Option[ShippingQuery] = field(default=Nothing, converter=From["ShippingQuery | None"])
303
+ shipping_query: Option[ShippingQuery] = field(default=UNSET, converter=From["ShippingQuery | None"])
300
304
  """Optional. New incoming shipping query. Only for invoices with flexible
301
305
  price."""
302
306
 
303
- pre_checkout_query: Option[PreCheckoutQuery] = field(
304
- default=Nothing, converter=From["PreCheckoutQuery | None"]
305
- )
307
+ pre_checkout_query: Option[PreCheckoutQuery] = field(default=UNSET, converter=From["PreCheckoutQuery | None"])
306
308
  """Optional. New incoming pre-checkout query. Contains full information
307
309
  about checkout."""
308
310
 
309
311
  purchased_paid_media: Option[PaidMediaPurchased] = field(
310
- default=Nothing, converter=From["PaidMediaPurchased | None"]
312
+ default=UNSET, converter=From["PaidMediaPurchased | None"]
311
313
  )
312
314
  """Optional. A user purchased paid media with a non-empty payload sent by the
313
315
  bot in a non-channel chat."""
314
316
 
315
- poll: Option[Poll] = field(default=Nothing, converter=From["Poll | None"])
317
+ poll: Option[Poll] = field(default=UNSET, converter=From["Poll | None"])
316
318
  """Optional. New poll state. Bots receive only updates about manually stopped
317
319
  polls and polls, which are sent by the bot."""
318
320
 
319
- poll_answer: Option[PollAnswer] = field(default=Nothing, converter=From["PollAnswer | None"])
321
+ poll_answer: Option[PollAnswer] = field(default=UNSET, converter=From["PollAnswer | None"])
320
322
  """Optional. A user changed their answer in a non-anonymous poll. Bots receive
321
323
  new votes only in polls that were sent by the bot itself."""
322
324
 
323
- my_chat_member: Option[ChatMemberUpdated] = field(
324
- default=Nothing, converter=From["ChatMemberUpdated | None"]
325
- )
325
+ my_chat_member: Option[ChatMemberUpdated] = field(default=UNSET, converter=From["ChatMemberUpdated | None"])
326
326
  """Optional. The bot's chat member status was updated in a chat. For private
327
327
  chats, this update is received only when the bot is blocked or unblocked
328
328
  by the user."""
329
329
 
330
- chat_member: Option[ChatMemberUpdated] = field(
331
- default=Nothing, converter=From["ChatMemberUpdated | None"]
332
- )
330
+ chat_member: Option[ChatMemberUpdated] = field(default=UNSET, converter=From["ChatMemberUpdated | None"])
333
331
  """Optional. A chat member's status was updated in a chat. The bot must be an
334
332
  administrator in the chat and must explicitly specify `chat_member` in
335
333
  the list of allowed_updates to receive these updates."""
336
334
 
337
- chat_join_request: Option[ChatJoinRequest] = field(
338
- default=Nothing, converter=From["ChatJoinRequest | None"]
339
- )
335
+ chat_join_request: Option[ChatJoinRequest] = field(default=UNSET, converter=From["ChatJoinRequest | None"])
340
336
  """Optional. A request to join the chat has been sent. The bot must have the can_invite_users
341
337
  administrator right in the chat to receive these updates."""
342
338
 
343
- chat_boost: Option[ChatBoostUpdated] = field(default=Nothing, converter=From["ChatBoostUpdated | None"])
339
+ chat_boost: Option[ChatBoostUpdated] = field(default=UNSET, converter=From["ChatBoostUpdated | None"])
344
340
  """Optional. A chat boost was added or changed. The bot must be an administrator
345
341
  in the chat to receive these updates."""
346
342
 
347
- removed_chat_boost: Option[ChatBoostRemoved] = field(
348
- default=Nothing, converter=From["ChatBoostRemoved | None"]
349
- )
343
+ removed_chat_boost: Option[ChatBoostRemoved] = field(default=UNSET, converter=From["ChatBoostRemoved | None"])
350
344
  """Optional. A boost was removed from a chat. The bot must be an administrator
351
345
  in the chat to receive these updates."""
352
346
 
353
- def __eq__(self, other: object) -> bool:
347
+ def __eq__(self, other: object, /) -> bool:
354
348
  return isinstance(other, self.__class__) and self.update_type == other.update_type
355
349
 
356
350
  @cached_property
357
351
  def update_type(self) -> UpdateType:
358
352
  """Incoming update type."""
359
-
360
353
  return UpdateType(
361
354
  next(
362
355
  (
363
356
  x
364
357
  for x in self.__struct_fields__
365
- if x != "update_id" and not isinstance(getattr(self, x), type(Nothing))
358
+ if x != "update_id" and not isinstance(getattr(self, x), Nothing)
366
359
  )
367
360
  ),
368
361
  )
@@ -370,7 +363,6 @@ class Update(Model):
370
363
  @cached_property
371
364
  def incoming_update(self) -> Model:
372
365
  """Incoming update."""
373
-
374
366
  return getattr(self, self.update_type.value).unwrap()
375
367
 
376
368
 
@@ -389,28 +381,26 @@ class WebhookInfo(Model):
389
381
  pending_update_count: int = field()
390
382
  """Number of updates awaiting delivery."""
391
383
 
392
- ip_address: Option[str] = field(default=Nothing, converter=From[str | None])
384
+ ip_address: Option[str] = field(default=UNSET, converter=From[str | None])
393
385
  """Optional. Currently used webhook IP address."""
394
386
 
395
- last_error_date: Option[datetime] = field(default=Nothing, converter=From[datetime | None])
387
+ last_error_date: Option[datetime] = field(default=UNSET, converter=From[datetime | None])
396
388
  """Optional. Unix time for the most recent error that happened when trying
397
389
  to deliver an update via webhook."""
398
390
 
399
- last_error_message: Option[str] = field(default=Nothing, converter=From[str | None])
391
+ last_error_message: Option[str] = field(default=UNSET, converter=From[str | None])
400
392
  """Optional. Error message in human-readable format for the most recent error
401
393
  that happened when trying to deliver an update via webhook."""
402
394
 
403
- last_synchronization_error_date: Option[datetime] = field(
404
- default=Nothing, converter=From[datetime | None]
405
- )
395
+ last_synchronization_error_date: Option[datetime] = field(default=UNSET, converter=From[datetime | None])
406
396
  """Optional. Unix time of the most recent error that happened when trying to
407
397
  synchronize available updates with Telegram datacenters."""
408
398
 
409
- max_connections: Option[int] = field(default=Nothing, converter=From[int | None])
399
+ max_connections: Option[int] = field(default=UNSET, converter=From[int | None])
410
400
  """Optional. The maximum allowed number of simultaneous HTTPS connections
411
401
  to the webhook for update delivery."""
412
402
 
413
- allowed_updates: Option[list[str]] = field(default=Nothing, converter=From[list[str] | None])
403
+ allowed_updates: Option[list[str]] = field(default=UNSET, converter=From[list[str] | None])
414
404
  """Optional. A list of update types the bot is subscribed to. Defaults to all
415
405
  update types except chat_member."""
416
406
 
@@ -433,51 +423,49 @@ class User(Model):
433
423
  first_name: str = field()
434
424
  """User's or bot's first name."""
435
425
 
436
- last_name: Option[str] = field(default=Nothing, converter=From[str | None])
426
+ last_name: Option[str] = field(default=UNSET, converter=From[str | None])
437
427
  """Optional. User's or bot's last name."""
438
428
 
439
- username: Option[str] = field(default=Nothing, converter=From[str | None])
429
+ username: Option[str] = field(default=UNSET, converter=From[str | None])
440
430
  """Optional. User's or bot's username."""
441
431
 
442
- language_code: Option[str] = field(default=Nothing, converter=From[str | None])
432
+ language_code: Option[str] = field(default=UNSET, converter=From[str | None])
443
433
  """Optional. IETF language tag of the user's language."""
444
434
 
445
- is_premium: Option[bool] = field(default=Nothing, converter=From[bool | None])
435
+ is_premium: Option[bool] = field(default=UNSET, converter=From[bool | None])
446
436
  """Optional. True, if this user is a Telegram Premium user."""
447
437
 
448
- added_to_attachment_menu: Option[bool] = field(default=Nothing, converter=From[bool | None])
438
+ added_to_attachment_menu: Option[bool] = field(default=UNSET, converter=From[bool | None])
449
439
  """Optional. True, if this user added the bot to the attachment menu."""
450
440
 
451
- can_join_groups: Option[bool] = field(default=Nothing, converter=From[bool | None])
441
+ can_join_groups: Option[bool] = field(default=UNSET, converter=From[bool | None])
452
442
  """Optional. True, if the bot can be invited to groups. Returned only in getMe."""
453
443
 
454
- can_read_all_group_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
444
+ can_read_all_group_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
455
445
  """Optional. True, if privacy mode is disabled for the bot. Returned only in
456
446
  getMe."""
457
447
 
458
- supports_inline_queries: Option[bool] = field(default=Nothing, converter=From[bool | None])
448
+ supports_inline_queries: Option[bool] = field(default=UNSET, converter=From[bool | None])
459
449
  """Optional. True, if the bot supports inline queries. Returned only in getMe."""
460
450
 
461
- can_connect_to_business: Option[bool] = field(default=Nothing, converter=From[bool | None])
451
+ can_connect_to_business: Option[bool] = field(default=UNSET, converter=From[bool | None])
462
452
  """Optional. True, if the bot can be connected to a Telegram Business account
463
453
  to receive its messages. Returned only in getMe."""
464
454
 
465
- has_main_web_app: Option[bool] = field(default=Nothing, converter=From[bool | None])
455
+ has_main_web_app: Option[bool] = field(default=UNSET, converter=From[bool | None])
466
456
  """Optional. True, if the bot has a main Web App. Returned only in getMe."""
467
457
 
468
- def __eq__(self, other: object) -> bool:
458
+ def __eq__(self, other: object, /) -> bool:
469
459
  return isinstance(other, self.__class__) and self.id == other.id
470
460
 
471
461
  @property
472
462
  def default_accent_color(self) -> DefaultAccentColor:
473
463
  """User's or bot's accent color (non-premium)."""
474
-
475
464
  return DefaultAccentColor(self.id % 7)
476
465
 
477
466
  @property
478
467
  def full_name(self) -> str:
479
468
  """User's or bot's full name (`first_name` + `last_name`)."""
480
-
481
469
  return self.first_name + self.last_name.map(lambda v: " " + v).unwrap_or("")
482
470
 
483
471
 
@@ -496,29 +484,29 @@ class Chat(Model):
496
484
  type: ChatType = field()
497
485
  """Type of the chat, can be either `private`, `group`, `supergroup` or `channel`."""
498
486
 
499
- title: Option[str] = field(default=Nothing, converter=From[str | None])
487
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
500
488
  """Optional. Title, for supergroups, channels and group chats."""
501
489
 
502
- username: Option[str] = field(default=Nothing, converter=From[str | None])
490
+ username: Option[str] = field(default=UNSET, converter=From[str | None])
503
491
  """Optional. Username, for private chats, supergroups and channels if available."""
504
492
 
505
- first_name: Option[str] = field(default=Nothing, converter=From[str | None])
493
+ first_name: Option[str] = field(default=UNSET, converter=From[str | None])
506
494
  """Optional. First name of the other party in a private chat."""
507
495
 
508
- last_name: Option[str] = field(default=Nothing, converter=From[str | None])
496
+ last_name: Option[str] = field(default=UNSET, converter=From[str | None])
509
497
  """Optional. Last name of the other party in a private chat."""
510
498
 
511
- is_forum: Option[bool] = field(default=Nothing, converter=From[bool | None])
499
+ is_forum: Option[bool] = field(default=UNSET, converter=From[bool | None])
512
500
  """Optional. True, if the supergroup chat is a forum (has topics enabled)."""
513
501
 
514
- def __eq__(self, other: object) -> bool:
502
+ def __eq__(self, other: object, /) -> bool:
515
503
  return isinstance(other, self.__class__) and self.id == other.id
516
504
 
517
505
  @property
518
506
  def full_name(self) -> Option[str]:
519
507
  """Optional. Full name (`first_name` + `last_name`) of the
520
- other party in a `private` chat."""
521
-
508
+ other party in a `private` chat.
509
+ """
522
510
  return self.first_name.map(lambda x: x + " " + self.last_name.unwrap_or(""))
523
511
 
524
512
 
@@ -544,153 +532,152 @@ class ChatFullInfo(Model):
544
532
  max_reaction_count: int = field()
545
533
  """The maximum number of reactions that can be set on a message in the chat."""
546
534
 
547
- title: Option[str] = field(default=Nothing, converter=From[str | None])
535
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
548
536
  """Optional. Title, for supergroups, channels and group chats."""
549
537
 
550
- username: Option[str] = field(default=Nothing, converter=From[str | None])
538
+ username: Option[str] = field(default=UNSET, converter=From[str | None])
551
539
  """Optional. Username, for private chats, supergroups and channels if available."""
552
540
 
553
- first_name: Option[str] = field(default=Nothing, converter=From[str | None])
541
+ first_name: Option[str] = field(default=UNSET, converter=From[str | None])
554
542
  """Optional. First name of the other party in a private chat."""
555
543
 
556
- last_name: Option[str] = field(default=Nothing, converter=From[str | None])
544
+ last_name: Option[str] = field(default=UNSET, converter=From[str | None])
557
545
  """Optional. Last name of the other party in a private chat."""
558
546
 
559
- is_forum: Option[bool] = field(default=Nothing, converter=From[bool | None])
547
+ is_forum: Option[bool] = field(default=UNSET, converter=From[bool | None])
560
548
  """Optional. True, if the supergroup chat is a forum (has topics enabled)."""
561
549
 
562
- photo: Option[ChatPhoto] = field(default=Nothing, converter=From["ChatPhoto | None"])
550
+ photo: Option[ChatPhoto] = field(default=UNSET, converter=From["ChatPhoto | None"])
563
551
  """Optional. Chat photo."""
564
552
 
565
- active_usernames: Option[list[str]] = field(default=Nothing, converter=From[list[str] | None])
553
+ active_usernames: Option[list[str]] = field(default=UNSET, converter=From[list[str] | None])
566
554
  """Optional. If non-empty, the list of all active chat usernames; for private
567
555
  chats, supergroups and channels."""
568
556
 
569
- birthdate: Option[Birthdate] = field(default=Nothing, converter=From["Birthdate | None"])
557
+ birthdate: Option[Birthdate] = field(default=UNSET, converter=From["Birthdate | None"])
570
558
  """Optional. For private chats, the date of birth of the user."""
571
559
 
572
- business_intro: Option[BusinessIntro] = field(default=Nothing, converter=From["BusinessIntro | None"])
560
+ business_intro: Option[BusinessIntro] = field(default=UNSET, converter=From["BusinessIntro | None"])
573
561
  """Optional. For private chats with business accounts, the intro of the business."""
574
562
 
575
- business_location: Option[BusinessLocation] = field(
576
- default=Nothing, converter=From["BusinessLocation | None"]
577
- )
563
+ business_location: Option[BusinessLocation] = field(default=UNSET, converter=From["BusinessLocation | None"])
578
564
  """Optional. For private chats with business accounts, the location of the
579
565
  business."""
580
566
 
581
567
  business_opening_hours: Option[BusinessOpeningHours] = field(
582
- default=Nothing, converter=From["BusinessOpeningHours | None"]
568
+ default=UNSET, converter=From["BusinessOpeningHours | None"]
583
569
  )
584
570
  """Optional. For private chats with business accounts, the opening hours
585
571
  of the business."""
586
572
 
587
- personal_chat: Option[Chat] = field(default=Nothing, converter=From["Chat | None"])
573
+ personal_chat: Option[Chat] = field(default=UNSET, converter=From["Chat | None"])
588
574
  """Optional. For private chats, the personal channel of the user."""
589
575
 
590
- available_reactions: Option[
591
- list[Variative[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]
592
- ] = field(
593
- default=Nothing,
594
- converter=From["list[ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid] | None"],
576
+ available_reactions: Option[list[Variative[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid]]] = (
577
+ field(
578
+ default=UNSET,
579
+ converter=From["list[ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid] | None"],
580
+ )
595
581
  )
596
582
  """Optional. List of available reactions allowed in the chat. If omitted,
597
583
  then all emoji reactions are allowed."""
598
584
 
599
- background_custom_emoji_id: Option[str] = field(default=Nothing, converter=From[str | None])
585
+ background_custom_emoji_id: Option[str] = field(default=UNSET, converter=From[str | None])
600
586
  """Optional. Custom emoji identifier of the emoji chosen by the chat for the
601
587
  reply header and link preview background."""
602
588
 
603
- profile_accent_color_id: Option[int] = field(default=Nothing, converter=From[int | None])
589
+ profile_accent_color_id: Option[int] = field(default=UNSET, converter=From[int | None])
604
590
  """Optional. Identifier of the accent color for the chat's profile background.
605
591
  See profile accent colors for more details."""
606
592
 
607
- profile_background_custom_emoji_id: Option[str] = field(default=Nothing, converter=From[str | None])
593
+ profile_background_custom_emoji_id: Option[str] = field(default=UNSET, converter=From[str | None])
608
594
  """Optional. Custom emoji identifier of the emoji chosen by the chat for its
609
595
  profile background."""
610
596
 
611
- emoji_status_custom_emoji_id: Option[str] = field(default=Nothing, converter=From[str | None])
597
+ emoji_status_custom_emoji_id: Option[str] = field(default=UNSET, converter=From[str | None])
612
598
  """Optional. Custom emoji identifier of the emoji status of the chat or the
613
599
  other party in a private chat."""
614
600
 
615
- emoji_status_expiration_date: Option[datetime] = field(default=Nothing, converter=From[datetime | None])
601
+ emoji_status_expiration_date: Option[datetime] = field(default=UNSET, converter=From[datetime | None])
616
602
  """Optional. Expiration date of the emoji status of the chat or the other party
617
603
  in a private chat, in Unix time, if any."""
618
604
 
619
- bio: Option[str] = field(default=Nothing, converter=From[str | None])
605
+ bio: Option[str] = field(default=UNSET, converter=From[str | None])
620
606
  """Optional. Bio of the other party in a private chat."""
621
607
 
622
- has_private_forwards: Option[bool] = field(default=Nothing, converter=From[bool | None])
608
+ has_private_forwards: Option[bool] = field(default=UNSET, converter=From[bool | None])
623
609
  """Optional. True, if privacy settings of the other party in the private chat
624
610
  allows to use tg://user?id=<user_id> links only in chats with the user."""
625
611
 
626
- has_restricted_voice_and_video_messages: Option[bool] = field(
627
- default=Nothing, converter=From[bool | None]
628
- )
612
+ has_restricted_voice_and_video_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
629
613
  """Optional. True, if the privacy settings of the other party restrict sending
630
614
  voice and video note messages in the private chat."""
631
615
 
632
- join_to_send_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
616
+ join_to_send_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
633
617
  """Optional. True, if users need to join the supergroup before they can send
634
618
  messages."""
635
619
 
636
- join_by_request: Option[bool] = field(default=Nothing, converter=From[bool | None])
620
+ join_by_request: Option[bool] = field(default=UNSET, converter=From[bool | None])
637
621
  """Optional. True, if all users directly joining the supergroup without using
638
622
  an invite link need to be approved by supergroup administrators."""
639
623
 
640
- description: Option[str] = field(default=Nothing, converter=From[str | None])
624
+ description: Option[str] = field(default=UNSET, converter=From[str | None])
641
625
  """Optional. Description, for groups, supergroups and channel chats."""
642
626
 
643
- invite_link: Option[str] = field(default=Nothing, converter=From[str | None])
627
+ invite_link: Option[str] = field(default=UNSET, converter=From[str | None])
644
628
  """Optional. Primary invite link, for groups, supergroups and channel chats."""
645
629
 
646
- pinned_message: Option[Message] = field(default=Nothing, converter=From["Message | None"])
630
+ pinned_message: Option[Message] = field(default=UNSET, converter=From["Message | None"])
647
631
  """Optional. The most recent pinned message (by sending date)."""
648
632
 
649
- permissions: Option[ChatPermissions] = field(default=Nothing, converter=From["ChatPermissions | None"])
633
+ permissions: Option[ChatPermissions] = field(default=UNSET, converter=From["ChatPermissions | None"])
650
634
  """Optional. Default chat member permissions, for groups and supergroups."""
651
635
 
652
- can_send_paid_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
636
+ can_send_gift: Option[bool] = field(default=UNSET, converter=From[bool | None])
637
+ """Optional. True, if gifts can be sent to the chat."""
638
+
639
+ can_send_paid_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
653
640
  """Optional. True, if paid media messages can be sent or forwarded to the channel
654
641
  chat. The field is available only for channel chats."""
655
642
 
656
- slow_mode_delay: Option[int] = field(default=Nothing, converter=From[int | None])
643
+ slow_mode_delay: Option[int] = field(default=UNSET, converter=From[int | None])
657
644
  """Optional. For supergroups, the minimum allowed delay between consecutive
658
645
  messages sent by each unprivileged user; in seconds."""
659
646
 
660
- unrestrict_boost_count: Option[int] = field(default=Nothing, converter=From[int | None])
647
+ unrestrict_boost_count: Option[int] = field(default=UNSET, converter=From[int | None])
661
648
  """Optional. For supergroups, the minimum number of boosts that a non-administrator
662
649
  user needs to add in order to ignore slow mode and chat permissions."""
663
650
 
664
- message_auto_delete_time: Option[int] = field(default=Nothing, converter=From[int | None])
651
+ message_auto_delete_time: Option[int] = field(default=UNSET, converter=From[int | None])
665
652
  """Optional. The time after which all messages sent to the chat will be automatically
666
653
  deleted; in seconds."""
667
654
 
668
- has_aggressive_anti_spam_enabled: Option[bool] = field(default=Nothing, converter=From[bool | None])
655
+ has_aggressive_anti_spam_enabled: Option[bool] = field(default=UNSET, converter=From[bool | None])
669
656
  """Optional. True, if aggressive anti-spam checks are enabled in the supergroup.
670
657
  The field is only available to chat administrators."""
671
658
 
672
- has_hidden_members: Option[bool] = field(default=Nothing, converter=From[bool | None])
659
+ has_hidden_members: Option[bool] = field(default=UNSET, converter=From[bool | None])
673
660
  """Optional. True, if non-administrators can only get the list of bots and
674
661
  administrators in the chat."""
675
662
 
676
- has_protected_content: Option[bool] = field(default=Nothing, converter=From[bool | None])
663
+ has_protected_content: Option[bool] = field(default=UNSET, converter=From[bool | None])
677
664
  """Optional. True, if messages from the chat can't be forwarded to other chats."""
678
665
 
679
- has_visible_history: Option[bool] = field(default=Nothing, converter=From[bool | None])
666
+ has_visible_history: Option[bool] = field(default=UNSET, converter=From[bool | None])
680
667
  """Optional. True, if new chat members will have access to old messages; available
681
668
  only to chat administrators."""
682
669
 
683
- sticker_set_name: Option[str] = field(default=Nothing, converter=From[str | None])
670
+ sticker_set_name: Option[str] = field(default=UNSET, converter=From[str | None])
684
671
  """Optional. For supergroups, name of the group sticker set."""
685
672
 
686
- can_set_sticker_set: Option[bool] = field(default=Nothing, converter=From[bool | None])
673
+ can_set_sticker_set: Option[bool] = field(default=UNSET, converter=From[bool | None])
687
674
  """Optional. True, if the bot can change the group sticker set."""
688
675
 
689
- custom_emoji_sticker_set_name: Option[str] = field(default=Nothing, converter=From[str | None])
676
+ custom_emoji_sticker_set_name: Option[str] = field(default=UNSET, converter=From[str | None])
690
677
  """Optional. For supergroups, the name of the group's custom emoji sticker
691
678
  set. Custom emoji from this set can be used by all users and bots in the group."""
692
679
 
693
- linked_chat_id: Option[int] = field(default=Nothing, converter=From[int | None])
680
+ linked_chat_id: Option[int] = field(default=UNSET, converter=From[int | None])
694
681
  """Optional. Unique identifier for the linked chat, i.e. the discussion group
695
682
  identifier for a channel and vice versa; for supergroups and channel chats.
696
683
  This identifier may be greater than 32 bits and some programming languages
@@ -698,7 +685,7 @@ class ChatFullInfo(Model):
698
685
  than 52 bits, so a signed 64 bit integer or double-precision float type are
699
686
  safe for storing this identifier."""
700
687
 
701
- location: Option[ChatLocation] = field(default=Nothing, converter=From["ChatLocation | None"])
688
+ location: Option[ChatLocation] = field(default=UNSET, converter=From["ChatLocation | None"])
702
689
  """Optional. For supergroups, the location to which the supergroup is connected."""
703
690
 
704
691
 
@@ -709,7 +696,11 @@ class Message(MaybeInaccessibleMessage):
709
696
  """
710
697
 
711
698
  message_id: int = field()
712
- """Unique message identifier inside this chat."""
699
+ """Unique message identifier inside this chat. In specific instances (e.g.,
700
+ message containing a video sent to a big chat), the server might automatically
701
+ schedule a message instead of sending it immediately. In such cases, this
702
+ field will be 0 and the relevant message will be unusable until it is actually
703
+ sent."""
713
704
 
714
705
  date: datetime = field()
715
706
  """Date the message was sent in Unix time. It is always a positive number, representing
@@ -718,16 +709,16 @@ class Message(MaybeInaccessibleMessage):
718
709
  chat: Chat = field()
719
710
  """Chat the message belongs to."""
720
711
 
721
- message_thread_id: Option[int] = field(default=Nothing, converter=From[int | None])
712
+ message_thread_id: Option[int] = field(default=UNSET, converter=From[int | None])
722
713
  """Optional. Unique identifier of a message thread to which the message belongs;
723
714
  for supergroups only."""
724
715
 
725
- from_: Option[User] = field(default=Nothing, converter=From["User | None"])
716
+ from_: Option[User] = field(default=UNSET, converter=From["User | None"])
726
717
  """Optional. Sender of the message; may be empty for messages sent to channels.
727
718
  For backward compatibility, if the message was sent on behalf of a chat,
728
719
  the field contains a fake sender user in non-channel chats."""
729
720
 
730
- sender_chat: Option[Chat] = field(default=Nothing, converter=From["Chat | None"])
721
+ sender_chat: Option[Chat] = field(default=UNSET, converter=From["Chat | None"])
731
722
  """Optional. Sender of the message when sent on behalf of a chat. For example,
732
723
  the supergroup itself for messages sent by its anonymous administrators
733
724
  or a linked channel for messages automatically forwarded to the channel's
@@ -735,16 +726,16 @@ class Message(MaybeInaccessibleMessage):
735
726
  on behalf of a chat, the field from contains a fake sender user in non-channel
736
727
  chats."""
737
728
 
738
- sender_boost_count: Option[int] = field(default=Nothing, converter=From[int | None])
729
+ sender_boost_count: Option[int] = field(default=UNSET, converter=From[int | None])
739
730
  """Optional. If the sender of the message boosted the chat, the number of boosts
740
731
  added by the user."""
741
732
 
742
- sender_business_bot: Option[User] = field(default=Nothing, converter=From["User | None"])
733
+ sender_business_bot: Option[User] = field(default=UNSET, converter=From["User | None"])
743
734
  """Optional. The bot that actually sent the message on behalf of the business
744
735
  account. Available only for outgoing messages sent on behalf of the connected
745
736
  business account."""
746
737
 
747
- business_connection_id: Option[str] = field(default=Nothing, converter=From[str | None])
738
+ business_connection_id: Option[str] = field(default=UNSET, converter=From[str | None])
748
739
  """Optional. Unique identifier of the business connection from which the
749
740
  message was received. If non-empty, the message belongs to a chat of the
750
741
  corresponding business account that is independent from any potential
@@ -753,191 +744,187 @@ class Message(MaybeInaccessibleMessage):
753
744
  forward_origin: Option[
754
745
  Variative[MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel]
755
746
  ] = field(
756
- default=Nothing,
747
+ default=UNSET,
757
748
  converter=From[
758
749
  "MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel | None"
759
750
  ],
760
751
  )
761
752
  """Optional. Information about the original message for forwarded messages."""
762
753
 
763
- is_topic_message: Option[bool] = field(default=Nothing, converter=From[bool | None])
754
+ is_topic_message: Option[bool] = field(default=UNSET, converter=From[bool | None])
764
755
  """Optional. True, if the message is sent to a forum topic."""
765
756
 
766
- is_automatic_forward: Option[bool] = field(default=Nothing, converter=From[bool | None])
757
+ is_automatic_forward: Option[bool] = field(default=UNSET, converter=From[bool | None])
767
758
  """Optional. True, if the message is a channel post that was automatically
768
759
  forwarded to the connected discussion group."""
769
760
 
770
- reply_to_message: Option[Message] = field(default=Nothing, converter=From["Message | None"])
761
+ reply_to_message: Option[Message] = field(default=UNSET, converter=From["Message | None"])
771
762
  """Optional. For replies in the same chat and message thread, the original
772
763
  message. Note that the Message object in this field will not contain further
773
764
  reply_to_message fields even if it itself is a reply."""
774
765
 
775
- external_reply: Option[ExternalReplyInfo] = field(
776
- default=Nothing, converter=From["ExternalReplyInfo | None"]
777
- )
766
+ external_reply: Option[ExternalReplyInfo] = field(default=UNSET, converter=From["ExternalReplyInfo | None"])
778
767
  """Optional. Information about the message that is being replied to, which
779
768
  may come from another chat or forum topic."""
780
769
 
781
- quote: Option[TextQuote] = field(default=Nothing, converter=From["TextQuote | None"])
770
+ quote: Option[TextQuote] = field(default=UNSET, converter=From["TextQuote | None"])
782
771
  """Optional. For replies that quote part of the original message, the quoted
783
772
  part of the message."""
784
773
 
785
- reply_to_story: Option[Story] = field(default=Nothing, converter=From["Story | None"])
774
+ reply_to_story: Option[Story] = field(default=UNSET, converter=From["Story | None"])
786
775
  """Optional. For replies to a story, the original story."""
787
776
 
788
- via_bot: Option[User] = field(default=Nothing, converter=From["User | None"])
777
+ via_bot: Option[User] = field(default=UNSET, converter=From["User | None"])
789
778
  """Optional. Bot through which the message was sent."""
790
779
 
791
- edit_date: Option[datetime] = field(default=Nothing, converter=From[datetime | None])
780
+ edit_date: Option[datetime] = field(default=UNSET, converter=From[datetime | None])
792
781
  """Optional. Date the message was last edited in Unix time."""
793
782
 
794
- has_protected_content: Option[bool] = field(default=Nothing, converter=From[bool | None])
783
+ has_protected_content: Option[bool] = field(default=UNSET, converter=From[bool | None])
795
784
  """Optional. True, if the message can't be forwarded."""
796
785
 
797
- is_from_offline: Option[bool] = field(default=Nothing, converter=From[bool | None])
786
+ is_from_offline: Option[bool] = field(default=UNSET, converter=From[bool | None])
798
787
  """Optional. True, if the message was sent by an implicit action, for example,
799
788
  as an away or a greeting business message, or as a scheduled message."""
800
789
 
801
- media_group_id: Option[str] = field(default=Nothing, converter=From[str | None])
790
+ media_group_id: Option[str] = field(default=UNSET, converter=From[str | None])
802
791
  """Optional. The unique identifier of a media message group this message belongs
803
792
  to."""
804
793
 
805
- author_signature: Option[str] = field(default=Nothing, converter=From[str | None])
794
+ author_signature: Option[str] = field(default=UNSET, converter=From[str | None])
806
795
  """Optional. Signature of the post author for messages in channels, or the
807
796
  custom title of an anonymous group administrator."""
808
797
 
809
- text: Option[str] = field(default=Nothing, converter=From[str | None])
798
+ text: Option[str] = field(default=UNSET, converter=From[str | None])
810
799
  """Optional. For text messages, the actual UTF-8 text of the message."""
811
800
 
812
- entities: Option[list[MessageEntity]] = field(
813
- default=Nothing, converter=From["list[MessageEntity] | None"]
814
- )
801
+ entities: Option[list[MessageEntity]] = field(default=UNSET, converter=From["list[MessageEntity] | None"])
815
802
  """Optional. For text messages, special entities like usernames, URLs, bot
816
803
  commands, etc. that appear in the text."""
817
804
 
818
805
  link_preview_options: Option[LinkPreviewOptions] = field(
819
- default=Nothing, converter=From["LinkPreviewOptions | None"]
806
+ default=UNSET, converter=From["LinkPreviewOptions | None"]
820
807
  )
821
808
  """Optional. Options used for link preview generation for the message, if
822
809
  it is a text message and link preview options were changed."""
823
810
 
824
- effect_id: Option[str] = field(default=Nothing, converter=From[str | None])
811
+ effect_id: Option[str] = field(default=UNSET, converter=From[str | None])
825
812
  """Optional. Unique identifier of the message effect added to the message."""
826
813
 
827
- animation: Option[Animation] = field(default=Nothing, converter=From["Animation | None"])
814
+ animation: Option[Animation] = field(default=UNSET, converter=From["Animation | None"])
828
815
  """Optional. Message is an animation, information about the animation. For
829
816
  backward compatibility, when this field is set, the document field will
830
817
  also be set."""
831
818
 
832
- audio: Option[Audio] = field(default=Nothing, converter=From["Audio | None"])
819
+ audio: Option[Audio] = field(default=UNSET, converter=From["Audio | None"])
833
820
  """Optional. Message is an audio file, information about the file."""
834
821
 
835
- document: Option[Document] = field(default=Nothing, converter=From["Document | None"])
822
+ document: Option[Document] = field(default=UNSET, converter=From["Document | None"])
836
823
  """Optional. Message is a general file, information about the file."""
837
824
 
838
- paid_media: Option[PaidMediaInfo] = field(default=Nothing, converter=From["PaidMediaInfo | None"])
825
+ paid_media: Option[PaidMediaInfo] = field(default=UNSET, converter=From["PaidMediaInfo | None"])
839
826
  """Optional. Message contains paid media; information about the paid media."""
840
827
 
841
- photo: Option[list[PhotoSize]] = field(default=Nothing, converter=From["list[PhotoSize] | None"])
828
+ photo: Option[list[PhotoSize]] = field(default=UNSET, converter=From["list[PhotoSize] | None"])
842
829
  """Optional. Message is a photo, available sizes of the photo."""
843
830
 
844
- sticker: Option[Sticker] = field(default=Nothing, converter=From["Sticker | None"])
831
+ sticker: Option[Sticker] = field(default=UNSET, converter=From["Sticker | None"])
845
832
  """Optional. Message is a sticker, information about the sticker."""
846
833
 
847
- story: Option[Story] = field(default=Nothing, converter=From["Story | None"])
834
+ story: Option[Story] = field(default=UNSET, converter=From["Story | None"])
848
835
  """Optional. Message is a forwarded story."""
849
836
 
850
- video: Option[Video] = field(default=Nothing, converter=From["Video | None"])
837
+ video: Option[Video] = field(default=UNSET, converter=From["Video | None"])
851
838
  """Optional. Message is a video, information about the video."""
852
839
 
853
- video_note: Option[VideoNote] = field(default=Nothing, converter=From["VideoNote | None"])
840
+ video_note: Option[VideoNote] = field(default=UNSET, converter=From["VideoNote | None"])
854
841
  """Optional. Message is a video note, information about the video message."""
855
842
 
856
- voice: Option[Voice] = field(default=Nothing, converter=From["Voice | None"])
843
+ voice: Option[Voice] = field(default=UNSET, converter=From["Voice | None"])
857
844
  """Optional. Message is a voice message, information about the file."""
858
845
 
859
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
846
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
860
847
  """Optional. Caption for the animation, audio, document, paid media, photo,
861
848
  video or voice."""
862
849
 
863
850
  caption_entities: Option[list[MessageEntity]] = field(
864
- default=Nothing, converter=From["list[MessageEntity] | None"]
851
+ default=UNSET, converter=From["list[MessageEntity] | None"]
865
852
  )
866
853
  """Optional. For messages with a caption, special entities like usernames,
867
854
  URLs, bot commands, etc. that appear in the caption."""
868
855
 
869
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
856
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
870
857
  """Optional. True, if the caption must be shown above the message media."""
871
858
 
872
- has_media_spoiler: Option[bool] = field(default=Nothing, converter=From[bool | None])
859
+ has_media_spoiler: Option[bool] = field(default=UNSET, converter=From[bool | None])
873
860
  """Optional. True, if the message media is covered by a spoiler animation."""
874
861
 
875
- contact: Option[Contact] = field(default=Nothing, converter=From["Contact | None"])
862
+ contact: Option[Contact] = field(default=UNSET, converter=From["Contact | None"])
876
863
  """Optional. Message is a shared contact, information about the contact."""
877
864
 
878
- dice: Option[Dice] = field(default=Nothing, converter=From["Dice | None"])
865
+ dice: Option[Dice] = field(default=UNSET, converter=From["Dice | None"])
879
866
  """Optional. Message is a dice with random value."""
880
867
 
881
- game: Option[Game] = field(default=Nothing, converter=From["Game | None"])
868
+ game: Option[Game] = field(default=UNSET, converter=From["Game | None"])
882
869
  """Optional. Message is a game, information about the game. More about games:
883
870
  https://core.telegram.org/bots/api#games."""
884
871
 
885
- poll: Option[Poll] = field(default=Nothing, converter=From["Poll | None"])
872
+ poll: Option[Poll] = field(default=UNSET, converter=From["Poll | None"])
886
873
  """Optional. Message is a native poll, information about the poll."""
887
874
 
888
- venue: Option[Venue] = field(default=Nothing, converter=From["Venue | None"])
875
+ venue: Option[Venue] = field(default=UNSET, converter=From["Venue | None"])
889
876
  """Optional. Message is a venue, information about the venue. For backward
890
877
  compatibility, when this field is set, the location field will also be set."""
891
878
 
892
- location: Option[Location] = field(default=Nothing, converter=From["Location | None"])
879
+ location: Option[Location] = field(default=UNSET, converter=From["Location | None"])
893
880
  """Optional. Message is a shared location, information about the location."""
894
881
 
895
- new_chat_members: Option[list[User]] = field(default=Nothing, converter=From["list[User] | None"])
882
+ new_chat_members: Option[list[User]] = field(default=UNSET, converter=From["list[User] | None"])
896
883
  """Optional. New members that were added to the group or supergroup and information
897
884
  about them (the bot itself may be one of these members)."""
898
885
 
899
- left_chat_member: Option[User] = field(default=Nothing, converter=From["User | None"])
886
+ left_chat_member: Option[User] = field(default=UNSET, converter=From["User | None"])
900
887
  """Optional. A member was removed from the group, information about them (this
901
888
  member may be the bot itself)."""
902
889
 
903
- new_chat_title: Option[str] = field(default=Nothing, converter=From[str | None])
890
+ new_chat_title: Option[str] = field(default=UNSET, converter=From[str | None])
904
891
  """Optional. A chat title was changed to this value."""
905
892
 
906
- new_chat_photo: Option[list[PhotoSize]] = field(default=Nothing, converter=From["list[PhotoSize] | None"])
893
+ new_chat_photo: Option[list[PhotoSize]] = field(default=UNSET, converter=From["list[PhotoSize] | None"])
907
894
  """Optional. A chat photo was change to this value."""
908
895
 
909
- delete_chat_photo: Option[bool] = field(default=Nothing, converter=From[bool | None])
896
+ delete_chat_photo: Option[bool] = field(default=UNSET, converter=From[bool | None])
910
897
  """Optional. Service message: the chat photo was deleted."""
911
898
 
912
- group_chat_created: Option[bool] = field(default=Nothing, converter=From[bool | None])
899
+ group_chat_created: Option[bool] = field(default=UNSET, converter=From[bool | None])
913
900
  """Optional. Service message: the group has been created."""
914
901
 
915
- supergroup_chat_created: Option[bool] = field(default=Nothing, converter=From[bool | None])
902
+ supergroup_chat_created: Option[bool] = field(default=UNSET, converter=From[bool | None])
916
903
  """Optional. Service message: the supergroup has been created. This field
917
904
  can't be received in a message coming through updates, because bot can't
918
905
  be a member of a supergroup when it is created. It can only be found in reply_to_message
919
906
  if someone replies to a very first message in a directly created supergroup."""
920
907
 
921
- channel_chat_created: Option[bool] = field(default=Nothing, converter=From[bool | None])
908
+ channel_chat_created: Option[bool] = field(default=UNSET, converter=From[bool | None])
922
909
  """Optional. Service message: the channel has been created. This field can't
923
910
  be received in a message coming through updates, because bot can't be a member
924
911
  of a channel when it is created. It can only be found in reply_to_message
925
912
  if someone replies to a very first message in a channel."""
926
913
 
927
914
  message_auto_delete_timer_changed: Option[MessageAutoDeleteTimerChanged] = field(
928
- default=Nothing, converter=From["MessageAutoDeleteTimerChanged | None"]
915
+ default=UNSET, converter=From["MessageAutoDeleteTimerChanged | None"]
929
916
  )
930
917
  """Optional. Service message: auto-delete timer settings changed in the
931
918
  chat."""
932
919
 
933
- migrate_to_chat_id: Option[int] = field(default=Nothing, converter=From[int | None])
920
+ migrate_to_chat_id: Option[int] = field(default=UNSET, converter=From[int | None])
934
921
  """Optional. The group has been migrated to a supergroup with the specified
935
922
  identifier. This number may have more than 32 significant bits and some
936
923
  programming languages may have difficulty/silent defects in interpreting
937
924
  it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision
938
925
  float type are safe for storing this identifier."""
939
926
 
940
- migrate_from_chat_id: Option[int] = field(default=Nothing, converter=From[int | None])
927
+ migrate_from_chat_id: Option[int] = field(default=UNSET, converter=From[int | None])
941
928
  """Optional. The supergroup has been migrated from a group with the specified
942
929
  identifier. This number may have more than 32 significant bits and some
943
930
  programming languages may have difficulty/silent defects in interpreting
@@ -945,138 +932,124 @@ class Message(MaybeInaccessibleMessage):
945
932
  float type are safe for storing this identifier."""
946
933
 
947
934
  pinned_message: Option[Variative[Message, InaccessibleMessage]] = field(
948
- default=Nothing, converter=From["Message | InaccessibleMessage | None"]
935
+ default=UNSET, converter=From["Message | InaccessibleMessage | None"]
949
936
  )
950
937
  """Optional. Specified message was pinned. Note that the Message object in
951
938
  this field will not contain further reply_to_message fields even if it
952
939
  itself is a reply."""
953
940
 
954
- invoice: Option[Invoice] = field(default=Nothing, converter=From["Invoice | None"])
941
+ invoice: Option[Invoice] = field(default=UNSET, converter=From["Invoice | None"])
955
942
  """Optional. Message is an invoice for a payment, information about the invoice.
956
943
  More about payments: https://core.telegram.org/bots/api#payments."""
957
944
 
958
945
  successful_payment: Option[SuccessfulPayment] = field(
959
- default=Nothing, converter=From["SuccessfulPayment | None"]
946
+ default=UNSET, converter=From["SuccessfulPayment | None"]
960
947
  )
961
948
  """Optional. Message is a service message about a successful payment, information
962
949
  about the payment. More about payments: https://core.telegram.org/bots/api#payments."""
963
950
 
964
- refunded_payment: Option[RefundedPayment] = field(
965
- default=Nothing, converter=From["RefundedPayment | None"]
966
- )
951
+ refunded_payment: Option[RefundedPayment] = field(default=UNSET, converter=From["RefundedPayment | None"])
967
952
  """Optional. Message is a service message about a refunded payment, information
968
953
  about the payment. More about payments: https://core.telegram.org/bots/api#payments."""
969
954
 
970
- users_shared: Option[UsersShared] = field(default=Nothing, converter=From["UsersShared | None"])
955
+ users_shared: Option[UsersShared] = field(default=UNSET, converter=From["UsersShared | None"])
971
956
  """Optional. Service message: users were shared with the bot."""
972
957
 
973
- chat_shared: Option[ChatShared] = field(default=Nothing, converter=From["ChatShared | None"])
958
+ chat_shared: Option[ChatShared] = field(default=UNSET, converter=From["ChatShared | None"])
974
959
  """Optional. Service message: a chat was shared with the bot."""
975
960
 
976
- connected_website: Option[str] = field(default=Nothing, converter=From[str | None])
961
+ connected_website: Option[str] = field(default=UNSET, converter=From[str | None])
977
962
  """Optional. The domain name of the website on which the user has logged in.
978
963
  More about Telegram Login: https://core.telegram.org/widgets/login."""
979
964
 
980
965
  write_access_allowed: Option[WriteAccessAllowed] = field(
981
- default=Nothing, converter=From["WriteAccessAllowed | None"]
966
+ default=UNSET, converter=From["WriteAccessAllowed | None"]
982
967
  )
983
968
  """Optional. Service message: the user allowed the bot to write messages after
984
969
  adding it to the attachment or side menu, launching a Web App from a link,
985
970
  or accepting an explicit request from a Web App sent by the method requestWriteAccess."""
986
971
 
987
- passport_data: Option[PassportData] = field(default=Nothing, converter=From["PassportData | None"])
972
+ passport_data: Option[PassportData] = field(default=UNSET, converter=From["PassportData | None"])
988
973
  """Optional. Telegram Passport data."""
989
974
 
990
975
  proximity_alert_triggered: Option[ProximityAlertTriggered] = field(
991
- default=Nothing, converter=From["ProximityAlertTriggered | None"]
976
+ default=UNSET, converter=From["ProximityAlertTriggered | None"]
992
977
  )
993
978
  """Optional. Service message. A user in the chat triggered another user's
994
979
  proximity alert while sharing Live Location."""
995
980
 
996
- boost_added: Option[ChatBoostAdded] = field(default=Nothing, converter=From["ChatBoostAdded | None"])
981
+ boost_added: Option[ChatBoostAdded] = field(default=UNSET, converter=From["ChatBoostAdded | None"])
997
982
  """Optional. Service message: user boosted the chat."""
998
983
 
999
- chat_background_set: Option[ChatBackground] = field(
1000
- default=Nothing, converter=From["ChatBackground | None"]
1001
- )
984
+ chat_background_set: Option[ChatBackground] = field(default=UNSET, converter=From["ChatBackground | None"])
1002
985
  """Optional. Service message: chat background set."""
1003
986
 
1004
987
  forum_topic_created: Option[ForumTopicCreated] = field(
1005
- default=Nothing, converter=From["ForumTopicCreated | None"]
988
+ default=UNSET, converter=From["ForumTopicCreated | None"]
1006
989
  )
1007
990
  """Optional. Service message: forum topic created."""
1008
991
 
1009
- forum_topic_edited: Option[ForumTopicEdited] = field(
1010
- default=Nothing, converter=From["ForumTopicEdited | None"]
1011
- )
992
+ forum_topic_edited: Option[ForumTopicEdited] = field(default=UNSET, converter=From["ForumTopicEdited | None"])
1012
993
  """Optional. Service message: forum topic edited."""
1013
994
 
1014
- forum_topic_closed: Option[ForumTopicClosed] = field(
1015
- default=Nothing, converter=From["ForumTopicClosed | None"]
1016
- )
995
+ forum_topic_closed: Option[ForumTopicClosed] = field(default=UNSET, converter=From["ForumTopicClosed | None"])
1017
996
  """Optional. Service message: forum topic closed."""
1018
997
 
1019
998
  forum_topic_reopened: Option[ForumTopicReopened] = field(
1020
- default=Nothing, converter=From["ForumTopicReopened | None"]
999
+ default=UNSET, converter=From["ForumTopicReopened | None"]
1021
1000
  )
1022
1001
  """Optional. Service message: forum topic reopened."""
1023
1002
 
1024
1003
  general_forum_topic_hidden: Option[GeneralForumTopicHidden] = field(
1025
- default=Nothing, converter=From["GeneralForumTopicHidden | None"]
1004
+ default=UNSET, converter=From["GeneralForumTopicHidden | None"]
1026
1005
  )
1027
1006
  """Optional. Service message: the 'General' forum topic hidden."""
1028
1007
 
1029
1008
  general_forum_topic_unhidden: Option[GeneralForumTopicUnhidden] = field(
1030
- default=Nothing, converter=From["GeneralForumTopicUnhidden | None"]
1009
+ default=UNSET, converter=From["GeneralForumTopicUnhidden | None"]
1031
1010
  )
1032
1011
  """Optional. Service message: the 'General' forum topic unhidden."""
1033
1012
 
1034
- giveaway_created: Option[GiveawayCreated] = field(
1035
- default=Nothing, converter=From["GiveawayCreated | None"]
1036
- )
1013
+ giveaway_created: Option[GiveawayCreated] = field(default=UNSET, converter=From["GiveawayCreated | None"])
1037
1014
  """Optional. Service message: a scheduled giveaway was created."""
1038
1015
 
1039
- giveaway: Option[Giveaway] = field(default=Nothing, converter=From["Giveaway | None"])
1016
+ giveaway: Option[Giveaway] = field(default=UNSET, converter=From["Giveaway | None"])
1040
1017
  """Optional. The message is a scheduled giveaway message."""
1041
1018
 
1042
- giveaway_winners: Option[GiveawayWinners] = field(
1043
- default=Nothing, converter=From["GiveawayWinners | None"]
1044
- )
1019
+ giveaway_winners: Option[GiveawayWinners] = field(default=UNSET, converter=From["GiveawayWinners | None"])
1045
1020
  """Optional. A giveaway with public winners was completed."""
1046
1021
 
1047
1022
  giveaway_completed: Option[GiveawayCompleted] = field(
1048
- default=Nothing, converter=From["GiveawayCompleted | None"]
1023
+ default=UNSET, converter=From["GiveawayCompleted | None"]
1049
1024
  )
1050
1025
  """Optional. Service message: a giveaway without public winners was completed."""
1051
1026
 
1052
1027
  video_chat_scheduled: Option[VideoChatScheduled] = field(
1053
- default=Nothing, converter=From["VideoChatScheduled | None"]
1028
+ default=UNSET, converter=From["VideoChatScheduled | None"]
1054
1029
  )
1055
1030
  """Optional. Service message: video chat scheduled."""
1056
1031
 
1057
- video_chat_started: Option[VideoChatStarted] = field(
1058
- default=Nothing, converter=From["VideoChatStarted | None"]
1059
- )
1032
+ video_chat_started: Option[VideoChatStarted] = field(default=UNSET, converter=From["VideoChatStarted | None"])
1060
1033
  """Optional. Service message: video chat started."""
1061
1034
 
1062
- video_chat_ended: Option[VideoChatEnded] = field(default=Nothing, converter=From["VideoChatEnded | None"])
1035
+ video_chat_ended: Option[VideoChatEnded] = field(default=UNSET, converter=From["VideoChatEnded | None"])
1063
1036
  """Optional. Service message: video chat ended."""
1064
1037
 
1065
1038
  video_chat_participants_invited: Option[VideoChatParticipantsInvited] = field(
1066
- default=Nothing, converter=From["VideoChatParticipantsInvited | None"]
1039
+ default=UNSET, converter=From["VideoChatParticipantsInvited | None"]
1067
1040
  )
1068
1041
  """Optional. Service message: new participants invited to a video chat."""
1069
1042
 
1070
- web_app_data: Option[WebAppData] = field(default=Nothing, converter=From["WebAppData | None"])
1043
+ web_app_data: Option[WebAppData] = field(default=UNSET, converter=From["WebAppData | None"])
1071
1044
  """Optional. Service message: data sent by a Web App."""
1072
1045
 
1073
1046
  reply_markup: Option[InlineKeyboardMarkup] = field(
1074
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
1047
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
1075
1048
  )
1076
1049
  """Optional. Inline keyboard attached to the message. login_url buttons
1077
1050
  are represented as ordinary url buttons."""
1078
1051
 
1079
- def __eq__(self, other: object) -> bool:
1052
+ def __eq__(self, other: object, /) -> bool:
1080
1053
  return (
1081
1054
  isinstance(other, self.__class__)
1082
1055
  and self.message_id == other.message_id
@@ -1086,11 +1059,10 @@ class Message(MaybeInaccessibleMessage):
1086
1059
  @cached_property
1087
1060
  def content_type(self) -> ContentType:
1088
1061
  """Type of content that the message contains."""
1089
-
1090
1062
  for content in ContentType:
1091
- if (
1092
- content.value in self.__struct_fields__
1093
- and getattr(self, content.value, Nothing) is not Nothing
1063
+ if content.value in self.__struct_fields__ and not isinstance(
1064
+ getattr(self, content.value, Nothing()),
1065
+ Nothing,
1094
1066
  ):
1095
1067
  return content
1096
1068
  return ContentType.UNKNOWN
@@ -1098,23 +1070,19 @@ class Message(MaybeInaccessibleMessage):
1098
1070
  @property
1099
1071
  def from_user(self) -> "User":
1100
1072
  """`from_user` instead of `from_.unwrap()`."""
1101
-
1102
1073
  return self.from_.unwrap()
1103
1074
 
1104
1075
  @property
1105
1076
  def chat_id(self) -> int:
1106
1077
  """`chat_id` instead of `chat.id`."""
1107
-
1108
1078
  return self.chat.id
1109
1079
 
1110
1080
  @property
1111
1081
  def chat_title(self) -> str:
1112
1082
  """Chat title, for `supergroups`, `channels` and `group` chats.
1113
- Full name, for `private` chat."""
1114
-
1115
- return (
1116
- self.chat.full_name.unwrap() if self.chat.type == ChatType.PRIVATE else self.chat.title.unwrap()
1117
- )
1083
+ Full name, for `private` chat.
1084
+ """
1085
+ return self.chat.full_name.unwrap() if self.chat.type == ChatType.PRIVATE else self.chat.title.unwrap()
1118
1086
 
1119
1087
 
1120
1088
  class MessageId(Model):
@@ -1124,7 +1092,10 @@ class MessageId(Model):
1124
1092
  """
1125
1093
 
1126
1094
  message_id: int = field()
1127
- """Unique message identifier."""
1095
+ """Unique message identifier. In specific instances (e.g., message containing
1096
+ a video sent to a big chat), the server might automatically schedule a message
1097
+ instead of sending it immediately. In such cases, this field will be 0 and
1098
+ the relevant message will be unusable until it is actually sent."""
1128
1099
 
1129
1100
 
1130
1101
  class InaccessibleMessage(MaybeInaccessibleMessage):
@@ -1139,7 +1110,7 @@ class InaccessibleMessage(MaybeInaccessibleMessage):
1139
1110
  message_id: int = field()
1140
1111
  """Unique message identifier inside the chat."""
1141
1112
 
1142
- date: typing.Literal[0]
1113
+ date: typing.Literal[0] = field(default=0)
1143
1114
  """Always 0. The field can be used to differentiate regular and inaccessible
1144
1115
  messages."""
1145
1116
 
@@ -1152,15 +1123,15 @@ class MessageEntity(Model):
1152
1123
 
1153
1124
  type: MessageEntityType = field()
1154
1125
  """Type of the entity. Currently, can be `mention` (@username), `hashtag`
1155
- (#hashtag), `cashtag` ($USD), `bot_command` (/start@jobs_bot), `url`
1156
- (https://telegram.org), `email` (do-not-reply@telegram.org), `phone_number`
1157
- (+1-212-555-0123), `bold` (bold text), `italic` (italic text), `underline`
1158
- (underlined text), `strikethrough` (strikethrough text), `spoiler`
1159
- (spoiler message), `blockquote` (block quotation), `expandable_blockquote`
1160
- (collapsed-by-default block quotation), `code` (monowidth string),
1161
- `pre` (monowidth block), `text_link` (for clickable text URLs), `text_mention`
1162
- (for users without usernames), `custom_emoji` (for inline custom emoji
1163
- stickers)."""
1126
+ (#hashtag or #hashtag@chatusername), `cashtag` ($USD or $USD@chatusername),
1127
+ `bot_command` (/start@jobs_bot), `url` (https://telegram.org), `email`
1128
+ (do-not-reply@telegram.org), `phone_number` (+1-212-555-0123),
1129
+ `bold` (bold text), `italic` (italic text), `underline` (underlined
1130
+ text), `strikethrough` (strikethrough text), `spoiler` (spoiler message),
1131
+ `blockquote` (block quotation), `expandable_blockquote` (collapsed-by-default
1132
+ block quotation), `code` (monowidth string), `pre` (monowidth block),
1133
+ `text_link` (for clickable text URLs), `text_mention` (for users without
1134
+ usernames), `custom_emoji` (for inline custom emoji stickers)."""
1164
1135
 
1165
1136
  offset: int = field()
1166
1137
  """Offset in UTF-16 code units to the start of the entity."""
@@ -1168,17 +1139,17 @@ class MessageEntity(Model):
1168
1139
  length: int = field()
1169
1140
  """Length of the entity in UTF-16 code units."""
1170
1141
 
1171
- url: Option[str] = field(default=Nothing, converter=From[str | None])
1142
+ url: Option[str] = field(default=UNSET, converter=From[str | None])
1172
1143
  """Optional. For `text_link` only, URL that will be opened after user taps
1173
1144
  on the text."""
1174
1145
 
1175
- user: Option[User] = field(default=Nothing, converter=From["User | None"])
1146
+ user: Option[User] = field(default=UNSET, converter=From["User | None"])
1176
1147
  """Optional. For `text_mention` only, the mentioned user."""
1177
1148
 
1178
- language: Option[str] = field(default=Nothing, converter=From[str | None])
1149
+ language: Option[str] = field(default=UNSET, converter=From[str | None])
1179
1150
  """Optional. For `pre` only, the programming language of the entity text."""
1180
1151
 
1181
- custom_emoji_id: Option[str] = field(default=Nothing, converter=From[str | None])
1152
+ custom_emoji_id: Option[str] = field(default=UNSET, converter=From[str | None])
1182
1153
  """Optional. For `custom_emoji` only, unique identifier of the custom emoji.
1183
1154
  Use getCustomEmojiStickers to get full information about the sticker."""
1184
1155
 
@@ -1196,14 +1167,12 @@ class TextQuote(Model):
1196
1167
  """Approximate quote position in the original message in UTF-16 code units
1197
1168
  as specified by the sender."""
1198
1169
 
1199
- entities: Option[list[MessageEntity]] = field(
1200
- default=Nothing, converter=From["list[MessageEntity] | None"]
1201
- )
1170
+ entities: Option[list[MessageEntity]] = field(default=UNSET, converter=From["list[MessageEntity] | None"])
1202
1171
  """Optional. Special entities that appear in the quote. Currently, only bold,
1203
1172
  italic, underline, strikethrough, spoiler, and custom_emoji entities
1204
1173
  are kept in quotes."""
1205
1174
 
1206
- is_manual: Option[bool] = field(default=Nothing, converter=From[bool | None])
1175
+ is_manual: Option[bool] = field(default=UNSET, converter=From[bool | None])
1207
1176
  """Optional. True, if the quote was chosen manually by the message sender.
1208
1177
  Otherwise, the quote was added automatically by the server."""
1209
1178
 
@@ -1214,91 +1183,85 @@ class ExternalReplyInfo(Model):
1214
1183
  This object contains information about a message that is being replied to, which may come from another chat or forum topic.
1215
1184
  """
1216
1185
 
1217
- origin: Variative[MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel] = (
1218
- field(
1219
- converter=From[
1220
- "MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel"
1221
- ]
1222
- )
1186
+ origin: Variative[MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel] = field(
1187
+ converter=From["MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel"]
1223
1188
  )
1224
1189
  """Origin of the message replied to by the given message."""
1225
1190
 
1226
- chat: Option[Chat] = field(default=Nothing, converter=From["Chat | None"])
1191
+ chat: Option[Chat] = field(default=UNSET, converter=From["Chat | None"])
1227
1192
  """Optional. Chat the original message belongs to. Available only if the chat
1228
1193
  is a supergroup or a channel."""
1229
1194
 
1230
- message_id: Option[int] = field(default=Nothing, converter=From[int | None])
1195
+ message_id: Option[int] = field(default=UNSET, converter=From[int | None])
1231
1196
  """Optional. Unique message identifier inside the original chat. Available
1232
1197
  only if the original chat is a supergroup or a channel."""
1233
1198
 
1234
1199
  link_preview_options: Option[LinkPreviewOptions] = field(
1235
- default=Nothing, converter=From["LinkPreviewOptions | None"]
1200
+ default=UNSET, converter=From["LinkPreviewOptions | None"]
1236
1201
  )
1237
1202
  """Optional. Options used for link preview generation for the original message,
1238
1203
  if it is a text message."""
1239
1204
 
1240
- animation: Option[Animation] = field(default=Nothing, converter=From["Animation | None"])
1205
+ animation: Option[Animation] = field(default=UNSET, converter=From["Animation | None"])
1241
1206
  """Optional. Message is an animation, information about the animation."""
1242
1207
 
1243
- audio: Option[Audio] = field(default=Nothing, converter=From["Audio | None"])
1208
+ audio: Option[Audio] = field(default=UNSET, converter=From["Audio | None"])
1244
1209
  """Optional. Message is an audio file, information about the file."""
1245
1210
 
1246
- document: Option[Document] = field(default=Nothing, converter=From["Document | None"])
1211
+ document: Option[Document] = field(default=UNSET, converter=From["Document | None"])
1247
1212
  """Optional. Message is a general file, information about the file."""
1248
1213
 
1249
- paid_media: Option[PaidMediaInfo] = field(default=Nothing, converter=From["PaidMediaInfo | None"])
1214
+ paid_media: Option[PaidMediaInfo] = field(default=UNSET, converter=From["PaidMediaInfo | None"])
1250
1215
  """Optional. Message contains paid media; information about the paid media."""
1251
1216
 
1252
- photo: Option[list[PhotoSize]] = field(default=Nothing, converter=From["list[PhotoSize] | None"])
1217
+ photo: Option[list[PhotoSize]] = field(default=UNSET, converter=From["list[PhotoSize] | None"])
1253
1218
  """Optional. Message is a photo, available sizes of the photo."""
1254
1219
 
1255
- sticker: Option[Sticker] = field(default=Nothing, converter=From["Sticker | None"])
1220
+ sticker: Option[Sticker] = field(default=UNSET, converter=From["Sticker | None"])
1256
1221
  """Optional. Message is a sticker, information about the sticker."""
1257
1222
 
1258
- story: Option[Story] = field(default=Nothing, converter=From["Story | None"])
1223
+ story: Option[Story] = field(default=UNSET, converter=From["Story | None"])
1259
1224
  """Optional. Message is a forwarded story."""
1260
1225
 
1261
- video: Option[Video] = field(default=Nothing, converter=From["Video | None"])
1226
+ video: Option[Video] = field(default=UNSET, converter=From["Video | None"])
1262
1227
  """Optional. Message is a video, information about the video."""
1263
1228
 
1264
- video_note: Option[VideoNote] = field(default=Nothing, converter=From["VideoNote | None"])
1229
+ video_note: Option[VideoNote] = field(default=UNSET, converter=From["VideoNote | None"])
1265
1230
  """Optional. Message is a video note, information about the video message."""
1266
1231
 
1267
- voice: Option[Voice] = field(default=Nothing, converter=From["Voice | None"])
1232
+ voice: Option[Voice] = field(default=UNSET, converter=From["Voice | None"])
1268
1233
  """Optional. Message is a voice message, information about the file."""
1269
1234
 
1270
- has_media_spoiler: Option[bool] = field(default=Nothing, converter=From[bool | None])
1235
+ has_media_spoiler: Option[bool] = field(default=UNSET, converter=From[bool | None])
1271
1236
  """Optional. True, if the message media is covered by a spoiler animation."""
1272
1237
 
1273
- contact: Option[Contact] = field(default=Nothing, converter=From["Contact | None"])
1238
+ contact: Option[Contact] = field(default=UNSET, converter=From["Contact | None"])
1274
1239
  """Optional. Message is a shared contact, information about the contact."""
1275
1240
 
1276
- dice: Option[Dice] = field(default=Nothing, converter=From["Dice | None"])
1241
+ dice: Option[Dice] = field(default=UNSET, converter=From["Dice | None"])
1277
1242
  """Optional. Message is a dice with random value."""
1278
1243
 
1279
- game: Option[Game] = field(default=Nothing, converter=From["Game | None"])
1244
+ game: Option[Game] = field(default=UNSET, converter=From["Game | None"])
1280
1245
  """Optional. Message is a game, information about the game. More about games:
1281
1246
  https://core.telegram.org/bots/api#games."""
1282
1247
 
1283
- giveaway: Option[Giveaway] = field(default=Nothing, converter=From["Giveaway | None"])
1248
+ giveaway: Option[Giveaway] = field(default=UNSET, converter=From["Giveaway | None"])
1284
1249
  """Optional. Message is a scheduled giveaway, information about the giveaway."""
1285
1250
 
1286
- giveaway_winners: Option[GiveawayWinners] = field(
1287
- default=Nothing, converter=From["GiveawayWinners | None"]
1288
- )
1251
+ giveaway_winners: Option[GiveawayWinners] = field(default=UNSET, converter=From["GiveawayWinners | None"])
1289
1252
  """Optional. A giveaway with public winners was completed."""
1290
1253
 
1291
- invoice: Option[Invoice] = field(default=Nothing, converter=From["Invoice | None"])
1254
+ invoice: Option[Invoice] = field(default=UNSET, converter=From["Invoice | None"])
1292
1255
  """Optional. Message is an invoice for a payment, information about the invoice.
1293
1256
  More about payments: https://core.telegram.org/bots/api#payments."""
1294
1257
 
1295
- location: Option[Location] = field(default=Nothing, converter=From["Location | None"])
1258
+ location: Option[Location] = field(default=UNSET, converter=From["Location | None"])
1296
1259
  """Optional. Message is a shared location, information about the location."""
1297
1260
 
1298
- poll: Option[Poll] = field(default=Nothing, converter=From["Poll | None"])
1261
+ poll: Option[Poll] = field(default=UNSET, converter=From["Poll | None"])
1299
1262
  """Optional. Message is a native poll, information about the poll."""
1300
1263
 
1301
- venue: Option[Venue] = field(default=Nothing, converter=From["Venue | None"])
1264
+ venue: Option[Venue] = field(default=UNSET, converter=From["Venue | None"])
1302
1265
  """Optional. Message is a venue, information about the venue."""
1303
1266
 
1304
1267
 
@@ -1312,34 +1275,34 @@ class ReplyParameters(Model):
1312
1275
  """Identifier of the message that will be replied to in the current chat, or
1313
1276
  in the chat chat_id if it is specified."""
1314
1277
 
1315
- chat_id: Option[Variative[int, str]] = field(default=Nothing, converter=From[int | str | None])
1278
+ chat_id: Option[Variative[int, str]] = field(default=UNSET, converter=From[int | str | None])
1316
1279
  """Optional. If the message to be replied to is from a different chat, unique
1317
1280
  identifier for the chat or username of the channel (in the format @channelusername).
1318
1281
  Not supported for messages sent on behalf of a business account."""
1319
1282
 
1320
- allow_sending_without_reply: Option[bool] = field(default=Nothing, converter=From[bool | None])
1283
+ allow_sending_without_reply: Option[bool] = field(default=UNSET, converter=From[bool | None])
1321
1284
  """Optional. Pass True if the message should be sent even if the specified message
1322
1285
  to be replied to is not found. Always False for replies in another chat or
1323
1286
  forum topic. Always True for messages sent on behalf of a business account."""
1324
1287
 
1325
- quote: Option[str] = field(default=Nothing, converter=From[str | None])
1288
+ quote: Option[str] = field(default=UNSET, converter=From[str | None])
1326
1289
  """Optional. Quoted part of the message to be replied to; 0-1024 characters
1327
1290
  after entities parsing. The quote must be an exact substring of the message
1328
1291
  to be replied to, including bold, italic, underline, strikethrough, spoiler,
1329
1292
  and custom_emoji entities. The message will fail to send if the quote isn't
1330
1293
  found in the original message."""
1331
1294
 
1332
- quote_parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
1295
+ quote_parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
1333
1296
  """Optional. Mode for parsing entities in the quote. See formatting options
1334
1297
  for more details."""
1335
1298
 
1336
1299
  quote_entities: Option[list[MessageEntity]] = field(
1337
- default=Nothing, converter=From["list[MessageEntity] | None"]
1300
+ default=UNSET, converter=From["list[MessageEntity] | None"]
1338
1301
  )
1339
1302
  """Optional. A JSON-serialized list of special entities that appear in the
1340
1303
  quote. It can be specified instead of quote_parse_mode."""
1341
1304
 
1342
- quote_position: Option[int] = field(default=Nothing, converter=From[int | None])
1305
+ quote_position: Option[int] = field(default=UNSET, converter=From[int | None])
1343
1306
  """Optional. Position of the quote in the original message in UTF-16 code units."""
1344
1307
 
1345
1308
 
@@ -1390,7 +1353,7 @@ class MessageOriginChat(MessageOrigin):
1390
1353
  type: typing.Literal["chat"] = field(default="chat")
1391
1354
  """Type of the message origin, always `chat`."""
1392
1355
 
1393
- author_signature: Option[str] = field(default=Nothing, converter=From[str | None])
1356
+ author_signature: Option[str] = field(default=UNSET, converter=From[str | None])
1394
1357
  """Optional. For messages originally sent by an anonymous chat administrator,
1395
1358
  original message author signature."""
1396
1359
 
@@ -1413,7 +1376,7 @@ class MessageOriginChannel(MessageOrigin):
1413
1376
  type: typing.Literal["channel"] = field(default="channel")
1414
1377
  """Type of the message origin, always `channel`."""
1415
1378
 
1416
- author_signature: Option[str] = field(default=Nothing, converter=From[str | None])
1379
+ author_signature: Option[str] = field(default=UNSET, converter=From[str | None])
1417
1380
  """Optional. Signature of the original post author."""
1418
1381
 
1419
1382
 
@@ -1436,7 +1399,7 @@ class PhotoSize(Model):
1436
1399
  height: int = field()
1437
1400
  """Photo height."""
1438
1401
 
1439
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
1402
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
1440
1403
  """Optional. File size in bytes."""
1441
1404
 
1442
1405
 
@@ -1462,16 +1425,16 @@ class Animation(Model):
1462
1425
  duration: int = field()
1463
1426
  """Duration of the video in seconds as defined by the sender."""
1464
1427
 
1465
- thumbnail: Option[PhotoSize] = field(default=Nothing, converter=From["PhotoSize | None"])
1428
+ thumbnail: Option[PhotoSize] = field(default=UNSET, converter=From["PhotoSize | None"])
1466
1429
  """Optional. Animation thumbnail as defined by the sender."""
1467
1430
 
1468
- file_name: Option[str] = field(default=Nothing, converter=From[str | None])
1431
+ file_name: Option[str] = field(default=UNSET, converter=From[str | None])
1469
1432
  """Optional. Original animation filename as defined by the sender."""
1470
1433
 
1471
- mime_type: Option[str] = field(default=Nothing, converter=From[str | None])
1434
+ mime_type: Option[str] = field(default=UNSET, converter=From[str | None])
1472
1435
  """Optional. MIME type of the file as defined by the sender."""
1473
1436
 
1474
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
1437
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
1475
1438
  """Optional. File size in bytes. It can be bigger than 2^31 and some programming
1476
1439
  languages may have difficulty/silent defects in interpreting it. But
1477
1440
  it has at most 52 significant bits, so a signed 64-bit integer or double-precision
@@ -1494,25 +1457,25 @@ class Audio(Model):
1494
1457
  duration: int = field()
1495
1458
  """Duration of the audio in seconds as defined by the sender."""
1496
1459
 
1497
- performer: Option[str] = field(default=Nothing, converter=From[str | None])
1460
+ performer: Option[str] = field(default=UNSET, converter=From[str | None])
1498
1461
  """Optional. Performer of the audio as defined by the sender or by audio tags."""
1499
1462
 
1500
- title: Option[str] = field(default=Nothing, converter=From[str | None])
1463
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
1501
1464
  """Optional. Title of the audio as defined by the sender or by audio tags."""
1502
1465
 
1503
- file_name: Option[str] = field(default=Nothing, converter=From[str | None])
1466
+ file_name: Option[str] = field(default=UNSET, converter=From[str | None])
1504
1467
  """Optional. Original filename as defined by the sender."""
1505
1468
 
1506
- mime_type: Option[str] = field(default=Nothing, converter=From[str | None])
1469
+ mime_type: Option[str] = field(default=UNSET, converter=From[str | None])
1507
1470
  """Optional. MIME type of the file as defined by the sender."""
1508
1471
 
1509
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
1472
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
1510
1473
  """Optional. File size in bytes. It can be bigger than 2^31 and some programming
1511
1474
  languages may have difficulty/silent defects in interpreting it. But
1512
1475
  it has at most 52 significant bits, so a signed 64-bit integer or double-precision
1513
1476
  float type are safe for storing this value."""
1514
1477
 
1515
- thumbnail: Option[PhotoSize] = field(default=Nothing, converter=From["PhotoSize | None"])
1478
+ thumbnail: Option[PhotoSize] = field(default=UNSET, converter=From["PhotoSize | None"])
1516
1479
  """Optional. Thumbnail of the album cover to which the music file belongs."""
1517
1480
 
1518
1481
 
@@ -1529,16 +1492,16 @@ class Document(Model):
1529
1492
  """Unique identifier for this file, which is supposed to be the same over time
1530
1493
  and for different bots. Can't be used to download or reuse the file."""
1531
1494
 
1532
- thumbnail: Option[PhotoSize] = field(default=Nothing, converter=From["PhotoSize | None"])
1495
+ thumbnail: Option[PhotoSize] = field(default=UNSET, converter=From["PhotoSize | None"])
1533
1496
  """Optional. Document thumbnail as defined by the sender."""
1534
1497
 
1535
- file_name: Option[str] = field(default=Nothing, converter=From[str | None])
1498
+ file_name: Option[str] = field(default=UNSET, converter=From[str | None])
1536
1499
  """Optional. Original filename as defined by the sender."""
1537
1500
 
1538
- mime_type: Option[str] = field(default=Nothing, converter=From[str | None])
1501
+ mime_type: Option[str] = field(default=UNSET, converter=From[str | None])
1539
1502
  """Optional. MIME type of the file as defined by the sender."""
1540
1503
 
1541
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
1504
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
1542
1505
  """Optional. File size in bytes. It can be bigger than 2^31 and some programming
1543
1506
  languages may have difficulty/silent defects in interpreting it. But
1544
1507
  it has at most 52 significant bits, so a signed 64-bit integer or double-precision
@@ -1580,16 +1543,22 @@ class Video(Model):
1580
1543
  duration: int = field()
1581
1544
  """Duration of the video in seconds as defined by the sender."""
1582
1545
 
1583
- thumbnail: Option[PhotoSize] = field(default=Nothing, converter=From["PhotoSize | None"])
1546
+ thumbnail: Option[PhotoSize] = field(default=UNSET, converter=From["PhotoSize | None"])
1584
1547
  """Optional. Video thumbnail."""
1585
1548
 
1586
- file_name: Option[str] = field(default=Nothing, converter=From[str | None])
1549
+ cover: Option[list[PhotoSize]] = field(default=UNSET, converter=From["list[PhotoSize] | None"])
1550
+ """Optional. Available sizes of the cover of the video in the message."""
1551
+
1552
+ start_timestamp: Option[int] = field(default=UNSET, converter=From[int | None])
1553
+ """Optional. Timestamp in seconds from which the video will play in the message."""
1554
+
1555
+ file_name: Option[str] = field(default=UNSET, converter=From[str | None])
1587
1556
  """Optional. Original filename as defined by the sender."""
1588
1557
 
1589
- mime_type: Option[str] = field(default=Nothing, converter=From[str | None])
1558
+ mime_type: Option[str] = field(default=UNSET, converter=From[str | None])
1590
1559
  """Optional. MIME type of the file as defined by the sender."""
1591
1560
 
1592
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
1561
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
1593
1562
  """Optional. File size in bytes. It can be bigger than 2^31 and some programming
1594
1563
  languages may have difficulty/silent defects in interpreting it. But
1595
1564
  it has at most 52 significant bits, so a signed 64-bit integer or double-precision
@@ -1616,10 +1585,10 @@ class VideoNote(Model):
1616
1585
  duration: int = field()
1617
1586
  """Duration of the video in seconds as defined by the sender."""
1618
1587
 
1619
- thumbnail: Option[PhotoSize] = field(default=Nothing, converter=From["PhotoSize | None"])
1588
+ thumbnail: Option[PhotoSize] = field(default=UNSET, converter=From["PhotoSize | None"])
1620
1589
  """Optional. Video thumbnail."""
1621
1590
 
1622
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
1591
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
1623
1592
  """Optional. File size in bytes."""
1624
1593
 
1625
1594
 
@@ -1639,10 +1608,10 @@ class Voice(Model):
1639
1608
  duration: int = field()
1640
1609
  """Duration of the audio in seconds as defined by the sender."""
1641
1610
 
1642
- mime_type: Option[str] = field(default=Nothing, converter=From[str | None])
1611
+ mime_type: Option[str] = field(default=UNSET, converter=From[str | None])
1643
1612
  """Optional. MIME type of the file as defined by the sender."""
1644
1613
 
1645
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
1614
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
1646
1615
  """Optional. File size in bytes. It can be bigger than 2^31 and some programming
1647
1616
  languages may have difficulty/silent defects in interpreting it. But
1648
1617
  it has at most 52 significant bits, so a signed 64-bit integer or double-precision
@@ -1673,13 +1642,13 @@ class PaidMediaPreview(PaidMedia):
1673
1642
  type: typing.Literal["preview"] = field(default="preview")
1674
1643
  """Type of the paid media, always `preview`."""
1675
1644
 
1676
- width: Option[int] = field(default=Nothing, converter=From[int | None])
1645
+ width: Option[int] = field(default=UNSET, converter=From[int | None])
1677
1646
  """Optional. Media width as defined by the sender."""
1678
1647
 
1679
- height: Option[int] = field(default=Nothing, converter=From[int | None])
1648
+ height: Option[int] = field(default=UNSET, converter=From[int | None])
1680
1649
  """Optional. Media height as defined by the sender."""
1681
1650
 
1682
- duration: Option[int] = field(default=Nothing, converter=From[int | None])
1651
+ duration: Option[int] = field(default=UNSET, converter=From[int | None])
1683
1652
  """Optional. Duration of the media in seconds as defined by the sender."""
1684
1653
 
1685
1654
 
@@ -1721,16 +1690,16 @@ class Contact(Model):
1721
1690
  first_name: str = field()
1722
1691
  """Contact's first name."""
1723
1692
 
1724
- last_name: Option[str] = field(default=Nothing, converter=From[str | None])
1693
+ last_name: Option[str] = field(default=UNSET, converter=From[str | None])
1725
1694
  """Optional. Contact's last name."""
1726
1695
 
1727
- user_id: Option[int] = field(default=Nothing, converter=From[int | None])
1696
+ user_id: Option[int] = field(default=UNSET, converter=From[int | None])
1728
1697
  """Optional. Contact's user identifier in Telegram. This number may have
1729
1698
  more than 32 significant bits and some programming languages may have difficulty/silent
1730
1699
  defects in interpreting it. But it has at most 52 significant bits, so a 64-bit
1731
1700
  integer or double-precision float type are safe for storing this identifier."""
1732
1701
 
1733
- vcard: Option[str] = field(default=Nothing, converter=From[str | None])
1702
+ vcard: Option[str] = field(default=UNSET, converter=From[str | None])
1734
1703
  """Optional. Additional data about the contact in the form of a vCard."""
1735
1704
 
1736
1705
 
@@ -1760,9 +1729,7 @@ class PollOption(Model):
1760
1729
  voter_count: int = field()
1761
1730
  """Number of users that voted for this option."""
1762
1731
 
1763
- text_entities: Option[list[MessageEntity]] = field(
1764
- default=Nothing, converter=From["list[MessageEntity] | None"]
1765
- )
1732
+ text_entities: Option[list[MessageEntity]] = field(default=UNSET, converter=From["list[MessageEntity] | None"])
1766
1733
  """Optional. Special entities that appear in the option text. Currently,
1767
1734
  only custom emoji entities are allowed in poll option texts."""
1768
1735
 
@@ -1776,13 +1743,11 @@ class InputPollOption(Model):
1776
1743
  text: str = field()
1777
1744
  """Option text, 1-100 characters."""
1778
1745
 
1779
- text_parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
1746
+ text_parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
1780
1747
  """Optional. Mode for parsing entities in the text. See formatting options
1781
1748
  for more details. Currently, only custom emoji entities are allowed."""
1782
1749
 
1783
- text_entities: Option[list[MessageEntity]] = field(
1784
- default=Nothing, converter=From["list[MessageEntity] | None"]
1785
- )
1750
+ text_entities: Option[list[MessageEntity]] = field(default=UNSET, converter=From["list[MessageEntity] | None"])
1786
1751
  """Optional. A JSON-serialized list of special entities that appear in the
1787
1752
  poll option text. It can be specified instead of text_parse_mode."""
1788
1753
 
@@ -1800,10 +1765,10 @@ class PollAnswer(Model):
1800
1765
  """0-based identifiers of chosen answer options. May be empty if the vote was
1801
1766
  retracted."""
1802
1767
 
1803
- voter_chat: Option[Chat] = field(default=Nothing, converter=From["Chat | None"])
1768
+ voter_chat: Option[Chat] = field(default=UNSET, converter=From["Chat | None"])
1804
1769
  """Optional. The chat that changed the answer to the poll, if the voter is anonymous."""
1805
1770
 
1806
- user: Option[User] = field(default=Nothing, converter=From["User | None"])
1771
+ user: Option[User] = field(default=UNSET, converter=From["User | None"])
1807
1772
  """Optional. The user that changed the answer to the poll, if the voter isn't
1808
1773
  anonymous."""
1809
1774
 
@@ -1839,30 +1804,30 @@ class Poll(Model):
1839
1804
  """Poll type, currently can be `regular` or `quiz`."""
1840
1805
 
1841
1806
  question_entities: Option[list[MessageEntity]] = field(
1842
- default=Nothing, converter=From["list[MessageEntity] | None"]
1807
+ default=UNSET, converter=From["list[MessageEntity] | None"]
1843
1808
  )
1844
1809
  """Optional. Special entities that appear in the question. Currently, only
1845
1810
  custom emoji entities are allowed in poll questions."""
1846
1811
 
1847
- correct_option_id: Option[int] = field(default=Nothing, converter=From[int | None])
1812
+ correct_option_id: Option[int] = field(default=UNSET, converter=From[int | None])
1848
1813
  """Optional. 0-based identifier of the correct answer option. Available
1849
1814
  only for polls in the quiz mode, which are closed, or was sent (not forwarded)
1850
1815
  by the bot or to the private chat with the bot."""
1851
1816
 
1852
- explanation: Option[str] = field(default=Nothing, converter=From[str | None])
1817
+ explanation: Option[str] = field(default=UNSET, converter=From[str | None])
1853
1818
  """Optional. Text that is shown when a user chooses an incorrect answer or taps
1854
1819
  on the lamp icon in a quiz-style poll, 0-200 characters."""
1855
1820
 
1856
1821
  explanation_entities: Option[list[MessageEntity]] = field(
1857
- default=Nothing, converter=From["list[MessageEntity] | None"]
1822
+ default=UNSET, converter=From["list[MessageEntity] | None"]
1858
1823
  )
1859
1824
  """Optional. Special entities like usernames, URLs, bot commands, etc. that
1860
1825
  appear in the explanation."""
1861
1826
 
1862
- open_period: Option[int] = field(default=Nothing, converter=From[int | None])
1827
+ open_period: Option[int] = field(default=UNSET, converter=From[int | None])
1863
1828
  """Optional. Amount of time in seconds the poll will be active after creation."""
1864
1829
 
1865
- close_date: Option[datetime] = field(default=Nothing, converter=From[datetime | None])
1830
+ close_date: Option[datetime] = field(default=UNSET, converter=From[datetime | None])
1866
1831
  """Optional. Point in time (Unix timestamp) when the poll will be automatically
1867
1832
  closed."""
1868
1833
 
@@ -1879,19 +1844,19 @@ class Location(Model):
1879
1844
  longitude: float = field()
1880
1845
  """Longitude as defined by the sender."""
1881
1846
 
1882
- horizontal_accuracy: Option[float] = field(default=Nothing, converter=From[float | None])
1847
+ horizontal_accuracy: Option[float] = field(default=UNSET, converter=From[float | None])
1883
1848
  """Optional. The radius of uncertainty for the location, measured in meters;
1884
1849
  0-1500."""
1885
1850
 
1886
- live_period: Option[int] = field(default=Nothing, converter=From[int | None])
1851
+ live_period: Option[int] = field(default=UNSET, converter=From[int | None])
1887
1852
  """Optional. Time relative to the message sending date, during which the location
1888
1853
  can be updated; in seconds. For active live locations only."""
1889
1854
 
1890
- heading: Option[int] = field(default=Nothing, converter=From[int | None])
1855
+ heading: Option[int] = field(default=UNSET, converter=From[int | None])
1891
1856
  """Optional. The direction in which user is moving, in degrees; 1-360. For
1892
1857
  active live locations only."""
1893
1858
 
1894
- proximity_alert_radius: Option[int] = field(default=Nothing, converter=From[int | None])
1859
+ proximity_alert_radius: Option[int] = field(default=UNSET, converter=From[int | None])
1895
1860
  """Optional. The maximum distance for proximity alerts about approaching
1896
1861
  another chat member, in meters. For sent live locations only."""
1897
1862
 
@@ -1911,17 +1876,17 @@ class Venue(Model):
1911
1876
  address: str = field()
1912
1877
  """Address of the venue."""
1913
1878
 
1914
- foursquare_id: Option[str] = field(default=Nothing, converter=From[str | None])
1879
+ foursquare_id: Option[str] = field(default=UNSET, converter=From[str | None])
1915
1880
  """Optional. Foursquare identifier of the venue."""
1916
1881
 
1917
- foursquare_type: Option[str] = field(default=Nothing, converter=From[str | None])
1882
+ foursquare_type: Option[str] = field(default=UNSET, converter=From[str | None])
1918
1883
  """Optional. Foursquare type of the venue. (For example, `arts_entertainment/default`,
1919
1884
  `arts_entertainment/aquarium` or `food/icecream`.)."""
1920
1885
 
1921
- google_place_id: Option[str] = field(default=Nothing, converter=From[str | None])
1886
+ google_place_id: Option[str] = field(default=UNSET, converter=From[str | None])
1922
1887
  """Optional. Google Places identifier of the venue."""
1923
1888
 
1924
- google_place_type: Option[str] = field(default=Nothing, converter=From[str | None])
1889
+ google_place_type: Option[str] = field(default=UNSET, converter=From[str | None])
1925
1890
  """Optional. Google Places type of the venue. (See supported types.)."""
1926
1891
 
1927
1892
 
@@ -2054,18 +2019,18 @@ class BackgroundTypeWallpaper(BackgroundType):
2054
2019
  type: typing.Literal["wallpaper"] = field(default="wallpaper")
2055
2020
  """Type of the background, always `wallpaper`."""
2056
2021
 
2057
- is_blurred: Option[bool] = field(default=Nothing, converter=From[bool | None])
2022
+ is_blurred: Option[bool] = field(default=UNSET, converter=From[bool | None])
2058
2023
  """Optional. True, if the wallpaper is downscaled to fit in a 450x450 square
2059
2024
  and then box-blurred with radius 12."""
2060
2025
 
2061
- is_moving: Option[bool] = field(default=Nothing, converter=From[bool | None])
2026
+ is_moving: Option[bool] = field(default=UNSET, converter=From[bool | None])
2062
2027
  """Optional. True, if the background moves slightly when the device is tilted."""
2063
2028
 
2064
2029
 
2065
2030
  class BackgroundTypePattern(BackgroundType):
2066
2031
  """Object `BackgroundTypePattern`, see the [documentation](https://core.telegram.org/bots/api#backgroundtypepattern).
2067
2032
 
2068
- The background is a PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user.
2033
+ The background is a .PNG or .TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user.
2069
2034
  """
2070
2035
 
2071
2036
  document: Document = field()
@@ -2082,11 +2047,11 @@ class BackgroundTypePattern(BackgroundType):
2082
2047
  type: typing.Literal["pattern"] = field(default="pattern")
2083
2048
  """Type of the background, always `pattern`."""
2084
2049
 
2085
- is_inverted: Option[bool] = field(default=Nothing, converter=From[bool | None])
2050
+ is_inverted: Option[bool] = field(default=UNSET, converter=From[bool | None])
2086
2051
  """Optional. True, if the background fill must be applied only to the pattern
2087
2052
  itself. All other pixels are black in this case. For dark themes only."""
2088
2053
 
2089
- is_moving: Option[bool] = field(default=Nothing, converter=From[bool | None])
2054
+ is_moving: Option[bool] = field(default=UNSET, converter=From[bool | None])
2090
2055
  """Optional. True, if the background moves slightly when the device is tilted."""
2091
2056
 
2092
2057
 
@@ -2131,7 +2096,7 @@ class ForumTopicCreated(Model):
2131
2096
  icon_color: TopicIconColor = field()
2132
2097
  """Color of the topic icon in RGB format."""
2133
2098
 
2134
- icon_custom_emoji_id: Option[str] = field(default=Nothing, converter=From[str | None])
2099
+ icon_custom_emoji_id: Option[str] = field(default=UNSET, converter=From[str | None])
2135
2100
  """Optional. Unique identifier of the custom emoji shown as the topic icon."""
2136
2101
 
2137
2102
 
@@ -2148,10 +2113,10 @@ class ForumTopicEdited(Model):
2148
2113
  This object represents a service message about an edited forum topic.
2149
2114
  """
2150
2115
 
2151
- name: Option[str] = field(default=Nothing, converter=From[str | None])
2116
+ name: Option[str] = field(default=UNSET, converter=From[str | None])
2152
2117
  """Optional. New name of the topic, if it was edited."""
2153
2118
 
2154
- icon_custom_emoji_id: Option[str] = field(default=Nothing, converter=From[str | None])
2119
+ icon_custom_emoji_id: Option[str] = field(default=UNSET, converter=From[str | None])
2155
2120
  """Optional. New identifier of the custom emoji shown as the topic icon, if
2156
2121
  it was edited; an empty string if the icon was removed."""
2157
2122
 
@@ -2191,16 +2156,16 @@ class SharedUser(Model):
2191
2156
  The bot may not have access to the user and could be unable to use this identifier,
2192
2157
  unless the user is already known to the bot by some other means."""
2193
2158
 
2194
- first_name: Option[str] = field(default=Nothing, converter=From[str | None])
2159
+ first_name: Option[str] = field(default=UNSET, converter=From[str | None])
2195
2160
  """Optional. First name of the user, if the name was requested by the bot."""
2196
2161
 
2197
- last_name: Option[str] = field(default=Nothing, converter=From[str | None])
2162
+ last_name: Option[str] = field(default=UNSET, converter=From[str | None])
2198
2163
  """Optional. Last name of the user, if the name was requested by the bot."""
2199
2164
 
2200
- username: Option[str] = field(default=Nothing, converter=From[str | None])
2165
+ username: Option[str] = field(default=UNSET, converter=From[str | None])
2201
2166
  """Optional. Username of the user, if the username was requested by the bot."""
2202
2167
 
2203
- photo: Option[list[PhotoSize]] = field(default=Nothing, converter=From["list[PhotoSize] | None"])
2168
+ photo: Option[list[PhotoSize]] = field(default=UNSET, converter=From["list[PhotoSize] | None"])
2204
2169
  """Optional. Available sizes of the chat photo, if the photo was requested
2205
2170
  by the bot."""
2206
2171
 
@@ -2235,14 +2200,14 @@ class ChatShared(Model):
2235
2200
  bot may not have access to the chat and could be unable to use this identifier,
2236
2201
  unless the chat is already known to the bot by some other means."""
2237
2202
 
2238
- title: Option[str] = field(default=Nothing, converter=From[str | None])
2203
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
2239
2204
  """Optional. Title of the chat, if the title was requested by the bot."""
2240
2205
 
2241
- username: Option[str] = field(default=Nothing, converter=From[str | None])
2206
+ username: Option[str] = field(default=UNSET, converter=From[str | None])
2242
2207
  """Optional. Username of the chat, if the username was requested by the bot
2243
2208
  and available."""
2244
2209
 
2245
- photo: Option[list[PhotoSize]] = field(default=Nothing, converter=From["list[PhotoSize] | None"])
2210
+ photo: Option[list[PhotoSize]] = field(default=UNSET, converter=From["list[PhotoSize] | None"])
2246
2211
  """Optional. Available sizes of the chat photo, if the photo was requested
2247
2212
  by the bot."""
2248
2213
 
@@ -2253,15 +2218,15 @@ class WriteAccessAllowed(Model):
2253
2218
  This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.
2254
2219
  """
2255
2220
 
2256
- from_request: Option[bool] = field(default=Nothing, converter=From[bool | None])
2221
+ from_request: Option[bool] = field(default=UNSET, converter=From[bool | None])
2257
2222
  """Optional. True, if the access was granted after the user accepted an explicit
2258
2223
  request from a Web App sent by the method requestWriteAccess."""
2259
2224
 
2260
- web_app_name: Option[str] = field(default=Nothing, converter=From[str | None])
2225
+ web_app_name: Option[str] = field(default=UNSET, converter=From[str | None])
2261
2226
  """Optional. Name of the Web App, if the access was granted when the Web App was
2262
2227
  launched from a link."""
2263
2228
 
2264
- from_attachment_menu: Option[bool] = field(default=Nothing, converter=From[bool | None])
2229
+ from_attachment_menu: Option[bool] = field(default=UNSET, converter=From[bool | None])
2265
2230
  """Optional. True, if the access was granted when the bot was added to the attachment
2266
2231
  or side menu."""
2267
2232
 
@@ -2310,7 +2275,7 @@ class GiveawayCreated(Model):
2310
2275
  This object represents a service message about the creation of a scheduled giveaway.
2311
2276
  """
2312
2277
 
2313
- prize_star_count: Option[int] = field(default=Nothing, converter=From[int | None])
2278
+ prize_star_count: Option[int] = field(default=UNSET, converter=From[int | None])
2314
2279
  """Optional. The number of Telegram Stars to be split between giveaway winners;
2315
2280
  for Telegram Star giveaways only."""
2316
2281
 
@@ -2330,27 +2295,27 @@ class Giveaway(Model):
2330
2295
  winner_count: int = field()
2331
2296
  """The number of users which are supposed to be selected as winners of the giveaway."""
2332
2297
 
2333
- only_new_members: Option[bool] = field(default=Nothing, converter=From[bool | None])
2298
+ only_new_members: Option[bool] = field(default=UNSET, converter=From[bool | None])
2334
2299
  """Optional. True, if only users who join the chats after the giveaway started
2335
2300
  should be eligible to win."""
2336
2301
 
2337
- has_public_winners: Option[bool] = field(default=Nothing, converter=From[bool | None])
2302
+ has_public_winners: Option[bool] = field(default=UNSET, converter=From[bool | None])
2338
2303
  """Optional. True, if the list of giveaway winners will be visible to everyone."""
2339
2304
 
2340
- prize_description: Option[str] = field(default=Nothing, converter=From[str | None])
2305
+ prize_description: Option[str] = field(default=UNSET, converter=From[str | None])
2341
2306
  """Optional. Description of additional giveaway prize."""
2342
2307
 
2343
- country_codes: Option[list[str]] = field(default=Nothing, converter=From[list[str] | None])
2308
+ country_codes: Option[list[str]] = field(default=UNSET, converter=From[list[str] | None])
2344
2309
  """Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating
2345
2310
  the countries from which eligible users for the giveaway must come. If empty,
2346
2311
  then all users can participate in the giveaway. Users with a phone number
2347
2312
  that was bought on Fragment can always participate in giveaways."""
2348
2313
 
2349
- prize_star_count: Option[int] = field(default=Nothing, converter=From[int | None])
2314
+ prize_star_count: Option[int] = field(default=UNSET, converter=From[int | None])
2350
2315
  """Optional. The number of Telegram Stars to be split between giveaway winners;
2351
2316
  for Telegram Star giveaways only."""
2352
2317
 
2353
- premium_subscription_month_count: Option[int] = field(default=Nothing, converter=From[int | None])
2318
+ premium_subscription_month_count: Option[int] = field(default=UNSET, converter=From[int | None])
2354
2319
  """Optional. The number of months the Telegram Premium subscription won from
2355
2320
  the giveaway will be active for; for Telegram Premium giveaways only."""
2356
2321
 
@@ -2376,30 +2341,30 @@ class GiveawayWinners(Model):
2376
2341
  winners: list[User] = field()
2377
2342
  """List of up to 100 winners of the giveaway."""
2378
2343
 
2379
- additional_chat_count: Option[int] = field(default=Nothing, converter=From[int | None])
2344
+ additional_chat_count: Option[int] = field(default=UNSET, converter=From[int | None])
2380
2345
  """Optional. The number of other chats the user had to join in order to be eligible
2381
2346
  for the giveaway."""
2382
2347
 
2383
- prize_star_count: Option[int] = field(default=Nothing, converter=From[int | None])
2348
+ prize_star_count: Option[int] = field(default=UNSET, converter=From[int | None])
2384
2349
  """Optional. The number of Telegram Stars that were split between giveaway
2385
2350
  winners; for Telegram Star giveaways only."""
2386
2351
 
2387
- premium_subscription_month_count: Option[int] = field(default=Nothing, converter=From[int | None])
2352
+ premium_subscription_month_count: Option[int] = field(default=UNSET, converter=From[int | None])
2388
2353
  """Optional. The number of months the Telegram Premium subscription won from
2389
2354
  the giveaway will be active for; for Telegram Premium giveaways only."""
2390
2355
 
2391
- unclaimed_prize_count: Option[int] = field(default=Nothing, converter=From[int | None])
2356
+ unclaimed_prize_count: Option[int] = field(default=UNSET, converter=From[int | None])
2392
2357
  """Optional. Number of undistributed prizes."""
2393
2358
 
2394
- only_new_members: Option[bool] = field(default=Nothing, converter=From[bool | None])
2359
+ only_new_members: Option[bool] = field(default=UNSET, converter=From[bool | None])
2395
2360
  """Optional. True, if only users who had joined the chats after the giveaway
2396
2361
  started were eligible to win."""
2397
2362
 
2398
- was_refunded: Option[bool] = field(default=Nothing, converter=From[bool | None])
2363
+ was_refunded: Option[bool] = field(default=UNSET, converter=From[bool | None])
2399
2364
  """Optional. True, if the giveaway was canceled because the payment for it
2400
2365
  was refunded."""
2401
2366
 
2402
- prize_description: Option[str] = field(default=Nothing, converter=From[str | None])
2367
+ prize_description: Option[str] = field(default=UNSET, converter=From[str | None])
2403
2368
  """Optional. Description of additional giveaway prize."""
2404
2369
 
2405
2370
 
@@ -2412,13 +2377,13 @@ class GiveawayCompleted(Model):
2412
2377
  winner_count: int = field()
2413
2378
  """Number of winners in the giveaway."""
2414
2379
 
2415
- unclaimed_prize_count: Option[int] = field(default=Nothing, converter=From[int | None])
2380
+ unclaimed_prize_count: Option[int] = field(default=UNSET, converter=From[int | None])
2416
2381
  """Optional. Number of undistributed prizes."""
2417
2382
 
2418
- giveaway_message: Option[Message] = field(default=Nothing, converter=From["Message | None"])
2383
+ giveaway_message: Option[Message] = field(default=UNSET, converter=From["Message | None"])
2419
2384
  """Optional. Message with the giveaway that was completed, if it wasn't deleted."""
2420
2385
 
2421
- is_star_giveaway: Option[bool] = field(default=Nothing, converter=From[bool | None])
2386
+ is_star_giveaway: Option[bool] = field(default=UNSET, converter=From[bool | None])
2422
2387
  """Optional. True, if the giveaway is a Telegram Star giveaway. Otherwise,
2423
2388
  currently, the giveaway is a Telegram Premium giveaway."""
2424
2389
 
@@ -2429,24 +2394,24 @@ class LinkPreviewOptions(Model):
2429
2394
  Describes the options used for link preview generation.
2430
2395
  """
2431
2396
 
2432
- is_disabled: Option[bool] = field(default=Nothing, converter=From[bool | None])
2397
+ is_disabled: Option[bool] = field(default=UNSET, converter=From[bool | None])
2433
2398
  """Optional. True, if the link preview is disabled."""
2434
2399
 
2435
- url: Option[str] = field(default=Nothing, converter=From[str | None])
2400
+ url: Option[str] = field(default=UNSET, converter=From[str | None])
2436
2401
  """Optional. URL to use for the link preview. If empty, then the first URL found
2437
2402
  in the message text will be used."""
2438
2403
 
2439
- prefer_small_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
2404
+ prefer_small_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
2440
2405
  """Optional. True, if the media in the link preview is supposed to be shrunk;
2441
2406
  ignored if the URL isn't explicitly specified or media size change isn't
2442
2407
  supported for the preview."""
2443
2408
 
2444
- prefer_large_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
2409
+ prefer_large_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
2445
2410
  """Optional. True, if the media in the link preview is supposed to be enlarged;
2446
2411
  ignored if the URL isn't explicitly specified or media size change isn't
2447
2412
  supported for the preview."""
2448
2413
 
2449
- show_above_text: Option[bool] = field(default=Nothing, converter=From[bool | None])
2414
+ show_above_text: Option[bool] = field(default=UNSET, converter=From[bool | None])
2450
2415
  """Optional. True, if the link preview must be shown above the message text;
2451
2416
  otherwise, the link preview will be shown below the message text."""
2452
2417
 
@@ -2477,13 +2442,13 @@ class File(Model):
2477
2442
  """Unique identifier for this file, which is supposed to be the same over time
2478
2443
  and for different bots. Can't be used to download or reuse the file."""
2479
2444
 
2480
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
2445
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
2481
2446
  """Optional. File size in bytes. It can be bigger than 2^31 and some programming
2482
2447
  languages may have difficulty/silent defects in interpreting it. But
2483
2448
  it has at most 52 significant bits, so a signed 64-bit integer or double-precision
2484
2449
  float type are safe for storing this value."""
2485
2450
 
2486
- file_path: Option[str] = field(default=Nothing, converter=From[str | None])
2451
+ file_path: Option[str] = field(default=UNSET, converter=From[str | None])
2487
2452
  """Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path>
2488
2453
  to get the file."""
2489
2454
 
@@ -2508,28 +2473,28 @@ class ReplyKeyboardMarkup(Model):
2508
2473
  keyboard: list[list[KeyboardButton]] = field()
2509
2474
  """Array of button rows, each represented by an Array of KeyboardButton objects."""
2510
2475
 
2511
- is_persistent: Option[bool] = field(default=Nothing, converter=From[bool | None])
2476
+ is_persistent: Option[bool] = field(default=UNSET, converter=From[bool | None])
2512
2477
  """Optional. Requests clients to always show the keyboard when the regular
2513
2478
  keyboard is hidden. Defaults to false, in which case the custom keyboard
2514
2479
  can be hidden and opened with a keyboard icon."""
2515
2480
 
2516
- resize_keyboard: Option[bool] = field(default=Nothing, converter=From[bool | None])
2481
+ resize_keyboard: Option[bool] = field(default=UNSET, converter=From[bool | None])
2517
2482
  """Optional. Requests clients to resize the keyboard vertically for optimal
2518
2483
  fit (e.g., make the keyboard smaller if there are just two rows of buttons).
2519
2484
  Defaults to false, in which case the custom keyboard is always of the same
2520
2485
  height as the app's standard keyboard."""
2521
2486
 
2522
- one_time_keyboard: Option[bool] = field(default=Nothing, converter=From[bool | None])
2487
+ one_time_keyboard: Option[bool] = field(default=UNSET, converter=From[bool | None])
2523
2488
  """Optional. Requests clients to hide the keyboard as soon as it's been used.
2524
2489
  The keyboard will still be available, but clients will automatically display
2525
2490
  the usual letter-keyboard in the chat - the user can press a special button
2526
2491
  in the input field to see the custom keyboard again. Defaults to false."""
2527
2492
 
2528
- input_field_placeholder: Option[str] = field(default=Nothing, converter=From[str | None])
2493
+ input_field_placeholder: Option[str] = field(default=UNSET, converter=From[str | None])
2529
2494
  """Optional. The placeholder to be shown in the input field when the keyboard
2530
2495
  is active; 1-64 characters."""
2531
2496
 
2532
- selective: Option[bool] = field(default=Nothing, converter=From[bool | None])
2497
+ selective: Option[bool] = field(default=UNSET, converter=From[bool | None])
2533
2498
  """Optional. Use this parameter if you want to show the keyboard to specific
2534
2499
  users only. Targets: 1) users that are @mentioned in the text of the Message
2535
2500
  object; 2) if the bot's message is a reply to a message in the same chat and
@@ -2538,9 +2503,8 @@ class ReplyKeyboardMarkup(Model):
2538
2503
  select the new language. Other users in the group don't see the keyboard."""
2539
2504
 
2540
2505
  @property
2541
- def empty_markup(self) -> "ReplyKeyboardRemove":
2506
+ def empty_markup(self) -> ReplyKeyboardRemove:
2542
2507
  """Empty keyboard to remove the custom keyboard."""
2543
-
2544
2508
  return ReplyKeyboardRemove(remove_keyboard=True, selective=self.selective.unwrap_or_none())
2545
2509
 
2546
2510
 
@@ -2556,34 +2520,34 @@ class KeyboardButton(Model):
2556
2520
  as a message when the button is pressed."""
2557
2521
 
2558
2522
  request_users: Option[KeyboardButtonRequestUsers] = field(
2559
- default=Nothing, converter=From["KeyboardButtonRequestUsers | None"]
2523
+ default=UNSET, converter=From["KeyboardButtonRequestUsers | None"]
2560
2524
  )
2561
2525
  """Optional. If specified, pressing the button will open a list of suitable
2562
2526
  users. Identifiers of selected users will be sent to the bot in a `users_shared`
2563
2527
  service message. Available in private chats only."""
2564
2528
 
2565
2529
  request_chat: Option[KeyboardButtonRequestChat] = field(
2566
- default=Nothing, converter=From["KeyboardButtonRequestChat | None"]
2530
+ default=UNSET, converter=From["KeyboardButtonRequestChat | None"]
2567
2531
  )
2568
2532
  """Optional. If specified, pressing the button will open a list of suitable
2569
2533
  chats. Tapping on a chat will send its identifier to the bot in a `chat_shared`
2570
2534
  service message. Available in private chats only."""
2571
2535
 
2572
- request_contact: Option[bool] = field(default=Nothing, converter=From[bool | None])
2536
+ request_contact: Option[bool] = field(default=UNSET, converter=From[bool | None])
2573
2537
  """Optional. If True, the user's phone number will be sent as a contact when
2574
2538
  the button is pressed. Available in private chats only."""
2575
2539
 
2576
- request_location: Option[bool] = field(default=Nothing, converter=From[bool | None])
2540
+ request_location: Option[bool] = field(default=UNSET, converter=From[bool | None])
2577
2541
  """Optional. If True, the user's current location will be sent when the button
2578
2542
  is pressed. Available in private chats only."""
2579
2543
 
2580
2544
  request_poll: Option[KeyboardButtonPollType] = field(
2581
- default=Nothing, converter=From["KeyboardButtonPollType | None"]
2545
+ default=UNSET, converter=From["KeyboardButtonPollType | None"]
2582
2546
  )
2583
2547
  """Optional. If specified, the user will be asked to create a poll and send it
2584
2548
  to the bot when the button is pressed. Available in private chats only."""
2585
2549
 
2586
- web_app: Option[WebAppInfo] = field(default=Nothing, converter=From["WebAppInfo | None"])
2550
+ web_app: Option[WebAppInfo] = field(default=UNSET, converter=From["WebAppInfo | None"])
2587
2551
  """Optional. If specified, the described Web App will be launched when the
2588
2552
  button is pressed. The Web App will be able to send a `web_app_data` service
2589
2553
  message. Available in private chats only."""
@@ -2599,25 +2563,25 @@ class KeyboardButtonRequestUsers(Model):
2599
2563
  """Signed 32-bit identifier of the request that will be received back in the
2600
2564
  UsersShared object. Must be unique within the message."""
2601
2565
 
2602
- user_is_bot: Option[bool] = field(default=Nothing, converter=From[bool | None])
2566
+ user_is_bot: Option[bool] = field(default=UNSET, converter=From[bool | None])
2603
2567
  """Optional. Pass True to request bots, pass False to request regular users.
2604
2568
  If not specified, no additional restrictions are applied."""
2605
2569
 
2606
- user_is_premium: Option[bool] = field(default=Nothing, converter=From[bool | None])
2570
+ user_is_premium: Option[bool] = field(default=UNSET, converter=From[bool | None])
2607
2571
  """Optional. Pass True to request premium users, pass False to request non-premium
2608
2572
  users. If not specified, no additional restrictions are applied."""
2609
2573
 
2610
- max_quantity: Option[int] = field(default=Nothing, converter=From[int | None])
2574
+ max_quantity: Option[int] = field(default=UNSET, converter=From[int | None])
2611
2575
  """Optional. The maximum number of users to be selected; 1-10. Defaults to
2612
2576
  1."""
2613
2577
 
2614
- request_name: Option[bool] = field(default=Nothing, converter=From[bool | None])
2578
+ request_name: Option[bool] = field(default=UNSET, converter=From[bool | None])
2615
2579
  """Optional. Pass True to request the users' first and last names."""
2616
2580
 
2617
- request_username: Option[bool] = field(default=Nothing, converter=From[bool | None])
2581
+ request_username: Option[bool] = field(default=UNSET, converter=From[bool | None])
2618
2582
  """Optional. Pass True to request the users' usernames."""
2619
2583
 
2620
- request_photo: Option[bool] = field(default=Nothing, converter=From[bool | None])
2584
+ request_photo: Option[bool] = field(default=UNSET, converter=From[bool | None])
2621
2585
  """Optional. Pass True to request the users' photos."""
2622
2586
 
2623
2587
 
@@ -2635,44 +2599,44 @@ class KeyboardButtonRequestChat(Model):
2635
2599
  """Pass True to request a channel chat, pass False to request a group or a supergroup
2636
2600
  chat."""
2637
2601
 
2638
- chat_is_forum: Option[bool] = field(default=Nothing, converter=From[bool | None])
2602
+ chat_is_forum: Option[bool] = field(default=UNSET, converter=From[bool | None])
2639
2603
  """Optional. Pass True to request a forum supergroup, pass False to request
2640
2604
  a non-forum chat. If not specified, no additional restrictions are applied."""
2641
2605
 
2642
- chat_has_username: Option[bool] = field(default=Nothing, converter=From[bool | None])
2606
+ chat_has_username: Option[bool] = field(default=UNSET, converter=From[bool | None])
2643
2607
  """Optional. Pass True to request a supergroup or a channel with a username,
2644
2608
  pass False to request a chat without a username. If not specified, no additional
2645
2609
  restrictions are applied."""
2646
2610
 
2647
- chat_is_created: Option[bool] = field(default=Nothing, converter=From[bool | None])
2611
+ chat_is_created: Option[bool] = field(default=UNSET, converter=From[bool | None])
2648
2612
  """Optional. Pass True to request a chat owned by the user. Otherwise, no additional
2649
2613
  restrictions are applied."""
2650
2614
 
2651
2615
  user_administrator_rights: Option[ChatAdministratorRights] = field(
2652
- default=Nothing, converter=From["ChatAdministratorRights | None"]
2616
+ default=UNSET, converter=From["ChatAdministratorRights | None"]
2653
2617
  )
2654
2618
  """Optional. A JSON-serialized object listing the required administrator
2655
2619
  rights of the user in the chat. The rights must be a superset of bot_administrator_rights.
2656
2620
  If not specified, no additional restrictions are applied."""
2657
2621
 
2658
2622
  bot_administrator_rights: Option[ChatAdministratorRights] = field(
2659
- default=Nothing, converter=From["ChatAdministratorRights | None"]
2623
+ default=UNSET, converter=From["ChatAdministratorRights | None"]
2660
2624
  )
2661
2625
  """Optional. A JSON-serialized object listing the required administrator
2662
2626
  rights of the bot in the chat. The rights must be a subset of user_administrator_rights.
2663
2627
  If not specified, no additional restrictions are applied."""
2664
2628
 
2665
- bot_is_member: Option[bool] = field(default=Nothing, converter=From[bool | None])
2629
+ bot_is_member: Option[bool] = field(default=UNSET, converter=From[bool | None])
2666
2630
  """Optional. Pass True to request a chat with the bot as a member. Otherwise,
2667
2631
  no additional restrictions are applied."""
2668
2632
 
2669
- request_title: Option[bool] = field(default=Nothing, converter=From[bool | None])
2633
+ request_title: Option[bool] = field(default=UNSET, converter=From[bool | None])
2670
2634
  """Optional. Pass True to request the chat's title."""
2671
2635
 
2672
- request_username: Option[bool] = field(default=Nothing, converter=From[bool | None])
2636
+ request_username: Option[bool] = field(default=UNSET, converter=From[bool | None])
2673
2637
  """Optional. Pass True to request the chat's username."""
2674
2638
 
2675
- request_photo: Option[bool] = field(default=Nothing, converter=From[bool | None])
2639
+ request_photo: Option[bool] = field(default=UNSET, converter=From[bool | None])
2676
2640
  """Optional. Pass True to request the chat's photo."""
2677
2641
 
2678
2642
 
@@ -2682,7 +2646,7 @@ class KeyboardButtonPollType(Model):
2682
2646
  This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
2683
2647
  """
2684
2648
 
2685
- type: Option[typing.Literal["quiz", "regular"]] = field(default=Nothing)
2649
+ type: Option[typing.Literal["quiz", "regular"]] = field(default=UNSET)
2686
2650
  """Optional. If quiz is passed, the user will be allowed to create only polls
2687
2651
  in the quiz mode. If regular is passed, only regular polls will be allowed.
2688
2652
  Otherwise, the user will be allowed to create a poll of any type."""
@@ -2699,7 +2663,7 @@ class ReplyKeyboardRemove(Model):
2699
2663
  summon this keyboard; if you want to hide the keyboard from sight but keep
2700
2664
  it accessible, use one_time_keyboard in ReplyKeyboardMarkup)."""
2701
2665
 
2702
- selective: Option[bool] = field(default=Nothing, converter=From[bool | None])
2666
+ selective: Option[bool] = field(default=UNSET, converter=From[bool | None])
2703
2667
  """Optional. Use this parameter if you want to remove the keyboard for specific
2704
2668
  users only. Targets: 1) users that are @mentioned in the text of the Message
2705
2669
  object; 2) if the bot's message is a reply to a message in the same chat and
@@ -2729,34 +2693,34 @@ class InlineKeyboardButton(Model):
2729
2693
  text: str = field()
2730
2694
  """Label text on the button."""
2731
2695
 
2732
- url: Option[str] = field(default=Nothing, converter=From[str | None])
2696
+ url: Option[str] = field(default=UNSET, converter=From[str | None])
2733
2697
  """Optional. HTTP or tg:// URL to be opened when the button is pressed. Links
2734
2698
  tg://user?id=<user_id> can be used to mention a user by their identifier
2735
2699
  without using a username, if this is allowed by their privacy settings."""
2736
2700
 
2737
- callback_data: Option[str] = field(default=Nothing, converter=From[str | None])
2701
+ callback_data: Option[str] = field(default=UNSET, converter=From[str | None])
2738
2702
  """Optional. Data to be sent in a callback query to the bot when the button is
2739
2703
  pressed, 1-64 bytes."""
2740
2704
 
2741
- web_app: Option[WebAppInfo] = field(default=Nothing, converter=From["WebAppInfo | None"])
2705
+ web_app: Option[WebAppInfo] = field(default=UNSET, converter=From["WebAppInfo | None"])
2742
2706
  """Optional. Description of the Web App that will be launched when the user
2743
2707
  presses the button. The Web App will be able to send an arbitrary message
2744
2708
  on behalf of the user using the method answerWebAppQuery. Available only
2745
2709
  in private chats between a user and the bot. Not supported for messages sent
2746
2710
  on behalf of a Telegram Business account."""
2747
2711
 
2748
- login_url: Option[LoginUrl] = field(default=Nothing, converter=From["LoginUrl | None"])
2712
+ login_url: Option[LoginUrl] = field(default=UNSET, converter=From["LoginUrl | None"])
2749
2713
  """Optional. An HTTPS URL used to automatically authorize the user. Can be
2750
2714
  used as a replacement for the Telegram Login Widget."""
2751
2715
 
2752
- switch_inline_query: Option[str] = field(default=Nothing, converter=From[str | None])
2716
+ switch_inline_query: Option[str] = field(default=UNSET, converter=From[str | None])
2753
2717
  """Optional. If set, pressing the button will prompt the user to select one
2754
2718
  of their chats, open that chat and insert the bot's username and the specified
2755
2719
  inline query in the input field. May be empty, in which case just the bot's
2756
2720
  username will be inserted. Not supported for messages sent on behalf of
2757
2721
  a Telegram Business account."""
2758
2722
 
2759
- switch_inline_query_current_chat: Option[str] = field(default=Nothing, converter=From[str | None])
2723
+ switch_inline_query_current_chat: Option[str] = field(default=UNSET, converter=From[str | None])
2760
2724
  """Optional. If set, pressing the button will insert the bot's username and
2761
2725
  the specified inline query in the current chat's input field. May be empty,
2762
2726
  in which case only the bot's username will be inserted. This offers a quick
@@ -2765,19 +2729,23 @@ class InlineKeyboardButton(Model):
2765
2729
  sent on behalf of a Telegram Business account."""
2766
2730
 
2767
2731
  switch_inline_query_chosen_chat: Option[SwitchInlineQueryChosenChat] = field(
2768
- default=Nothing, converter=From["SwitchInlineQueryChosenChat | None"]
2732
+ default=UNSET, converter=From["SwitchInlineQueryChosenChat | None"]
2769
2733
  )
2770
2734
  """Optional. If set, pressing the button will prompt the user to select one
2771
2735
  of their chats of the specified type, open that chat and insert the bot's
2772
2736
  username and the specified inline query in the input field. Not supported
2773
2737
  for messages sent on behalf of a Telegram Business account."""
2774
2738
 
2775
- callback_game: Option[CallbackGame] = field(default=Nothing, converter=From["CallbackGame | None"])
2739
+ copy_text: Option[CopyTextButton] = field(default=UNSET, converter=From["CopyTextButton | None"])
2740
+ """Optional. Description of the button that copies the specified text to the
2741
+ clipboard."""
2742
+
2743
+ callback_game: Option[CallbackGame] = field(default=UNSET, converter=From["CallbackGame | None"])
2776
2744
  """Optional. Description of the game that will be launched when the user presses
2777
2745
  the button. NOTE: This type of button must always be the first button in the
2778
2746
  first row."""
2779
2747
 
2780
- pay: Option[bool] = field(default=Nothing, converter=From[bool | None])
2748
+ pay: Option[bool] = field(default=UNSET, converter=From[bool | None])
2781
2749
  """Optional. Specify True, to send a Pay button. Substrings `⭐` and `XTR` in
2782
2750
  the buttons's text will be replaced with a Telegram Star icon. NOTE: This
2783
2751
  type of button must always be the first button in the first row and can only
@@ -2799,16 +2767,16 @@ class LoginUrl(Model):
2799
2767
  NOTE: You must always check the hash of the received data to verify the authentication
2800
2768
  and the integrity of the data as described in Checking authorization."""
2801
2769
 
2802
- forward_text: Option[str] = field(default=Nothing, converter=From[str | None])
2770
+ forward_text: Option[str] = field(default=UNSET, converter=From[str | None])
2803
2771
  """Optional. New text of the button in forwarded messages."""
2804
2772
 
2805
- bot_username: Option[str] = field(default=Nothing, converter=From[str | None])
2773
+ bot_username: Option[str] = field(default=UNSET, converter=From[str | None])
2806
2774
  """Optional. Username of a bot, which will be used for user authorization.
2807
2775
  See Setting up a bot for more details. If not specified, the current bot's
2808
2776
  username will be assumed. The url's domain must be the same as the domain
2809
2777
  linked with the bot. See Linking your domain to the bot for more details."""
2810
2778
 
2811
- request_write_access: Option[bool] = field(default=Nothing, converter=From[bool | None])
2779
+ request_write_access: Option[bool] = field(default=UNSET, converter=From[bool | None])
2812
2780
  """Optional. Pass True to request the permission for your bot to send messages
2813
2781
  to the user."""
2814
2782
 
@@ -2819,23 +2787,33 @@ class SwitchInlineQueryChosenChat(Model):
2819
2787
  This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
2820
2788
  """
2821
2789
 
2822
- query: Option[str] = field(default=Nothing, converter=From[str | None])
2790
+ query: Option[str] = field(default=UNSET, converter=From[str | None])
2823
2791
  """Optional. The default inline query to be inserted in the input field. If
2824
2792
  left empty, only the bot's username will be inserted."""
2825
2793
 
2826
- allow_user_chats: Option[bool] = field(default=Nothing, converter=From[bool | None])
2794
+ allow_user_chats: Option[bool] = field(default=UNSET, converter=From[bool | None])
2827
2795
  """Optional. True, if private chats with users can be chosen."""
2828
2796
 
2829
- allow_bot_chats: Option[bool] = field(default=Nothing, converter=From[bool | None])
2797
+ allow_bot_chats: Option[bool] = field(default=UNSET, converter=From[bool | None])
2830
2798
  """Optional. True, if private chats with bots can be chosen."""
2831
2799
 
2832
- allow_group_chats: Option[bool] = field(default=Nothing, converter=From[bool | None])
2800
+ allow_group_chats: Option[bool] = field(default=UNSET, converter=From[bool | None])
2833
2801
  """Optional. True, if group and supergroup chats can be chosen."""
2834
2802
 
2835
- allow_channel_chats: Option[bool] = field(default=Nothing, converter=From[bool | None])
2803
+ allow_channel_chats: Option[bool] = field(default=UNSET, converter=From[bool | None])
2836
2804
  """Optional. True, if channel chats can be chosen."""
2837
2805
 
2838
2806
 
2807
+ class CopyTextButton(Model):
2808
+ """Object `CopyTextButton`, see the [documentation](https://core.telegram.org/bots/api#copytextbutton).
2809
+
2810
+ This object represents an inline keyboard button that copies specified text to the clipboard.
2811
+ """
2812
+
2813
+ text: str = field()
2814
+ """The text to be copied to the clipboard; 1-256 characters."""
2815
+
2816
+
2839
2817
  class CallbackQuery(Model):
2840
2818
  """Object `CallbackQuery`, see the [documentation](https://core.telegram.org/bots/api#callbackquery).
2841
2819
 
@@ -2853,20 +2831,20 @@ class CallbackQuery(Model):
2853
2831
  with the callback button was sent. Useful for high scores in games."""
2854
2832
 
2855
2833
  message: Option[Variative[Message, InaccessibleMessage]] = field(
2856
- default=Nothing, converter=From["Message | InaccessibleMessage | None"]
2834
+ default=UNSET, converter=From["Message | InaccessibleMessage | None"]
2857
2835
  )
2858
2836
  """Optional. Message sent by the bot with the callback button that originated
2859
2837
  the query."""
2860
2838
 
2861
- inline_message_id: Option[str] = field(default=Nothing, converter=From[str | None])
2839
+ inline_message_id: Option[str] = field(default=UNSET, converter=From[str | None])
2862
2840
  """Optional. Identifier of the message sent via the bot in inline mode, that
2863
2841
  originated the query."""
2864
2842
 
2865
- data: Option[str] = field(default=Nothing, converter=From[str | None])
2843
+ data: Option[str] = field(default=UNSET, converter=From[str | None])
2866
2844
  """Optional. Data associated with the callback button. Be aware that the message
2867
2845
  originated the query can contain no callback buttons with this data."""
2868
2846
 
2869
- game_short_name: Option[str] = field(default=Nothing, converter=From[str | None])
2847
+ game_short_name: Option[str] = field(default=UNSET, converter=From[str | None])
2870
2848
  """Optional. Short name of a Game to be returned, serves as the unique identifier
2871
2849
  for the game."""
2872
2850
 
@@ -2881,11 +2859,11 @@ class ForceReply(Model):
2881
2859
  """Shows reply interface to the user, as if they manually selected the bot's
2882
2860
  message and tapped 'Reply'."""
2883
2861
 
2884
- input_field_placeholder: Option[str] = field(default=Nothing, converter=From[str | None])
2862
+ input_field_placeholder: Option[str] = field(default=UNSET, converter=From[str | None])
2885
2863
  """Optional. The placeholder to be shown in the input field when the reply is
2886
2864
  active; 1-64 characters."""
2887
2865
 
2888
- selective: Option[bool] = field(default=Nothing, converter=From[bool | None])
2866
+ selective: Option[bool] = field(default=UNSET, converter=From[bool | None])
2889
2867
  """Optional. Use this parameter if you want to force reply from specific users
2890
2868
  only. Targets: 1) users that are @mentioned in the text of the Message object;
2891
2869
  2) if the bot's message is a reply to a message in the same chat and forum topic,
@@ -2939,25 +2917,25 @@ class ChatInviteLink(Model):
2939
2917
  is_revoked: bool = field()
2940
2918
  """True, if the link is revoked."""
2941
2919
 
2942
- name: Option[str] = field(default=Nothing, converter=From[str | None])
2920
+ name: Option[str] = field(default=UNSET, converter=From[str | None])
2943
2921
  """Optional. Invite link name."""
2944
2922
 
2945
- expire_date: Option[datetime] = field(default=Nothing, converter=From[datetime | None])
2923
+ expire_date: Option[datetime] = field(default=UNSET, converter=From[datetime | None])
2946
2924
  """Optional. Point in time (Unix timestamp) when the link will expire or has
2947
2925
  been expired."""
2948
2926
 
2949
- member_limit: Option[int] = field(default=Nothing, converter=From[int | None])
2927
+ member_limit: Option[int] = field(default=UNSET, converter=From[int | None])
2950
2928
  """Optional. The maximum number of users that can be members of the chat simultaneously
2951
2929
  after joining the chat via this invite link; 1-99999."""
2952
2930
 
2953
- pending_join_request_count: Option[int] = field(default=Nothing, converter=From[int | None])
2931
+ pending_join_request_count: Option[int] = field(default=UNSET, converter=From[int | None])
2954
2932
  """Optional. Number of pending join requests created using this link."""
2955
2933
 
2956
- subscription_period: Option[int] = field(default=Nothing, converter=From[int | None])
2934
+ subscription_period: Option[int] = field(default=UNSET, converter=From[int | None])
2957
2935
  """Optional. The number of seconds the subscription will be active for before
2958
2936
  the next payment."""
2959
2937
 
2960
- subscription_price: Option[int] = field(default=Nothing, converter=From[int | None])
2938
+ subscription_price: Option[int] = field(default=UNSET, converter=From[int | None])
2961
2939
  """Optional. The amount of Telegram Stars a user must pay initially and after
2962
2940
  each subsequent subscription period to be a member of the chat using the
2963
2941
  link."""
@@ -3008,19 +2986,19 @@ class ChatAdministratorRights(Model):
3008
2986
  can_delete_stories: bool = field()
3009
2987
  """True, if the administrator can delete stories posted by other users."""
3010
2988
 
3011
- can_post_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
2989
+ can_post_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3012
2990
  """Optional. True, if the administrator can post messages in the channel,
3013
2991
  or access channel statistics; for channels only."""
3014
2992
 
3015
- can_edit_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
2993
+ can_edit_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3016
2994
  """Optional. True, if the administrator can edit messages of other users and
3017
2995
  can pin messages; for channels only."""
3018
2996
 
3019
- can_pin_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
2997
+ can_pin_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3020
2998
  """Optional. True, if the user is allowed to pin messages; for groups and supergroups
3021
2999
  only."""
3022
3000
 
3023
- can_manage_topics: Option[bool] = field(default=Nothing, converter=From[bool | None])
3001
+ can_manage_topics: Option[bool] = field(default=UNSET, converter=From[bool | None])
3024
3002
  """Optional. True, if the user is allowed to create, rename, close, and reopen
3025
3003
  forum topics; for supergroups only."""
3026
3004
 
@@ -3068,21 +3046,20 @@ class ChatMemberUpdated(Model):
3068
3046
  )
3069
3047
  """New information about the chat member."""
3070
3048
 
3071
- invite_link: Option[ChatInviteLink] = field(default=Nothing, converter=From["ChatInviteLink | None"])
3049
+ invite_link: Option[ChatInviteLink] = field(default=UNSET, converter=From["ChatInviteLink | None"])
3072
3050
  """Optional. Chat invite link, which was used by the user to join the chat; for
3073
3051
  joining by invite link events only."""
3074
3052
 
3075
- via_join_request: Option[bool] = field(default=Nothing, converter=From[bool | None])
3053
+ via_join_request: Option[bool] = field(default=UNSET, converter=From[bool | None])
3076
3054
  """Optional. True, if the user joined the chat after sending a direct join request
3077
3055
  without using an invite link and being approved by an administrator."""
3078
3056
 
3079
- via_chat_folder_invite_link: Option[bool] = field(default=Nothing, converter=From[bool | None])
3057
+ via_chat_folder_invite_link: Option[bool] = field(default=UNSET, converter=From[bool | None])
3080
3058
  """Optional. True, if the user joined the chat via a chat folder invite link."""
3081
3059
 
3082
3060
  @property
3083
3061
  def chat_id(self) -> int:
3084
3062
  """Alias `.chat_id` instead of `.chat.id`"""
3085
-
3086
3063
  return self.chat.id
3087
3064
 
3088
3065
 
@@ -3101,7 +3078,7 @@ class ChatMemberOwner(ChatMember):
3101
3078
  status: typing.Literal["creator"] = field(default="creator")
3102
3079
  """The member's status in the chat, always `creator`."""
3103
3080
 
3104
- custom_title: Option[str] = field(default=Nothing, converter=From[str | None])
3081
+ custom_title: Option[str] = field(default=UNSET, converter=From[str | None])
3105
3082
  """Optional. Custom title for this user."""
3106
3083
 
3107
3084
 
@@ -3159,23 +3136,23 @@ class ChatMemberAdministrator(ChatMember):
3159
3136
  status: typing.Literal["administrator"] = field(default="administrator")
3160
3137
  """The member's status in the chat, always `administrator`."""
3161
3138
 
3162
- can_post_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
3139
+ can_post_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3163
3140
  """Optional. True, if the administrator can post messages in the channel,
3164
3141
  or access channel statistics; for channels only."""
3165
3142
 
3166
- can_edit_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
3143
+ can_edit_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3167
3144
  """Optional. True, if the administrator can edit messages of other users and
3168
3145
  can pin messages; for channels only."""
3169
3146
 
3170
- can_pin_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
3147
+ can_pin_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3171
3148
  """Optional. True, if the user is allowed to pin messages; for groups and supergroups
3172
3149
  only."""
3173
3150
 
3174
- can_manage_topics: Option[bool] = field(default=Nothing, converter=From[bool | None])
3151
+ can_manage_topics: Option[bool] = field(default=UNSET, converter=From[bool | None])
3175
3152
  """Optional. True, if the user is allowed to create, rename, close, and reopen
3176
3153
  forum topics; for supergroups only."""
3177
3154
 
3178
- custom_title: Option[str] = field(default=Nothing, converter=From[str | None])
3155
+ custom_title: Option[str] = field(default=UNSET, converter=From[str | None])
3179
3156
  """Optional. Custom title for this user."""
3180
3157
 
3181
3158
 
@@ -3191,7 +3168,7 @@ class ChatMemberMember(ChatMember):
3191
3168
  status: typing.Literal["member"] = field(default="member")
3192
3169
  """The member's status in the chat, always `member`."""
3193
3170
 
3194
- until_date: Option[datetime] = field(default=Nothing, converter=From[datetime | None])
3171
+ until_date: Option[datetime] = field(default=UNSET, converter=From[datetime | None])
3195
3172
  """Optional. Date when the user's subscription will expire; Unix time."""
3196
3173
 
3197
3174
 
@@ -3313,16 +3290,15 @@ class ChatJoinRequest(Model):
3313
3290
  date: datetime = field()
3314
3291
  """Date the request was sent in Unix time."""
3315
3292
 
3316
- bio: Option[str] = field(default=Nothing, converter=From[str | None])
3293
+ bio: Option[str] = field(default=UNSET, converter=From[str | None])
3317
3294
  """Optional. Bio of the user."""
3318
3295
 
3319
- invite_link: Option[ChatInviteLink] = field(default=Nothing, converter=From["ChatInviteLink | None"])
3296
+ invite_link: Option[ChatInviteLink] = field(default=UNSET, converter=From["ChatInviteLink | None"])
3320
3297
  """Optional. Chat invite link that was used by the user to send the join request."""
3321
3298
 
3322
3299
  @property
3323
3300
  def chat_id(self) -> int:
3324
3301
  """`chat_id` instead of `chat.id`."""
3325
-
3326
3302
  return self.chat.id
3327
3303
 
3328
3304
 
@@ -3332,50 +3308,50 @@ class ChatPermissions(Model):
3332
3308
  Describes actions that a non-administrator user is allowed to take in a chat.
3333
3309
  """
3334
3310
 
3335
- can_send_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
3311
+ can_send_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3336
3312
  """Optional. True, if the user is allowed to send text messages, contacts,
3337
3313
  giveaways, giveaway winners, invoices, locations and venues."""
3338
3314
 
3339
- can_send_audios: Option[bool] = field(default=Nothing, converter=From[bool | None])
3315
+ can_send_audios: Option[bool] = field(default=UNSET, converter=From[bool | None])
3340
3316
  """Optional. True, if the user is allowed to send audios."""
3341
3317
 
3342
- can_send_documents: Option[bool] = field(default=Nothing, converter=From[bool | None])
3318
+ can_send_documents: Option[bool] = field(default=UNSET, converter=From[bool | None])
3343
3319
  """Optional. True, if the user is allowed to send documents."""
3344
3320
 
3345
- can_send_photos: Option[bool] = field(default=Nothing, converter=From[bool | None])
3321
+ can_send_photos: Option[bool] = field(default=UNSET, converter=From[bool | None])
3346
3322
  """Optional. True, if the user is allowed to send photos."""
3347
3323
 
3348
- can_send_videos: Option[bool] = field(default=Nothing, converter=From[bool | None])
3324
+ can_send_videos: Option[bool] = field(default=UNSET, converter=From[bool | None])
3349
3325
  """Optional. True, if the user is allowed to send videos."""
3350
3326
 
3351
- can_send_video_notes: Option[bool] = field(default=Nothing, converter=From[bool | None])
3327
+ can_send_video_notes: Option[bool] = field(default=UNSET, converter=From[bool | None])
3352
3328
  """Optional. True, if the user is allowed to send video notes."""
3353
3329
 
3354
- can_send_voice_notes: Option[bool] = field(default=Nothing, converter=From[bool | None])
3330
+ can_send_voice_notes: Option[bool] = field(default=UNSET, converter=From[bool | None])
3355
3331
  """Optional. True, if the user is allowed to send voice notes."""
3356
3332
 
3357
- can_send_polls: Option[bool] = field(default=Nothing, converter=From[bool | None])
3333
+ can_send_polls: Option[bool] = field(default=UNSET, converter=From[bool | None])
3358
3334
  """Optional. True, if the user is allowed to send polls."""
3359
3335
 
3360
- can_send_other_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
3336
+ can_send_other_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3361
3337
  """Optional. True, if the user is allowed to send animations, games, stickers
3362
3338
  and use inline bots."""
3363
3339
 
3364
- can_add_web_page_previews: Option[bool] = field(default=Nothing, converter=From[bool | None])
3340
+ can_add_web_page_previews: Option[bool] = field(default=UNSET, converter=From[bool | None])
3365
3341
  """Optional. True, if the user is allowed to add web page previews to their messages."""
3366
3342
 
3367
- can_change_info: Option[bool] = field(default=Nothing, converter=From[bool | None])
3343
+ can_change_info: Option[bool] = field(default=UNSET, converter=From[bool | None])
3368
3344
  """Optional. True, if the user is allowed to change the chat title, photo and
3369
3345
  other settings. Ignored in public supergroups."""
3370
3346
 
3371
- can_invite_users: Option[bool] = field(default=Nothing, converter=From[bool | None])
3347
+ can_invite_users: Option[bool] = field(default=UNSET, converter=From[bool | None])
3372
3348
  """Optional. True, if the user is allowed to invite new users to the chat."""
3373
3349
 
3374
- can_pin_messages: Option[bool] = field(default=Nothing, converter=From[bool | None])
3350
+ can_pin_messages: Option[bool] = field(default=UNSET, converter=From[bool | None])
3375
3351
  """Optional. True, if the user is allowed to pin messages. Ignored in public
3376
3352
  supergroups."""
3377
3353
 
3378
- can_manage_topics: Option[bool] = field(default=Nothing, converter=From[bool | None])
3354
+ can_manage_topics: Option[bool] = field(default=UNSET, converter=From[bool | None])
3379
3355
  """Optional. True, if the user is allowed to create forum topics. If omitted
3380
3356
  defaults to the value of can_pin_messages."""
3381
3357
 
@@ -3392,23 +3368,19 @@ class Birthdate(Model):
3392
3368
  month: int = field()
3393
3369
  """Month of the user's birth; 1-12."""
3394
3370
 
3395
- year: Option[int] = field(default=Nothing, converter=From[int | None])
3371
+ year: Option[int] = field(default=UNSET, converter=From[int | None])
3396
3372
  """Optional. Year of the user's birth."""
3397
3373
 
3398
3374
  @property
3399
3375
  def is_birthday(self) -> bool:
3400
3376
  """True, if today is a user's birthday."""
3401
-
3402
3377
  now = datetime.now()
3403
3378
  return now.month == self.month and now.day == self.day
3404
3379
 
3405
3380
  @property
3406
3381
  def age(self) -> Option[int]:
3407
3382
  """Optional. Contains the user's age, if the user has a birth year specified."""
3408
-
3409
- return self.year.map(
3410
- lambda year: ((datetime.now() - datetime(year, self.month, self.day)) // 365).days
3411
- )
3383
+ return self.year.map(lambda year: ((datetime.now() - datetime(year, self.month, self.day)) // 365).days)
3412
3384
 
3413
3385
 
3414
3386
  class BusinessIntro(Model):
@@ -3417,13 +3389,13 @@ class BusinessIntro(Model):
3417
3389
  Contains information about the start page settings of a Telegram Business account.
3418
3390
  """
3419
3391
 
3420
- title: Option[str] = field(default=Nothing, converter=From[str | None])
3392
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
3421
3393
  """Optional. Title text of the business intro."""
3422
3394
 
3423
- message: Option[str] = field(default=Nothing, converter=From[str | None])
3395
+ message: Option[str] = field(default=UNSET, converter=From[str | None])
3424
3396
  """Optional. Message text of the business intro."""
3425
3397
 
3426
- sticker: Option[Sticker] = field(default=Nothing, converter=From["Sticker | None"])
3398
+ sticker: Option[Sticker] = field(default=UNSET, converter=From["Sticker | None"])
3427
3399
  """Optional. Sticker of the business intro."""
3428
3400
 
3429
3401
 
@@ -3436,7 +3408,7 @@ class BusinessLocation(Model):
3436
3408
  address: str = field()
3437
3409
  """Address of the business."""
3438
3410
 
3439
- location: Option[Location] = field(default=Nothing, converter=From["Location | None"])
3411
+ location: Option[Location] = field(default=UNSET, converter=From["Location | None"])
3440
3412
  """Optional. Location of the business."""
3441
3413
 
3442
3414
 
@@ -3562,10 +3534,10 @@ class MessageReactionUpdated(Model):
3562
3534
  )
3563
3535
  """New list of reaction types that have been set by the user."""
3564
3536
 
3565
- user: Option[User] = field(default=Nothing, converter=From["User | None"])
3537
+ user: Option[User] = field(default=UNSET, converter=From["User | None"])
3566
3538
  """Optional. The user that changed the reaction, if the user isn't anonymous."""
3567
3539
 
3568
- actor_chat: Option[Chat] = field(default=Nothing, converter=From["Chat | None"])
3540
+ actor_chat: Option[Chat] = field(default=UNSET, converter=From["Chat | None"])
3569
3541
  """Optional. The chat on behalf of which the reaction was changed, if the user
3570
3542
  is anonymous."""
3571
3543
 
@@ -3604,7 +3576,7 @@ class ForumTopic(Model):
3604
3576
  icon_color: TopicIconColor = field()
3605
3577
  """Color of the topic icon in RGB format."""
3606
3578
 
3607
- icon_custom_emoji_id: Option[str] = field(default=Nothing, converter=From[str | None])
3579
+ icon_custom_emoji_id: Option[str] = field(default=UNSET, converter=From[str | None])
3608
3580
  """Optional. Unique identifier of the custom emoji shown as the topic icon."""
3609
3581
 
3610
3582
 
@@ -3816,15 +3788,15 @@ class ChatBoostSourceGiveaway(ChatBoostSource):
3816
3788
  source: typing.Literal["giveaway"] = field(default="giveaway")
3817
3789
  """Source of the boost, always `giveaway`."""
3818
3790
 
3819
- user: Option[User] = field(default=Nothing, converter=From["User | None"])
3791
+ user: Option[User] = field(default=UNSET, converter=From["User | None"])
3820
3792
  """Optional. User that won the prize in the giveaway if any; for Telegram Premium
3821
3793
  giveaways only."""
3822
3794
 
3823
- prize_star_count: Option[int] = field(default=Nothing, converter=From[int | None])
3795
+ prize_star_count: Option[int] = field(default=UNSET, converter=From[int | None])
3824
3796
  """Optional. The number of Telegram Stars to be split between giveaway winners;
3825
3797
  for Telegram Star giveaways only."""
3826
3798
 
3827
- is_unclaimed: Option[bool] = field(default=Nothing, converter=From[bool | None])
3799
+ is_unclaimed: Option[bool] = field(default=UNSET, converter=From[bool | None])
3828
3800
  """Optional. True, if the giveaway was completed, but there was no user to win
3829
3801
  the prize."""
3830
3802
 
@@ -3948,14 +3920,14 @@ class ResponseParameters(Model):
3948
3920
  Describes why a request was unsuccessful.
3949
3921
  """
3950
3922
 
3951
- migrate_to_chat_id: Option[int] = field(default=Nothing, converter=From[int | None])
3923
+ migrate_to_chat_id: Option[int] = field(default=UNSET, converter=From[int | None])
3952
3924
  """Optional. The group has been migrated to a supergroup with the specified
3953
3925
  identifier. This number may have more than 32 significant bits and some
3954
3926
  programming languages may have difficulty/silent defects in interpreting
3955
3927
  it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision
3956
3928
  float type are safe for storing this identifier."""
3957
3929
 
3958
- retry_after: Option[int] = field(default=Nothing, converter=From[int | None])
3930
+ retry_after: Option[int] = field(default=UNSET, converter=From[int | None])
3959
3931
  """Optional. In case of exceeding flood control, the number of seconds left
3960
3932
  to wait before the request can be repeated."""
3961
3933
 
@@ -3975,24 +3947,24 @@ class InputMediaPhoto(InputMedia):
3975
3947
  type: typing.Literal["photo"] = field(default="photo")
3976
3948
  """Type of the result, must be photo."""
3977
3949
 
3978
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
3950
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
3979
3951
  """Optional. Caption of the photo to be sent, 0-1024 characters after entities
3980
3952
  parsing."""
3981
3953
 
3982
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
3954
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
3983
3955
  """Optional. Mode for parsing entities in the photo caption. See formatting
3984
3956
  options for more details."""
3985
3957
 
3986
3958
  caption_entities: Option[list[MessageEntity]] = field(
3987
- default=Nothing, converter=From["list[MessageEntity] | None"]
3959
+ default=UNSET, converter=From["list[MessageEntity] | None"]
3988
3960
  )
3989
3961
  """Optional. List of special entities that appear in the caption, which can
3990
3962
  be specified instead of parse_mode."""
3991
3963
 
3992
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
3964
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
3993
3965
  """Optional. Pass True, if the caption must be shown above the message media."""
3994
3966
 
3995
- has_spoiler: Option[bool] = field(default=Nothing, converter=From[bool | None])
3967
+ has_spoiler: Option[bool] = field(default=UNSET, converter=From[bool | None])
3996
3968
  """Optional. Pass True if the photo needs to be covered with a spoiler animation."""
3997
3969
 
3998
3970
 
@@ -4011,9 +3983,7 @@ class InputMediaVideo(InputMedia):
4011
3983
  type: typing.Literal["video"] = field(default="video")
4012
3984
  """Type of the result, must be video."""
4013
3985
 
4014
- thumbnail: Option[Variative[InputFile, str]] = field(
4015
- default=Nothing, converter=From["InputFile | str | None"]
4016
- )
3986
+ thumbnail: Option[str] = field(default=UNSET, converter=From[str | None])
4017
3987
  """Optional. Thumbnail of the file sent; can be ignored if thumbnail generation
4018
3988
  for the file is supported server-side. The thumbnail should be in JPEG format
4019
3989
  and less than 200 kB in size. A thumbnail's width and height should not exceed
@@ -4022,36 +3992,46 @@ class InputMediaVideo(InputMedia):
4022
3992
  if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
4023
3993
  More information on Sending Files: https://core.telegram.org/bots/api#sending-files."""
4024
3994
 
4025
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
3995
+ cover: Option[Variative[InputFile, str]] = field(default=UNSET, converter=From["InputFile | str | None"])
3996
+ """Optional. Cover for the video in the message. Pass a file_id to send a file
3997
+ that exists on the Telegram servers (recommended), pass an HTTP URL for
3998
+ Telegram to get a file from the Internet, or pass `attach://<file_attach_name>`
3999
+ to upload a new one using multipart/form-data under <file_attach_name>
4000
+ name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files."""
4001
+
4002
+ start_timestamp: Option[int] = field(default=UNSET, converter=From[int | None])
4003
+ """Optional. Start timestamp for the video in the message."""
4004
+
4005
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4026
4006
  """Optional. Caption of the video to be sent, 0-1024 characters after entities
4027
4007
  parsing."""
4028
4008
 
4029
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4009
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4030
4010
  """Optional. Mode for parsing entities in the video caption. See formatting
4031
4011
  options for more details."""
4032
4012
 
4033
4013
  caption_entities: Option[list[MessageEntity]] = field(
4034
- default=Nothing, converter=From["list[MessageEntity] | None"]
4014
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4035
4015
  )
4036
4016
  """Optional. List of special entities that appear in the caption, which can
4037
4017
  be specified instead of parse_mode."""
4038
4018
 
4039
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
4019
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
4040
4020
  """Optional. Pass True, if the caption must be shown above the message media."""
4041
4021
 
4042
- width: Option[int] = field(default=Nothing, converter=From[int | None])
4022
+ width: Option[int] = field(default=UNSET, converter=From[int | None])
4043
4023
  """Optional. Video width."""
4044
4024
 
4045
- height: Option[int] = field(default=Nothing, converter=From[int | None])
4025
+ height: Option[int] = field(default=UNSET, converter=From[int | None])
4046
4026
  """Optional. Video height."""
4047
4027
 
4048
- duration: Option[int] = field(default=Nothing, converter=From[int | None])
4028
+ duration: Option[int] = field(default=UNSET, converter=From[int | None])
4049
4029
  """Optional. Video duration in seconds."""
4050
4030
 
4051
- supports_streaming: Option[bool] = field(default=Nothing, converter=From[bool | None])
4031
+ supports_streaming: Option[bool] = field(default=UNSET, converter=From[bool | None])
4052
4032
  """Optional. Pass True if the uploaded video is suitable for streaming."""
4053
4033
 
4054
- has_spoiler: Option[bool] = field(default=Nothing, converter=From[bool | None])
4034
+ has_spoiler: Option[bool] = field(default=UNSET, converter=From[bool | None])
4055
4035
  """Optional. Pass True if the video needs to be covered with a spoiler animation."""
4056
4036
 
4057
4037
 
@@ -4070,9 +4050,7 @@ class InputMediaAnimation(InputMedia):
4070
4050
  type: typing.Literal["animation"] = field(default="animation")
4071
4051
  """Type of the result, must be animation."""
4072
4052
 
4073
- thumbnail: Option[Variative[InputFile, str]] = field(
4074
- default=Nothing, converter=From["InputFile | str | None"]
4075
- )
4053
+ thumbnail: Option[str] = field(default=UNSET, converter=From[str | None])
4076
4054
  """Optional. Thumbnail of the file sent; can be ignored if thumbnail generation
4077
4055
  for the file is supported server-side. The thumbnail should be in JPEG format
4078
4056
  and less than 200 kB in size. A thumbnail's width and height should not exceed
@@ -4081,33 +4059,33 @@ class InputMediaAnimation(InputMedia):
4081
4059
  if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
4082
4060
  More information on Sending Files: https://core.telegram.org/bots/api#sending-files."""
4083
4061
 
4084
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4062
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4085
4063
  """Optional. Caption of the animation to be sent, 0-1024 characters after
4086
4064
  entities parsing."""
4087
4065
 
4088
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4066
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4089
4067
  """Optional. Mode for parsing entities in the animation caption. See formatting
4090
4068
  options for more details."""
4091
4069
 
4092
4070
  caption_entities: Option[list[MessageEntity]] = field(
4093
- default=Nothing, converter=From["list[MessageEntity] | None"]
4071
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4094
4072
  )
4095
4073
  """Optional. List of special entities that appear in the caption, which can
4096
4074
  be specified instead of parse_mode."""
4097
4075
 
4098
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
4076
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
4099
4077
  """Optional. Pass True, if the caption must be shown above the message media."""
4100
4078
 
4101
- width: Option[int] = field(default=Nothing, converter=From[int | None])
4079
+ width: Option[int] = field(default=UNSET, converter=From[int | None])
4102
4080
  """Optional. Animation width."""
4103
4081
 
4104
- height: Option[int] = field(default=Nothing, converter=From[int | None])
4082
+ height: Option[int] = field(default=UNSET, converter=From[int | None])
4105
4083
  """Optional. Animation height."""
4106
4084
 
4107
- duration: Option[int] = field(default=Nothing, converter=From[int | None])
4085
+ duration: Option[int] = field(default=UNSET, converter=From[int | None])
4108
4086
  """Optional. Animation duration in seconds."""
4109
4087
 
4110
- has_spoiler: Option[bool] = field(default=Nothing, converter=From[bool | None])
4088
+ has_spoiler: Option[bool] = field(default=UNSET, converter=From[bool | None])
4111
4089
  """Optional. Pass True if the animation needs to be covered with a spoiler animation."""
4112
4090
 
4113
4091
 
@@ -4126,9 +4104,7 @@ class InputMediaAudio(InputMedia):
4126
4104
  type: typing.Literal["audio"] = field(default="audio")
4127
4105
  """Type of the result, must be audio."""
4128
4106
 
4129
- thumbnail: Option[Variative[InputFile, str]] = field(
4130
- default=Nothing, converter=From["InputFile | str | None"]
4131
- )
4107
+ thumbnail: Option[str] = field(default=UNSET, converter=From[str | None])
4132
4108
  """Optional. Thumbnail of the file sent; can be ignored if thumbnail generation
4133
4109
  for the file is supported server-side. The thumbnail should be in JPEG format
4134
4110
  and less than 200 kB in size. A thumbnail's width and height should not exceed
@@ -4137,27 +4113,27 @@ class InputMediaAudio(InputMedia):
4137
4113
  if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
4138
4114
  More information on Sending Files: https://core.telegram.org/bots/api#sending-files."""
4139
4115
 
4140
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4116
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4141
4117
  """Optional. Caption of the audio to be sent, 0-1024 characters after entities
4142
4118
  parsing."""
4143
4119
 
4144
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4120
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4145
4121
  """Optional. Mode for parsing entities in the audio caption. See formatting
4146
4122
  options for more details."""
4147
4123
 
4148
4124
  caption_entities: Option[list[MessageEntity]] = field(
4149
- default=Nothing, converter=From["list[MessageEntity] | None"]
4125
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4150
4126
  )
4151
4127
  """Optional. List of special entities that appear in the caption, which can
4152
4128
  be specified instead of parse_mode."""
4153
4129
 
4154
- duration: Option[int] = field(default=Nothing, converter=From[int | None])
4130
+ duration: Option[int] = field(default=UNSET, converter=From[int | None])
4155
4131
  """Optional. Duration of the audio in seconds."""
4156
4132
 
4157
- performer: Option[str] = field(default=Nothing, converter=From[str | None])
4133
+ performer: Option[str] = field(default=UNSET, converter=From[str | None])
4158
4134
  """Optional. Performer of the audio."""
4159
4135
 
4160
- title: Option[str] = field(default=Nothing, converter=From[str | None])
4136
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
4161
4137
  """Optional. Title of the audio."""
4162
4138
 
4163
4139
 
@@ -4176,9 +4152,7 @@ class InputMediaDocument(InputMedia):
4176
4152
  type: typing.Literal["document"] = field(default="document")
4177
4153
  """Type of the result, must be document."""
4178
4154
 
4179
- thumbnail: Option[Variative[InputFile, str]] = field(
4180
- default=Nothing, converter=From["InputFile | str | None"]
4181
- )
4155
+ thumbnail: Option[str] = field(default=UNSET, converter=From[str | None])
4182
4156
  """Optional. Thumbnail of the file sent; can be ignored if thumbnail generation
4183
4157
  for the file is supported server-side. The thumbnail should be in JPEG format
4184
4158
  and less than 200 kB in size. A thumbnail's width and height should not exceed
@@ -4187,47 +4161,26 @@ class InputMediaDocument(InputMedia):
4187
4161
  if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
4188
4162
  More information on Sending Files: https://core.telegram.org/bots/api#sending-files."""
4189
4163
 
4190
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4164
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4191
4165
  """Optional. Caption of the document to be sent, 0-1024 characters after entities
4192
4166
  parsing."""
4193
4167
 
4194
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4168
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4195
4169
  """Optional. Mode for parsing entities in the document caption. See formatting
4196
4170
  options for more details."""
4197
4171
 
4198
4172
  caption_entities: Option[list[MessageEntity]] = field(
4199
- default=Nothing, converter=From["list[MessageEntity] | None"]
4173
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4200
4174
  )
4201
4175
  """Optional. List of special entities that appear in the caption, which can
4202
4176
  be specified instead of parse_mode."""
4203
4177
 
4204
- disable_content_type_detection: Option[bool] = field(default=Nothing, converter=From[bool | None])
4178
+ disable_content_type_detection: Option[bool] = field(default=UNSET, converter=From[bool | None])
4205
4179
  """Optional. Disables automatic server-side content type detection for
4206
4180
  files uploaded using multipart/form-data. Always True, if the document
4207
4181
  is sent as part of an album."""
4208
4182
 
4209
4183
 
4210
- class InputFile(typing.NamedTuple):
4211
- """NamedTuple object `InputFile`, see the [documentation](https://core.telegram.org/bots/api#inputfile).
4212
-
4213
- This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.
4214
- """
4215
-
4216
- filename: str
4217
- """File name."""
4218
-
4219
- data: bytes
4220
- """Bytes of file."""
4221
-
4222
- @classmethod
4223
- def from_file(cls, path: str | pathlib.Path) -> typing.Self:
4224
- path = pathlib.Path(path)
4225
- return cls(
4226
- filename=path.name,
4227
- data=path.read_bytes(),
4228
- )
4229
-
4230
-
4231
4184
  class InputPaidMediaPhoto(InputPaidMedia):
4232
4185
  """Object `InputPaidMediaPhoto`, see the [documentation](https://core.telegram.org/bots/api#inputpaidmediaphoto).
4233
4186
 
@@ -4259,9 +4212,7 @@ class InputPaidMediaVideo(InputPaidMedia):
4259
4212
  type: typing.Literal["video"] = field(default="video")
4260
4213
  """Type of the media, must be video."""
4261
4214
 
4262
- thumbnail: Option[Variative[InputFile, str]] = field(
4263
- default=Nothing, converter=From["InputFile | str | None"]
4264
- )
4215
+ thumbnail: Option[str] = field(default=UNSET, converter=From[str | None])
4265
4216
  """Optional. Thumbnail of the file sent; can be ignored if thumbnail generation
4266
4217
  for the file is supported server-side. The thumbnail should be in JPEG format
4267
4218
  and less than 200 kB in size. A thumbnail's width and height should not exceed
@@ -4270,16 +4221,26 @@ class InputPaidMediaVideo(InputPaidMedia):
4270
4221
  if the thumbnail was uploaded using multipart/form-data under <file_attach_name>.
4271
4222
  More information on Sending Files: https://core.telegram.org/bots/api#sending-files."""
4272
4223
 
4273
- width: Option[int] = field(default=Nothing, converter=From[int | None])
4224
+ cover: Option[Variative[InputFile, str]] = field(default=UNSET, converter=From["InputFile | str | None"])
4225
+ """Optional. Cover for the video in the message. Pass a file_id to send a file
4226
+ that exists on the Telegram servers (recommended), pass an HTTP URL for
4227
+ Telegram to get a file from the Internet, or pass `attach://<file_attach_name>`
4228
+ to upload a new one using multipart/form-data under <file_attach_name>
4229
+ name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files."""
4230
+
4231
+ start_timestamp: Option[int] = field(default=UNSET, converter=From[int | None])
4232
+ """Optional. Start timestamp for the video in the message."""
4233
+
4234
+ width: Option[int] = field(default=UNSET, converter=From[int | None])
4274
4235
  """Optional. Video width."""
4275
4236
 
4276
- height: Option[int] = field(default=Nothing, converter=From[int | None])
4237
+ height: Option[int] = field(default=UNSET, converter=From[int | None])
4277
4238
  """Optional. Video height."""
4278
4239
 
4279
- duration: Option[int] = field(default=Nothing, converter=From[int | None])
4240
+ duration: Option[int] = field(default=UNSET, converter=From[int | None])
4280
4241
  """Optional. Video duration in seconds."""
4281
4242
 
4282
- supports_streaming: Option[bool] = field(default=Nothing, converter=From[bool | None])
4243
+ supports_streaming: Option[bool] = field(default=UNSET, converter=From[bool | None])
4283
4244
  """Optional. Pass True if the uploaded video is suitable for streaming."""
4284
4245
 
4285
4246
 
@@ -4313,30 +4274,30 @@ class Sticker(Model):
4313
4274
  The type of the sticker is independent from its format, which is determined
4314
4275
  by the fields is_animated and is_video."""
4315
4276
 
4316
- thumbnail: Option[PhotoSize] = field(default=Nothing, converter=From["PhotoSize | None"])
4277
+ thumbnail: Option[PhotoSize] = field(default=UNSET, converter=From["PhotoSize | None"])
4317
4278
  """Optional. Sticker thumbnail in the .WEBP or .JPG format."""
4318
4279
 
4319
- emoji: Option[str] = field(default=Nothing, converter=From[str | None])
4280
+ emoji: Option[str] = field(default=UNSET, converter=From[str | None])
4320
4281
  """Optional. Emoji associated with the sticker."""
4321
4282
 
4322
- set_name: Option[str] = field(default=Nothing, converter=From[str | None])
4283
+ set_name: Option[str] = field(default=UNSET, converter=From[str | None])
4323
4284
  """Optional. Name of the sticker set to which the sticker belongs."""
4324
4285
 
4325
- premium_animation: Option[File] = field(default=Nothing, converter=From["File | None"])
4286
+ premium_animation: Option[File] = field(default=UNSET, converter=From["File | None"])
4326
4287
  """Optional. For premium regular stickers, premium animation for the sticker."""
4327
4288
 
4328
- mask_position: Option[MaskPosition] = field(default=Nothing, converter=From["MaskPosition | None"])
4289
+ mask_position: Option[MaskPosition] = field(default=UNSET, converter=From["MaskPosition | None"])
4329
4290
  """Optional. For mask stickers, the position where the mask should be placed."""
4330
4291
 
4331
- custom_emoji_id: Option[str] = field(default=Nothing, converter=From[str | None])
4292
+ custom_emoji_id: Option[str] = field(default=UNSET, converter=From[str | None])
4332
4293
  """Optional. For custom emoji stickers, unique identifier of the custom emoji."""
4333
4294
 
4334
- needs_repainting: Option[bool] = field(default=Nothing, converter=From[bool | None])
4295
+ needs_repainting: Option[bool] = field(default=UNSET, converter=From[bool | None])
4335
4296
  """Optional. True, if the sticker must be repainted to a text color in messages,
4336
4297
  the color of the Telegram Premium badge in emoji status, white color on chat
4337
4298
  photos, or another appropriate color in other places."""
4338
4299
 
4339
- file_size: Option[int] = field(default=Nothing, converter=From[int | None])
4300
+ file_size: Option[int] = field(default=UNSET, converter=From[int | None])
4340
4301
  """Optional. File size in bytes."""
4341
4302
 
4342
4303
 
@@ -4358,7 +4319,7 @@ class StickerSet(Model):
4358
4319
  sticker_type: typing.Literal["regular", "mask", "custom_emoji"] = field(default="regular")
4359
4320
  """Type of stickers in the set, currently one of `regular`, `mask`, `custom_emoji`."""
4360
4321
 
4361
- thumbnail: Option[PhotoSize] = field(default=Nothing, converter=From["PhotoSize | None"])
4322
+ thumbnail: Option[PhotoSize] = field(default=UNSET, converter=From["PhotoSize | None"])
4362
4323
  """Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format."""
4363
4324
 
4364
4325
 
@@ -4402,20 +4363,58 @@ class InputSticker(Model):
4402
4363
 
4403
4364
  format: str = field()
4404
4365
  """Format of the added sticker, must be one of `static` for a .WEBP or .PNG image,
4405
- `animated` for a .TGS animation, `video` for a WEBM video."""
4366
+ `animated` for a .TGS animation, `video` for a .WEBM video."""
4406
4367
 
4407
4368
  emoji_list: list[str] = field()
4408
4369
  """List of 1-20 emoji associated with the sticker."""
4409
4370
 
4410
- mask_position: Option[MaskPosition] = field(default=Nothing, converter=From["MaskPosition | None"])
4371
+ mask_position: Option[MaskPosition] = field(default=UNSET, converter=From["MaskPosition | None"])
4411
4372
  """Optional. Position where the mask should be placed on faces. For `mask`
4412
4373
  stickers only."""
4413
4374
 
4414
- keywords: Option[list[str]] = field(default=Nothing, converter=From[list[str] | None])
4375
+ keywords: Option[list[str]] = field(default=UNSET, converter=From[list[str] | None])
4415
4376
  """Optional. List of 0-20 search keywords for the sticker with total length
4416
4377
  of up to 64 characters. For `regular` and `custom_emoji` stickers only."""
4417
4378
 
4418
4379
 
4380
+ class Gift(Model):
4381
+ """Object `Gift`, see the [documentation](https://core.telegram.org/bots/api#gift).
4382
+
4383
+ This object represents a gift that can be sent by the bot.
4384
+ """
4385
+
4386
+ id: str = field()
4387
+ """Unique identifier of the gift."""
4388
+
4389
+ sticker: Sticker = field()
4390
+ """The sticker that represents the gift."""
4391
+
4392
+ star_count: int = field()
4393
+ """The number of Telegram Stars that must be paid to send the sticker."""
4394
+
4395
+ upgrade_star_count: Option[int] = field(default=UNSET, converter=From[int | None])
4396
+ """Optional. The number of Telegram Stars that must be paid to upgrade the gift
4397
+ to a unique one."""
4398
+
4399
+ total_count: Option[int] = field(default=UNSET, converter=From[int | None])
4400
+ """Optional. The total number of the gifts of this type that can be sent; for
4401
+ limited gifts only."""
4402
+
4403
+ remaining_count: Option[int] = field(default=UNSET, converter=From[int | None])
4404
+ """Optional. The number of remaining gifts of this type that can be sent; for
4405
+ limited gifts only."""
4406
+
4407
+
4408
+ class Gifts(Model):
4409
+ """Object `Gifts`, see the [documentation](https://core.telegram.org/bots/api#gifts).
4410
+
4411
+ This object represent a list of gifts.
4412
+ """
4413
+
4414
+ gifts: list[Gift] = field()
4415
+ """The list of gifts."""
4416
+
4417
+
4419
4418
  class InlineQuery(Model):
4420
4419
  """Object `InlineQuery`, see the [documentation](https://core.telegram.org/bots/api#inlinequery).
4421
4420
 
@@ -4434,14 +4433,14 @@ class InlineQuery(Model):
4434
4433
  offset: str = field()
4435
4434
  """Offset of the results to be returned, can be controlled by the bot."""
4436
4435
 
4437
- chat_type: Option[ChatType] = field(default=Nothing)
4436
+ chat_type: Option[ChatType] = field(default=UNSET)
4438
4437
  """Optional. Type of the chat from which the inline query was sent. Can be either
4439
4438
  `sender` for a private chat with the inline query sender, `private`, `group`,
4440
4439
  `supergroup`, or `channel`. The chat type should be always known for requests
4441
4440
  sent from official clients and most third-party clients, unless the request
4442
4441
  was sent from a secret chat."""
4443
4442
 
4444
- location: Option[Location] = field(default=Nothing, converter=From["Location | None"])
4443
+ location: Option[Location] = field(default=UNSET, converter=From["Location | None"])
4445
4444
  """Optional. Sender location, only for bots that request user location."""
4446
4445
 
4447
4446
 
@@ -4454,12 +4453,12 @@ class InlineQueryResultsButton(Model):
4454
4453
  text: str = field()
4455
4454
  """Label text on the button."""
4456
4455
 
4457
- web_app: Option[WebAppInfo] = field(default=Nothing, converter=From["WebAppInfo | None"])
4456
+ web_app: Option[WebAppInfo] = field(default=UNSET, converter=From["WebAppInfo | None"])
4458
4457
  """Optional. Description of the Web App that will be launched when the user
4459
4458
  presses the button. The Web App will be able to switch back to the inline mode
4460
4459
  using the method switchInlineQuery inside the Web App."""
4461
4460
 
4462
- start_parameter: Option[str] = field(default=Nothing, converter=From[str | None])
4461
+ start_parameter: Option[str] = field(default=UNSET, converter=From[str | None])
4463
4462
  """Optional. Deep-linking parameter for the /start message sent to the bot
4464
4463
  when a user presses the button. 1-64 characters, only A-Z, a-z, 0-9, _ and
4465
4464
  - are allowed. Example: An inline bot that sends YouTube videos can ask the
@@ -4498,31 +4497,28 @@ class InlineQueryResultArticle(InlineQueryResult):
4498
4497
  """Type of the result, must be article."""
4499
4498
 
4500
4499
  id: str = field(
4501
- default_factory=lambda: generate_random_id(64),
4500
+ default_factory=lambda: secrets.token_urlsafe(64),
4502
4501
  )
4503
4502
  """Unique identifier for this result, 1-64 Bytes."""
4504
4503
 
4505
4504
  reply_markup: Option[InlineKeyboardMarkup] = field(
4506
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
4505
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
4507
4506
  )
4508
4507
  """Optional. Inline keyboard attached to the message."""
4509
4508
 
4510
- url: Option[str] = field(default=Nothing, converter=From[str | None])
4509
+ url: Option[str] = field(default=UNSET, converter=From[str | None])
4511
4510
  """Optional. URL of the result."""
4512
4511
 
4513
- hide_url: Option[bool] = field(default=Nothing, converter=From[bool | None])
4514
- """Optional. Pass True if you don't want the URL to be shown in the message."""
4515
-
4516
- description: Option[str] = field(default=Nothing, converter=From[str | None])
4512
+ description: Option[str] = field(default=UNSET, converter=From[str | None])
4517
4513
  """Optional. Short description of the result."""
4518
4514
 
4519
- thumbnail_url: Option[str] = field(default=Nothing, converter=From[str | None])
4515
+ thumbnail_url: Option[str] = field(default=UNSET, converter=From[str | None])
4520
4516
  """Optional. Url of the thumbnail for the result."""
4521
4517
 
4522
- thumbnail_width: Option[int] = field(default=Nothing, converter=From[int | None])
4518
+ thumbnail_width: Option[int] = field(default=UNSET, converter=From[int | None])
4523
4519
  """Optional. Thumbnail width."""
4524
4520
 
4525
- thumbnail_height: Option[int] = field(default=Nothing, converter=From[int | None])
4521
+ thumbnail_height: Option[int] = field(default=UNSET, converter=From[int | None])
4526
4522
  """Optional. Thumbnail height."""
4527
4523
 
4528
4524
 
@@ -4543,41 +4539,41 @@ class InlineQueryResultPhoto(InlineQueryResult):
4543
4539
  """Type of the result, must be photo."""
4544
4540
 
4545
4541
  id: str = field(
4546
- default_factory=lambda: generate_random_id(64),
4542
+ default_factory=lambda: secrets.token_urlsafe(64),
4547
4543
  )
4548
4544
  """Unique identifier for this result, 1-64 bytes."""
4549
4545
 
4550
- photo_width: Option[int] = field(default=Nothing, converter=From[int | None])
4546
+ photo_width: Option[int] = field(default=UNSET, converter=From[int | None])
4551
4547
  """Optional. Width of the photo."""
4552
4548
 
4553
- photo_height: Option[int] = field(default=Nothing, converter=From[int | None])
4549
+ photo_height: Option[int] = field(default=UNSET, converter=From[int | None])
4554
4550
  """Optional. Height of the photo."""
4555
4551
 
4556
- title: Option[str] = field(default=Nothing, converter=From[str | None])
4552
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
4557
4553
  """Optional. Title for the result."""
4558
4554
 
4559
- description: Option[str] = field(default=Nothing, converter=From[str | None])
4555
+ description: Option[str] = field(default=UNSET, converter=From[str | None])
4560
4556
  """Optional. Short description of the result."""
4561
4557
 
4562
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4558
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4563
4559
  """Optional. Caption of the photo to be sent, 0-1024 characters after entities
4564
4560
  parsing."""
4565
4561
 
4566
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4562
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4567
4563
  """Optional. Mode for parsing entities in the photo caption. See formatting
4568
4564
  options for more details."""
4569
4565
 
4570
4566
  caption_entities: Option[list[MessageEntity]] = field(
4571
- default=Nothing, converter=From["list[MessageEntity] | None"]
4567
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4572
4568
  )
4573
4569
  """Optional. List of special entities that appear in the caption, which can
4574
4570
  be specified instead of parse_mode."""
4575
4571
 
4576
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
4572
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
4577
4573
  """Optional. Pass True, if the caption must be shown above the message media."""
4578
4574
 
4579
4575
  reply_markup: Option[InlineKeyboardMarkup] = field(
4580
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
4576
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
4581
4577
  )
4582
4578
  """Optional. Inline keyboard attached to the message."""
4583
4579
 
@@ -4590,7 +4586,7 @@ class InlineQueryResultPhoto(InlineQueryResult):
4590
4586
  InputInvoiceMessageContent,
4591
4587
  ]
4592
4588
  ] = field(
4593
- default=Nothing,
4589
+ default=UNSET,
4594
4590
  converter=From[
4595
4591
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
4596
4592
  ],
@@ -4605,7 +4601,7 @@ class InlineQueryResultGif(InlineQueryResult):
4605
4601
  """
4606
4602
 
4607
4603
  gif_url: str = field()
4608
- """A valid URL for the GIF file. File size must not exceed 1MB."""
4604
+ """A valid URL for the GIF file."""
4609
4605
 
4610
4606
  thumbnail_url: str = field()
4611
4607
  """URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result."""
@@ -4614,47 +4610,45 @@ class InlineQueryResultGif(InlineQueryResult):
4614
4610
  """Type of the result, must be gif."""
4615
4611
 
4616
4612
  id: str = field(
4617
- default_factory=lambda: generate_random_id(64),
4613
+ default_factory=lambda: secrets.token_urlsafe(64),
4618
4614
  )
4619
4615
  """Unique identifier for this result, 1-64 bytes."""
4620
4616
 
4621
- gif_width: Option[int] = field(default=Nothing, converter=From[int | None])
4617
+ gif_width: Option[int] = field(default=UNSET, converter=From[int | None])
4622
4618
  """Optional. Width of the GIF."""
4623
4619
 
4624
- gif_height: Option[int] = field(default=Nothing, converter=From[int | None])
4620
+ gif_height: Option[int] = field(default=UNSET, converter=From[int | None])
4625
4621
  """Optional. Height of the GIF."""
4626
4622
 
4627
- gif_duration: Option[int] = field(default=Nothing, converter=From[int | None])
4623
+ gif_duration: Option[int] = field(default=UNSET, converter=From[int | None])
4628
4624
  """Optional. Duration of the GIF in seconds."""
4629
4625
 
4630
- thumbnail_mime_type: Option[typing.Literal["image/jpeg", "image/gif", "video/mp4"]] = field(
4631
- default=Nothing
4632
- )
4626
+ thumbnail_mime_type: Option[typing.Literal["image/jpeg", "image/gif", "video/mp4"]] = field(default=UNSET)
4633
4627
  """Optional. MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
4634
4628
  or `video/mp4`. Defaults to `image/jpeg`."""
4635
4629
 
4636
- title: Option[str] = field(default=Nothing, converter=From[str | None])
4630
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
4637
4631
  """Optional. Title for the result."""
4638
4632
 
4639
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4633
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4640
4634
  """Optional. Caption of the GIF file to be sent, 0-1024 characters after entities
4641
4635
  parsing."""
4642
4636
 
4643
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4637
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4644
4638
  """Optional. Mode for parsing entities in the caption. See formatting options
4645
4639
  for more details."""
4646
4640
 
4647
4641
  caption_entities: Option[list[MessageEntity]] = field(
4648
- default=Nothing, converter=From["list[MessageEntity] | None"]
4642
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4649
4643
  )
4650
4644
  """Optional. List of special entities that appear in the caption, which can
4651
4645
  be specified instead of parse_mode."""
4652
4646
 
4653
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
4647
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
4654
4648
  """Optional. Pass True, if the caption must be shown above the message media."""
4655
4649
 
4656
4650
  reply_markup: Option[InlineKeyboardMarkup] = field(
4657
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
4651
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
4658
4652
  )
4659
4653
  """Optional. Inline keyboard attached to the message."""
4660
4654
 
@@ -4667,7 +4661,7 @@ class InlineQueryResultGif(InlineQueryResult):
4667
4661
  InputInvoiceMessageContent,
4668
4662
  ]
4669
4663
  ] = field(
4670
- default=Nothing,
4664
+ default=UNSET,
4671
4665
  converter=From[
4672
4666
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
4673
4667
  ],
@@ -4682,7 +4676,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
4682
4676
  """
4683
4677
 
4684
4678
  mpeg4_url: str = field()
4685
- """A valid URL for the MPEG4 file. File size must not exceed 1MB."""
4679
+ """A valid URL for the MPEG4 file."""
4686
4680
 
4687
4681
  thumbnail_url: str = field()
4688
4682
  """URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result."""
@@ -4691,47 +4685,45 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
4691
4685
  """Type of the result, must be mpeg4_gif."""
4692
4686
 
4693
4687
  id: str = field(
4694
- default_factory=lambda: generate_random_id(64),
4688
+ default_factory=lambda: secrets.token_urlsafe(64),
4695
4689
  )
4696
4690
  """Unique identifier for this result, 1-64 bytes."""
4697
4691
 
4698
- mpeg4_width: Option[int] = field(default=Nothing, converter=From[int | None])
4692
+ mpeg4_width: Option[int] = field(default=UNSET, converter=From[int | None])
4699
4693
  """Optional. Video width."""
4700
4694
 
4701
- mpeg4_height: Option[int] = field(default=Nothing, converter=From[int | None])
4695
+ mpeg4_height: Option[int] = field(default=UNSET, converter=From[int | None])
4702
4696
  """Optional. Video height."""
4703
4697
 
4704
- mpeg4_duration: Option[int] = field(default=Nothing, converter=From[int | None])
4698
+ mpeg4_duration: Option[int] = field(default=UNSET, converter=From[int | None])
4705
4699
  """Optional. Video duration in seconds."""
4706
4700
 
4707
- thumbnail_mime_type: Option[typing.Literal["image/jpeg", "image/gif", "video/mp4"]] = field(
4708
- default=Nothing
4709
- )
4701
+ thumbnail_mime_type: Option[typing.Literal["image/jpeg", "image/gif", "video/mp4"]] = field(default=UNSET)
4710
4702
  """Optional. MIME type of the thumbnail, must be one of `image/jpeg`, `image/gif`,
4711
4703
  or `video/mp4`. Defaults to `image/jpeg`."""
4712
4704
 
4713
- title: Option[str] = field(default=Nothing, converter=From[str | None])
4705
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
4714
4706
  """Optional. Title for the result."""
4715
4707
 
4716
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4708
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4717
4709
  """Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after
4718
4710
  entities parsing."""
4719
4711
 
4720
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4712
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4721
4713
  """Optional. Mode for parsing entities in the caption. See formatting options
4722
4714
  for more details."""
4723
4715
 
4724
4716
  caption_entities: Option[list[MessageEntity]] = field(
4725
- default=Nothing, converter=From["list[MessageEntity] | None"]
4717
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4726
4718
  )
4727
4719
  """Optional. List of special entities that appear in the caption, which can
4728
4720
  be specified instead of parse_mode."""
4729
4721
 
4730
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
4722
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
4731
4723
  """Optional. Pass True, if the caption must be shown above the message media."""
4732
4724
 
4733
4725
  reply_markup: Option[InlineKeyboardMarkup] = field(
4734
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
4726
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
4735
4727
  )
4736
4728
  """Optional. Inline keyboard attached to the message."""
4737
4729
 
@@ -4744,7 +4736,7 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
4744
4736
  InputInvoiceMessageContent,
4745
4737
  ]
4746
4738
  ] = field(
4747
- default=Nothing,
4739
+ default=UNSET,
4748
4740
  converter=From[
4749
4741
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
4750
4742
  ],
@@ -4774,41 +4766,41 @@ class InlineQueryResultVideo(InlineQueryResult):
4774
4766
  """Type of the result, must be video."""
4775
4767
 
4776
4768
  id: str = field(
4777
- default_factory=lambda: generate_random_id(64),
4769
+ default_factory=lambda: secrets.token_urlsafe(64),
4778
4770
  )
4779
4771
  """Unique identifier for this result, 1-64 bytes."""
4780
4772
 
4781
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4773
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4782
4774
  """Optional. Caption of the video to be sent, 0-1024 characters after entities
4783
4775
  parsing."""
4784
4776
 
4785
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4777
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4786
4778
  """Optional. Mode for parsing entities in the video caption. See formatting
4787
4779
  options for more details."""
4788
4780
 
4789
4781
  caption_entities: Option[list[MessageEntity]] = field(
4790
- default=Nothing, converter=From["list[MessageEntity] | None"]
4782
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4791
4783
  )
4792
4784
  """Optional. List of special entities that appear in the caption, which can
4793
4785
  be specified instead of parse_mode."""
4794
4786
 
4795
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
4787
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
4796
4788
  """Optional. Pass True, if the caption must be shown above the message media."""
4797
4789
 
4798
- video_width: Option[int] = field(default=Nothing, converter=From[int | None])
4790
+ video_width: Option[int] = field(default=UNSET, converter=From[int | None])
4799
4791
  """Optional. Video width."""
4800
4792
 
4801
- video_height: Option[int] = field(default=Nothing, converter=From[int | None])
4793
+ video_height: Option[int] = field(default=UNSET, converter=From[int | None])
4802
4794
  """Optional. Video height."""
4803
4795
 
4804
- video_duration: Option[int] = field(default=Nothing, converter=From[int | None])
4796
+ video_duration: Option[int] = field(default=UNSET, converter=From[int | None])
4805
4797
  """Optional. Video duration in seconds."""
4806
4798
 
4807
- description: Option[str] = field(default=Nothing, converter=From[str | None])
4799
+ description: Option[str] = field(default=UNSET, converter=From[str | None])
4808
4800
  """Optional. Short description of the result."""
4809
4801
 
4810
4802
  reply_markup: Option[InlineKeyboardMarkup] = field(
4811
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
4803
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
4812
4804
  )
4813
4805
  """Optional. Inline keyboard attached to the message."""
4814
4806
 
@@ -4821,7 +4813,7 @@ class InlineQueryResultVideo(InlineQueryResult):
4821
4813
  InputInvoiceMessageContent,
4822
4814
  ]
4823
4815
  ] = field(
4824
- default=Nothing,
4816
+ default=UNSET,
4825
4817
  converter=From[
4826
4818
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
4827
4819
  ],
@@ -4847,31 +4839,31 @@ class InlineQueryResultAudio(InlineQueryResult):
4847
4839
  """Type of the result, must be audio."""
4848
4840
 
4849
4841
  id: str = field(
4850
- default_factory=lambda: generate_random_id(64),
4842
+ default_factory=lambda: secrets.token_urlsafe(64),
4851
4843
  )
4852
4844
  """Unique identifier for this result, 1-64 bytes."""
4853
4845
 
4854
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4846
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4855
4847
  """Optional. Caption, 0-1024 characters after entities parsing."""
4856
4848
 
4857
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4849
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4858
4850
  """Optional. Mode for parsing entities in the audio caption. See formatting
4859
4851
  options for more details."""
4860
4852
 
4861
4853
  caption_entities: Option[list[MessageEntity]] = field(
4862
- default=Nothing, converter=From["list[MessageEntity] | None"]
4854
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4863
4855
  )
4864
4856
  """Optional. List of special entities that appear in the caption, which can
4865
4857
  be specified instead of parse_mode."""
4866
4858
 
4867
- performer: Option[str] = field(default=Nothing, converter=From[str | None])
4859
+ performer: Option[str] = field(default=UNSET, converter=From[str | None])
4868
4860
  """Optional. Performer."""
4869
4861
 
4870
- audio_duration: Option[int] = field(default=Nothing, converter=From[int | None])
4862
+ audio_duration: Option[int] = field(default=UNSET, converter=From[int | None])
4871
4863
  """Optional. Audio duration in seconds."""
4872
4864
 
4873
4865
  reply_markup: Option[InlineKeyboardMarkup] = field(
4874
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
4866
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
4875
4867
  )
4876
4868
  """Optional. Inline keyboard attached to the message."""
4877
4869
 
@@ -4884,7 +4876,7 @@ class InlineQueryResultAudio(InlineQueryResult):
4884
4876
  InputInvoiceMessageContent,
4885
4877
  ]
4886
4878
  ] = field(
4887
- default=Nothing,
4879
+ default=UNSET,
4888
4880
  converter=From[
4889
4881
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
4890
4882
  ],
@@ -4908,28 +4900,28 @@ class InlineQueryResultVoice(InlineQueryResult):
4908
4900
  """Type of the result, must be voice."""
4909
4901
 
4910
4902
  id: str = field(
4911
- default_factory=lambda: generate_random_id(64),
4903
+ default_factory=lambda: secrets.token_urlsafe(64),
4912
4904
  )
4913
4905
  """Unique identifier for this result, 1-64 bytes."""
4914
4906
 
4915
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4907
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4916
4908
  """Optional. Caption, 0-1024 characters after entities parsing."""
4917
4909
 
4918
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4910
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4919
4911
  """Optional. Mode for parsing entities in the voice message caption. See formatting
4920
4912
  options for more details."""
4921
4913
 
4922
4914
  caption_entities: Option[list[MessageEntity]] = field(
4923
- default=Nothing, converter=From["list[MessageEntity] | None"]
4915
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4924
4916
  )
4925
4917
  """Optional. List of special entities that appear in the caption, which can
4926
4918
  be specified instead of parse_mode."""
4927
4919
 
4928
- voice_duration: Option[int] = field(default=Nothing, converter=From[int | None])
4920
+ voice_duration: Option[int] = field(default=UNSET, converter=From[int | None])
4929
4921
  """Optional. Recording duration in seconds."""
4930
4922
 
4931
4923
  reply_markup: Option[InlineKeyboardMarkup] = field(
4932
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
4924
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
4933
4925
  )
4934
4926
  """Optional. Inline keyboard attached to the message."""
4935
4927
 
@@ -4942,7 +4934,7 @@ class InlineQueryResultVoice(InlineQueryResult):
4942
4934
  InputInvoiceMessageContent,
4943
4935
  ]
4944
4936
  ] = field(
4945
- default=Nothing,
4937
+ default=UNSET,
4946
4938
  converter=From[
4947
4939
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
4948
4940
  ],
@@ -4969,29 +4961,29 @@ class InlineQueryResultDocument(InlineQueryResult):
4969
4961
  """MIME type of the content of the file, either `application/pdf` or `application/zip`."""
4970
4962
 
4971
4963
  id: str = field(
4972
- default_factory=lambda: generate_random_id(64),
4964
+ default_factory=lambda: secrets.token_urlsafe(64),
4973
4965
  )
4974
4966
  """Unique identifier for this result, 1-64 bytes."""
4975
4967
 
4976
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
4968
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
4977
4969
  """Optional. Caption of the document to be sent, 0-1024 characters after entities
4978
4970
  parsing."""
4979
4971
 
4980
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
4972
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
4981
4973
  """Optional. Mode for parsing entities in the document caption. See formatting
4982
4974
  options for more details."""
4983
4975
 
4984
4976
  caption_entities: Option[list[MessageEntity]] = field(
4985
- default=Nothing, converter=From["list[MessageEntity] | None"]
4977
+ default=UNSET, converter=From["list[MessageEntity] | None"]
4986
4978
  )
4987
4979
  """Optional. List of special entities that appear in the caption, which can
4988
4980
  be specified instead of parse_mode."""
4989
4981
 
4990
- description: Option[str] = field(default=Nothing, converter=From[str | None])
4982
+ description: Option[str] = field(default=UNSET, converter=From[str | None])
4991
4983
  """Optional. Short description of the result."""
4992
4984
 
4993
4985
  reply_markup: Option[InlineKeyboardMarkup] = field(
4994
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
4986
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
4995
4987
  )
4996
4988
  """Optional. Inline keyboard attached to the message."""
4997
4989
 
@@ -5004,20 +4996,20 @@ class InlineQueryResultDocument(InlineQueryResult):
5004
4996
  InputInvoiceMessageContent,
5005
4997
  ]
5006
4998
  ] = field(
5007
- default=Nothing,
4999
+ default=UNSET,
5008
5000
  converter=From[
5009
5001
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5010
5002
  ],
5011
5003
  )
5012
5004
  """Optional. Content of the message to be sent instead of the file."""
5013
5005
 
5014
- thumbnail_url: Option[str] = field(default=Nothing, converter=From[str | None])
5006
+ thumbnail_url: Option[str] = field(default=UNSET, converter=From[str | None])
5015
5007
  """Optional. URL of the thumbnail (JPEG only) for the file."""
5016
5008
 
5017
- thumbnail_width: Option[int] = field(default=Nothing, converter=From[int | None])
5009
+ thumbnail_width: Option[int] = field(default=UNSET, converter=From[int | None])
5018
5010
  """Optional. Thumbnail width."""
5019
5011
 
5020
- thumbnail_height: Option[int] = field(default=Nothing, converter=From[int | None])
5012
+ thumbnail_height: Option[int] = field(default=UNSET, converter=From[int | None])
5021
5013
  """Optional. Thumbnail height."""
5022
5014
 
5023
5015
 
@@ -5040,30 +5032,30 @@ class InlineQueryResultLocation(InlineQueryResult):
5040
5032
  """Type of the result, must be location."""
5041
5033
 
5042
5034
  id: str = field(
5043
- default_factory=lambda: generate_random_id(64),
5035
+ default_factory=lambda: secrets.token_urlsafe(64),
5044
5036
  )
5045
5037
  """Unique identifier for this result, 1-64 Bytes."""
5046
5038
 
5047
- horizontal_accuracy: Option[float] = field(default=Nothing, converter=From[float | None])
5039
+ horizontal_accuracy: Option[float] = field(default=UNSET, converter=From[float | None])
5048
5040
  """Optional. The radius of uncertainty for the location, measured in meters;
5049
5041
  0-1500."""
5050
5042
 
5051
- live_period: Option[int] = field(default=Nothing, converter=From[int | None])
5043
+ live_period: Option[int] = field(default=UNSET, converter=From[int | None])
5052
5044
  """Optional. Period in seconds during which the location can be updated, should
5053
5045
  be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited
5054
5046
  indefinitely."""
5055
5047
 
5056
- heading: Option[int] = field(default=Nothing, converter=From[int | None])
5048
+ heading: Option[int] = field(default=UNSET, converter=From[int | None])
5057
5049
  """Optional. For live locations, a direction in which the user is moving, in
5058
5050
  degrees. Must be between 1 and 360 if specified."""
5059
5051
 
5060
- proximity_alert_radius: Option[int] = field(default=Nothing, converter=From[int | None])
5052
+ proximity_alert_radius: Option[int] = field(default=UNSET, converter=From[int | None])
5061
5053
  """Optional. For live locations, a maximum distance for proximity alerts
5062
5054
  about approaching another chat member, in meters. Must be between 1 and
5063
5055
  100000 if specified."""
5064
5056
 
5065
5057
  reply_markup: Option[InlineKeyboardMarkup] = field(
5066
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5058
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5067
5059
  )
5068
5060
  """Optional. Inline keyboard attached to the message."""
5069
5061
 
@@ -5076,20 +5068,20 @@ class InlineQueryResultLocation(InlineQueryResult):
5076
5068
  InputInvoiceMessageContent,
5077
5069
  ]
5078
5070
  ] = field(
5079
- default=Nothing,
5071
+ default=UNSET,
5080
5072
  converter=From[
5081
5073
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5082
5074
  ],
5083
5075
  )
5084
5076
  """Optional. Content of the message to be sent instead of the location."""
5085
5077
 
5086
- thumbnail_url: Option[str] = field(default=Nothing, converter=From[str | None])
5078
+ thumbnail_url: Option[str] = field(default=UNSET, converter=From[str | None])
5087
5079
  """Optional. Url of the thumbnail for the result."""
5088
5080
 
5089
- thumbnail_width: Option[int] = field(default=Nothing, converter=From[int | None])
5081
+ thumbnail_width: Option[int] = field(default=UNSET, converter=From[int | None])
5090
5082
  """Optional. Thumbnail width."""
5091
5083
 
5092
- thumbnail_height: Option[int] = field(default=Nothing, converter=From[int | None])
5084
+ thumbnail_height: Option[int] = field(default=UNSET, converter=From[int | None])
5093
5085
  """Optional. Thumbnail height."""
5094
5086
 
5095
5087
 
@@ -5115,25 +5107,25 @@ class InlineQueryResultVenue(InlineQueryResult):
5115
5107
  """Type of the result, must be venue."""
5116
5108
 
5117
5109
  id: str = field(
5118
- default_factory=lambda: generate_random_id(64),
5110
+ default_factory=lambda: secrets.token_urlsafe(64),
5119
5111
  )
5120
5112
  """Unique identifier for this result, 1-64 Bytes."""
5121
5113
 
5122
- foursquare_id: Option[str] = field(default=Nothing, converter=From[str | None])
5114
+ foursquare_id: Option[str] = field(default=UNSET, converter=From[str | None])
5123
5115
  """Optional. Foursquare identifier of the venue if known."""
5124
5116
 
5125
- foursquare_type: Option[str] = field(default=Nothing, converter=From[str | None])
5117
+ foursquare_type: Option[str] = field(default=UNSET, converter=From[str | None])
5126
5118
  """Optional. Foursquare type of the venue, if known. (For example, `arts_entertainment/default`,
5127
5119
  `arts_entertainment/aquarium` or `food/icecream`.)."""
5128
5120
 
5129
- google_place_id: Option[str] = field(default=Nothing, converter=From[str | None])
5121
+ google_place_id: Option[str] = field(default=UNSET, converter=From[str | None])
5130
5122
  """Optional. Google Places identifier of the venue."""
5131
5123
 
5132
- google_place_type: Option[str] = field(default=Nothing, converter=From[str | None])
5124
+ google_place_type: Option[str] = field(default=UNSET, converter=From[str | None])
5133
5125
  """Optional. Google Places type of the venue. (See supported types.)."""
5134
5126
 
5135
5127
  reply_markup: Option[InlineKeyboardMarkup] = field(
5136
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5128
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5137
5129
  )
5138
5130
  """Optional. Inline keyboard attached to the message."""
5139
5131
 
@@ -5146,20 +5138,20 @@ class InlineQueryResultVenue(InlineQueryResult):
5146
5138
  InputInvoiceMessageContent,
5147
5139
  ]
5148
5140
  ] = field(
5149
- default=Nothing,
5141
+ default=UNSET,
5150
5142
  converter=From[
5151
5143
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5152
5144
  ],
5153
5145
  )
5154
5146
  """Optional. Content of the message to be sent instead of the venue."""
5155
5147
 
5156
- thumbnail_url: Option[str] = field(default=Nothing, converter=From[str | None])
5148
+ thumbnail_url: Option[str] = field(default=UNSET, converter=From[str | None])
5157
5149
  """Optional. Url of the thumbnail for the result."""
5158
5150
 
5159
- thumbnail_width: Option[int] = field(default=Nothing, converter=From[int | None])
5151
+ thumbnail_width: Option[int] = field(default=UNSET, converter=From[int | None])
5160
5152
  """Optional. Thumbnail width."""
5161
5153
 
5162
- thumbnail_height: Option[int] = field(default=Nothing, converter=From[int | None])
5154
+ thumbnail_height: Option[int] = field(default=UNSET, converter=From[int | None])
5163
5155
  """Optional. Thumbnail height."""
5164
5156
 
5165
5157
 
@@ -5179,19 +5171,19 @@ class InlineQueryResultContact(InlineQueryResult):
5179
5171
  """Type of the result, must be contact."""
5180
5172
 
5181
5173
  id: str = field(
5182
- default_factory=lambda: generate_random_id(64),
5174
+ default_factory=lambda: secrets.token_urlsafe(64),
5183
5175
  )
5184
5176
  """Unique identifier for this result, 1-64 Bytes."""
5185
5177
 
5186
- last_name: Option[str] = field(default=Nothing, converter=From[str | None])
5178
+ last_name: Option[str] = field(default=UNSET, converter=From[str | None])
5187
5179
  """Optional. Contact's last name."""
5188
5180
 
5189
- vcard: Option[str] = field(default=Nothing, converter=From[str | None])
5181
+ vcard: Option[str] = field(default=UNSET, converter=From[str | None])
5190
5182
  """Optional. Additional data about the contact in the form of a vCard, 0-2048
5191
5183
  bytes."""
5192
5184
 
5193
5185
  reply_markup: Option[InlineKeyboardMarkup] = field(
5194
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5186
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5195
5187
  )
5196
5188
  """Optional. Inline keyboard attached to the message."""
5197
5189
 
@@ -5204,20 +5196,20 @@ class InlineQueryResultContact(InlineQueryResult):
5204
5196
  InputInvoiceMessageContent,
5205
5197
  ]
5206
5198
  ] = field(
5207
- default=Nothing,
5199
+ default=UNSET,
5208
5200
  converter=From[
5209
5201
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5210
5202
  ],
5211
5203
  )
5212
5204
  """Optional. Content of the message to be sent instead of the contact."""
5213
5205
 
5214
- thumbnail_url: Option[str] = field(default=Nothing, converter=From[str | None])
5206
+ thumbnail_url: Option[str] = field(default=UNSET, converter=From[str | None])
5215
5207
  """Optional. Url of the thumbnail for the result."""
5216
5208
 
5217
- thumbnail_width: Option[int] = field(default=Nothing, converter=From[int | None])
5209
+ thumbnail_width: Option[int] = field(default=UNSET, converter=From[int | None])
5218
5210
  """Optional. Thumbnail width."""
5219
5211
 
5220
- thumbnail_height: Option[int] = field(default=Nothing, converter=From[int | None])
5212
+ thumbnail_height: Option[int] = field(default=UNSET, converter=From[int | None])
5221
5213
  """Optional. Thumbnail height."""
5222
5214
 
5223
5215
 
@@ -5234,12 +5226,12 @@ class InlineQueryResultGame(InlineQueryResult):
5234
5226
  """Type of the result, must be game."""
5235
5227
 
5236
5228
  id: str = field(
5237
- default_factory=lambda: generate_random_id(64),
5229
+ default_factory=lambda: secrets.token_urlsafe(64),
5238
5230
  )
5239
5231
  """Unique identifier for this result, 1-64 bytes."""
5240
5232
 
5241
5233
  reply_markup: Option[InlineKeyboardMarkup] = field(
5242
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5234
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5243
5235
  )
5244
5236
  """Optional. Inline keyboard attached to the message."""
5245
5237
 
@@ -5257,35 +5249,35 @@ class InlineQueryResultCachedPhoto(InlineQueryResult):
5257
5249
  """Type of the result, must be photo."""
5258
5250
 
5259
5251
  id: str = field(
5260
- default_factory=lambda: generate_random_id(64),
5252
+ default_factory=lambda: secrets.token_urlsafe(64),
5261
5253
  )
5262
5254
  """Unique identifier for this result, 1-64 bytes."""
5263
5255
 
5264
- title: Option[str] = field(default=Nothing, converter=From[str | None])
5256
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
5265
5257
  """Optional. Title for the result."""
5266
5258
 
5267
- description: Option[str] = field(default=Nothing, converter=From[str | None])
5259
+ description: Option[str] = field(default=UNSET, converter=From[str | None])
5268
5260
  """Optional. Short description of the result."""
5269
5261
 
5270
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
5262
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
5271
5263
  """Optional. Caption of the photo to be sent, 0-1024 characters after entities
5272
5264
  parsing."""
5273
5265
 
5274
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
5266
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
5275
5267
  """Optional. Mode for parsing entities in the photo caption. See formatting
5276
5268
  options for more details."""
5277
5269
 
5278
5270
  caption_entities: Option[list[MessageEntity]] = field(
5279
- default=Nothing, converter=From["list[MessageEntity] | None"]
5271
+ default=UNSET, converter=From["list[MessageEntity] | None"]
5280
5272
  )
5281
5273
  """Optional. List of special entities that appear in the caption, which can
5282
5274
  be specified instead of parse_mode."""
5283
5275
 
5284
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
5276
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
5285
5277
  """Optional. Pass True, if the caption must be shown above the message media."""
5286
5278
 
5287
5279
  reply_markup: Option[InlineKeyboardMarkup] = field(
5288
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5280
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5289
5281
  )
5290
5282
  """Optional. Inline keyboard attached to the message."""
5291
5283
 
@@ -5298,7 +5290,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult):
5298
5290
  InputInvoiceMessageContent,
5299
5291
  ]
5300
5292
  ] = field(
5301
- default=Nothing,
5293
+ default=UNSET,
5302
5294
  converter=From[
5303
5295
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5304
5296
  ],
@@ -5319,32 +5311,32 @@ class InlineQueryResultCachedGif(InlineQueryResult):
5319
5311
  """Type of the result, must be gif."""
5320
5312
 
5321
5313
  id: str = field(
5322
- default_factory=lambda: generate_random_id(64),
5314
+ default_factory=lambda: secrets.token_urlsafe(64),
5323
5315
  )
5324
5316
  """Unique identifier for this result, 1-64 bytes."""
5325
5317
 
5326
- title: Option[str] = field(default=Nothing, converter=From[str | None])
5318
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
5327
5319
  """Optional. Title for the result."""
5328
5320
 
5329
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
5321
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
5330
5322
  """Optional. Caption of the GIF file to be sent, 0-1024 characters after entities
5331
5323
  parsing."""
5332
5324
 
5333
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
5325
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
5334
5326
  """Optional. Mode for parsing entities in the caption. See formatting options
5335
5327
  for more details."""
5336
5328
 
5337
5329
  caption_entities: Option[list[MessageEntity]] = field(
5338
- default=Nothing, converter=From["list[MessageEntity] | None"]
5330
+ default=UNSET, converter=From["list[MessageEntity] | None"]
5339
5331
  )
5340
5332
  """Optional. List of special entities that appear in the caption, which can
5341
5333
  be specified instead of parse_mode."""
5342
5334
 
5343
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
5335
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
5344
5336
  """Optional. Pass True, if the caption must be shown above the message media."""
5345
5337
 
5346
5338
  reply_markup: Option[InlineKeyboardMarkup] = field(
5347
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5339
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5348
5340
  )
5349
5341
  """Optional. Inline keyboard attached to the message."""
5350
5342
 
@@ -5357,7 +5349,7 @@ class InlineQueryResultCachedGif(InlineQueryResult):
5357
5349
  InputInvoiceMessageContent,
5358
5350
  ]
5359
5351
  ] = field(
5360
- default=Nothing,
5352
+ default=UNSET,
5361
5353
  converter=From[
5362
5354
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5363
5355
  ],
@@ -5378,32 +5370,32 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
5378
5370
  """Type of the result, must be mpeg4_gif."""
5379
5371
 
5380
5372
  id: str = field(
5381
- default_factory=lambda: generate_random_id(64),
5373
+ default_factory=lambda: secrets.token_urlsafe(64),
5382
5374
  )
5383
5375
  """Unique identifier for this result, 1-64 bytes."""
5384
5376
 
5385
- title: Option[str] = field(default=Nothing, converter=From[str | None])
5377
+ title: Option[str] = field(default=UNSET, converter=From[str | None])
5386
5378
  """Optional. Title for the result."""
5387
5379
 
5388
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
5380
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
5389
5381
  """Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after
5390
5382
  entities parsing."""
5391
5383
 
5392
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
5384
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
5393
5385
  """Optional. Mode for parsing entities in the caption. See formatting options
5394
5386
  for more details."""
5395
5387
 
5396
5388
  caption_entities: Option[list[MessageEntity]] = field(
5397
- default=Nothing, converter=From["list[MessageEntity] | None"]
5389
+ default=UNSET, converter=From["list[MessageEntity] | None"]
5398
5390
  )
5399
5391
  """Optional. List of special entities that appear in the caption, which can
5400
5392
  be specified instead of parse_mode."""
5401
5393
 
5402
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
5394
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
5403
5395
  """Optional. Pass True, if the caption must be shown above the message media."""
5404
5396
 
5405
5397
  reply_markup: Option[InlineKeyboardMarkup] = field(
5406
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5398
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5407
5399
  )
5408
5400
  """Optional. Inline keyboard attached to the message."""
5409
5401
 
@@ -5416,7 +5408,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
5416
5408
  InputInvoiceMessageContent,
5417
5409
  ]
5418
5410
  ] = field(
5419
- default=Nothing,
5411
+ default=UNSET,
5420
5412
  converter=From[
5421
5413
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5422
5414
  ],
@@ -5437,12 +5429,12 @@ class InlineQueryResultCachedSticker(InlineQueryResult):
5437
5429
  """Type of the result, must be sticker."""
5438
5430
 
5439
5431
  id: str = field(
5440
- default_factory=lambda: generate_random_id(64),
5432
+ default_factory=lambda: secrets.token_urlsafe(64),
5441
5433
  )
5442
5434
  """Unique identifier for this result, 1-64 bytes."""
5443
5435
 
5444
5436
  reply_markup: Option[InlineKeyboardMarkup] = field(
5445
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5437
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5446
5438
  )
5447
5439
  """Optional. Inline keyboard attached to the message."""
5448
5440
 
@@ -5455,7 +5447,7 @@ class InlineQueryResultCachedSticker(InlineQueryResult):
5455
5447
  InputInvoiceMessageContent,
5456
5448
  ]
5457
5449
  ] = field(
5458
- default=Nothing,
5450
+ default=UNSET,
5459
5451
  converter=From[
5460
5452
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5461
5453
  ],
@@ -5479,29 +5471,29 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
5479
5471
  """Type of the result, must be document."""
5480
5472
 
5481
5473
  id: str = field(
5482
- default_factory=lambda: generate_random_id(64),
5474
+ default_factory=lambda: secrets.token_urlsafe(64),
5483
5475
  )
5484
5476
  """Unique identifier for this result, 1-64 bytes."""
5485
5477
 
5486
- description: Option[str] = field(default=Nothing, converter=From[str | None])
5478
+ description: Option[str] = field(default=UNSET, converter=From[str | None])
5487
5479
  """Optional. Short description of the result."""
5488
5480
 
5489
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
5481
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
5490
5482
  """Optional. Caption of the document to be sent, 0-1024 characters after entities
5491
5483
  parsing."""
5492
5484
 
5493
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
5485
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
5494
5486
  """Optional. Mode for parsing entities in the document caption. See formatting
5495
5487
  options for more details."""
5496
5488
 
5497
5489
  caption_entities: Option[list[MessageEntity]] = field(
5498
- default=Nothing, converter=From["list[MessageEntity] | None"]
5490
+ default=UNSET, converter=From["list[MessageEntity] | None"]
5499
5491
  )
5500
5492
  """Optional. List of special entities that appear in the caption, which can
5501
5493
  be specified instead of parse_mode."""
5502
5494
 
5503
5495
  reply_markup: Option[InlineKeyboardMarkup] = field(
5504
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5496
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5505
5497
  )
5506
5498
  """Optional. Inline keyboard attached to the message."""
5507
5499
 
@@ -5514,7 +5506,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
5514
5506
  InputInvoiceMessageContent,
5515
5507
  ]
5516
5508
  ] = field(
5517
- default=Nothing,
5509
+ default=UNSET,
5518
5510
  converter=From[
5519
5511
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5520
5512
  ],
@@ -5538,32 +5530,32 @@ class InlineQueryResultCachedVideo(InlineQueryResult):
5538
5530
  """Type of the result, must be video."""
5539
5531
 
5540
5532
  id: str = field(
5541
- default_factory=lambda: generate_random_id(64),
5533
+ default_factory=lambda: secrets.token_urlsafe(64),
5542
5534
  )
5543
5535
  """Unique identifier for this result, 1-64 bytes."""
5544
5536
 
5545
- description: Option[str] = field(default=Nothing, converter=From[str | None])
5537
+ description: Option[str] = field(default=UNSET, converter=From[str | None])
5546
5538
  """Optional. Short description of the result."""
5547
5539
 
5548
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
5540
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
5549
5541
  """Optional. Caption of the video to be sent, 0-1024 characters after entities
5550
5542
  parsing."""
5551
5543
 
5552
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
5544
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
5553
5545
  """Optional. Mode for parsing entities in the video caption. See formatting
5554
5546
  options for more details."""
5555
5547
 
5556
5548
  caption_entities: Option[list[MessageEntity]] = field(
5557
- default=Nothing, converter=From["list[MessageEntity] | None"]
5549
+ default=UNSET, converter=From["list[MessageEntity] | None"]
5558
5550
  )
5559
5551
  """Optional. List of special entities that appear in the caption, which can
5560
5552
  be specified instead of parse_mode."""
5561
5553
 
5562
- show_caption_above_media: Option[bool] = field(default=Nothing, converter=From[bool | None])
5554
+ show_caption_above_media: Option[bool] = field(default=UNSET, converter=From[bool | None])
5563
5555
  """Optional. Pass True, if the caption must be shown above the message media."""
5564
5556
 
5565
5557
  reply_markup: Option[InlineKeyboardMarkup] = field(
5566
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5558
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5567
5559
  )
5568
5560
  """Optional. Inline keyboard attached to the message."""
5569
5561
 
@@ -5576,7 +5568,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult):
5576
5568
  InputInvoiceMessageContent,
5577
5569
  ]
5578
5570
  ] = field(
5579
- default=Nothing,
5571
+ default=UNSET,
5580
5572
  converter=From[
5581
5573
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5582
5574
  ],
@@ -5600,25 +5592,25 @@ class InlineQueryResultCachedVoice(InlineQueryResult):
5600
5592
  """Type of the result, must be voice."""
5601
5593
 
5602
5594
  id: str = field(
5603
- default_factory=lambda: generate_random_id(64),
5595
+ default_factory=lambda: secrets.token_urlsafe(64),
5604
5596
  )
5605
5597
  """Unique identifier for this result, 1-64 bytes."""
5606
5598
 
5607
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
5599
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
5608
5600
  """Optional. Caption, 0-1024 characters after entities parsing."""
5609
5601
 
5610
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
5602
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
5611
5603
  """Optional. Mode for parsing entities in the voice message caption. See formatting
5612
5604
  options for more details."""
5613
5605
 
5614
5606
  caption_entities: Option[list[MessageEntity]] = field(
5615
- default=Nothing, converter=From["list[MessageEntity] | None"]
5607
+ default=UNSET, converter=From["list[MessageEntity] | None"]
5616
5608
  )
5617
5609
  """Optional. List of special entities that appear in the caption, which can
5618
5610
  be specified instead of parse_mode."""
5619
5611
 
5620
5612
  reply_markup: Option[InlineKeyboardMarkup] = field(
5621
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5613
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5622
5614
  )
5623
5615
  """Optional. Inline keyboard attached to the message."""
5624
5616
 
@@ -5631,7 +5623,7 @@ class InlineQueryResultCachedVoice(InlineQueryResult):
5631
5623
  InputInvoiceMessageContent,
5632
5624
  ]
5633
5625
  ] = field(
5634
- default=Nothing,
5626
+ default=UNSET,
5635
5627
  converter=From[
5636
5628
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5637
5629
  ],
@@ -5652,25 +5644,25 @@ class InlineQueryResultCachedAudio(InlineQueryResult):
5652
5644
  """Type of the result, must be audio."""
5653
5645
 
5654
5646
  id: str = field(
5655
- default_factory=lambda: generate_random_id(64),
5647
+ default_factory=lambda: secrets.token_urlsafe(64),
5656
5648
  )
5657
5649
  """Unique identifier for this result, 1-64 bytes."""
5658
5650
 
5659
- caption: Option[str] = field(default=Nothing, converter=From[str | None])
5651
+ caption: Option[str] = field(default=UNSET, converter=From[str | None])
5660
5652
  """Optional. Caption, 0-1024 characters after entities parsing."""
5661
5653
 
5662
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
5654
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
5663
5655
  """Optional. Mode for parsing entities in the audio caption. See formatting
5664
5656
  options for more details."""
5665
5657
 
5666
5658
  caption_entities: Option[list[MessageEntity]] = field(
5667
- default=Nothing, converter=From["list[MessageEntity] | None"]
5659
+ default=UNSET, converter=From["list[MessageEntity] | None"]
5668
5660
  )
5669
5661
  """Optional. List of special entities that appear in the caption, which can
5670
5662
  be specified instead of parse_mode."""
5671
5663
 
5672
5664
  reply_markup: Option[InlineKeyboardMarkup] = field(
5673
- default=Nothing, converter=From["InlineKeyboardMarkup | None"]
5665
+ default=UNSET, converter=From["InlineKeyboardMarkup | None"]
5674
5666
  )
5675
5667
  """Optional. Inline keyboard attached to the message."""
5676
5668
 
@@ -5683,7 +5675,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult):
5683
5675
  InputInvoiceMessageContent,
5684
5676
  ]
5685
5677
  ] = field(
5686
- default=Nothing,
5678
+ default=UNSET,
5687
5679
  converter=From[
5688
5680
  "InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | None"
5689
5681
  ],
@@ -5700,18 +5692,16 @@ class InputTextMessageContent(InputMessageContent):
5700
5692
  message_text: str = field()
5701
5693
  """Text of the message to be sent, 1-4096 characters."""
5702
5694
 
5703
- parse_mode: Option[str] = field(default=Nothing, converter=From[str | None])
5695
+ parse_mode: Option[str] = field(default=UNSET, converter=From[str | None])
5704
5696
  """Optional. Mode for parsing entities in the message text. See formatting
5705
5697
  options for more details."""
5706
5698
 
5707
- entities: Option[list[MessageEntity]] = field(
5708
- default=Nothing, converter=From["list[MessageEntity] | None"]
5709
- )
5699
+ entities: Option[list[MessageEntity]] = field(default=UNSET, converter=From["list[MessageEntity] | None"])
5710
5700
  """Optional. List of special entities that appear in message text, which can
5711
5701
  be specified instead of parse_mode."""
5712
5702
 
5713
5703
  link_preview_options: Option[LinkPreviewOptions] = field(
5714
- default=Nothing, converter=From["LinkPreviewOptions | None"]
5704
+ default=UNSET, converter=From["LinkPreviewOptions | None"]
5715
5705
  )
5716
5706
  """Optional. Link preview generation options for the message."""
5717
5707
 
@@ -5728,20 +5718,20 @@ class InputLocationMessageContent(InputMessageContent):
5728
5718
  longitude: float = field()
5729
5719
  """Longitude of the location in degrees."""
5730
5720
 
5731
- horizontal_accuracy: Option[float] = field(default=Nothing, converter=From[float | None])
5721
+ horizontal_accuracy: Option[float] = field(default=UNSET, converter=From[float | None])
5732
5722
  """Optional. The radius of uncertainty for the location, measured in meters;
5733
5723
  0-1500."""
5734
5724
 
5735
- live_period: Option[int] = field(default=Nothing, converter=From[int | None])
5725
+ live_period: Option[int] = field(default=UNSET, converter=From[int | None])
5736
5726
  """Optional. Period in seconds during which the location can be updated, should
5737
5727
  be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited
5738
5728
  indefinitely."""
5739
5729
 
5740
- heading: Option[int] = field(default=Nothing, converter=From[int | None])
5730
+ heading: Option[int] = field(default=UNSET, converter=From[int | None])
5741
5731
  """Optional. For live locations, a direction in which the user is moving, in
5742
5732
  degrees. Must be between 1 and 360 if specified."""
5743
5733
 
5744
- proximity_alert_radius: Option[int] = field(default=Nothing, converter=From[int | None])
5734
+ proximity_alert_radius: Option[int] = field(default=UNSET, converter=From[int | None])
5745
5735
  """Optional. For live locations, a maximum distance for proximity alerts
5746
5736
  about approaching another chat member, in meters. Must be between 1 and
5747
5737
  100000 if specified."""
@@ -5765,17 +5755,17 @@ class InputVenueMessageContent(InputMessageContent):
5765
5755
  address: str = field()
5766
5756
  """Address of the venue."""
5767
5757
 
5768
- foursquare_id: Option[str] = field(default=Nothing, converter=From[str | None])
5758
+ foursquare_id: Option[str] = field(default=UNSET, converter=From[str | None])
5769
5759
  """Optional. Foursquare identifier of the venue, if known."""
5770
5760
 
5771
- foursquare_type: Option[str] = field(default=Nothing, converter=From[str | None])
5761
+ foursquare_type: Option[str] = field(default=UNSET, converter=From[str | None])
5772
5762
  """Optional. Foursquare type of the venue, if known. (For example, `arts_entertainment/default`,
5773
5763
  `arts_entertainment/aquarium` or `food/icecream`.)."""
5774
5764
 
5775
- google_place_id: Option[str] = field(default=Nothing, converter=From[str | None])
5765
+ google_place_id: Option[str] = field(default=UNSET, converter=From[str | None])
5776
5766
  """Optional. Google Places identifier of the venue."""
5777
5767
 
5778
- google_place_type: Option[str] = field(default=Nothing, converter=From[str | None])
5768
+ google_place_type: Option[str] = field(default=UNSET, converter=From[str | None])
5779
5769
  """Optional. Google Places type of the venue. (See supported types.)."""
5780
5770
 
5781
5771
 
@@ -5791,10 +5781,10 @@ class InputContactMessageContent(InputMessageContent):
5791
5781
  first_name: str = field()
5792
5782
  """Contact's first name."""
5793
5783
 
5794
- last_name: Option[str] = field(default=Nothing, converter=From[str | None])
5784
+ last_name: Option[str] = field(default=UNSET, converter=From[str | None])
5795
5785
  """Optional. Contact's last name."""
5796
5786
 
5797
- vcard: Option[str] = field(default=Nothing, converter=From[str | None])
5787
+ vcard: Option[str] = field(default=UNSET, converter=From[str | None])
5798
5788
  """Optional. Additional data about the contact in the form of a vCard, 0-2048
5799
5789
  bytes."""
5800
5790
 
@@ -5824,11 +5814,11 @@ class InputInvoiceMessageContent(InputMessageContent):
5824
5814
  tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain
5825
5815
  exactly one item for payments in Telegram Stars."""
5826
5816
 
5827
- provider_token: Option[str] = field(default=Nothing, converter=From[str | None])
5817
+ provider_token: Option[str] = field(default=UNSET, converter=From[str | None])
5828
5818
  """Optional. Payment provider token, obtained via @BotFather. Pass an empty
5829
5819
  string for payments in Telegram Stars."""
5830
5820
 
5831
- max_tip_amount: Option[int] = field(default=Nothing, converter=From[int | None])
5821
+ max_tip_amount: Option[int] = field(default=UNSET, converter=From[int | None])
5832
5822
  """Optional. The maximum accepted amount for tips in the smallest units of
5833
5823
  the currency (integer, not float/double). For example, for a maximum tip
5834
5824
  of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json,
@@ -5836,55 +5826,55 @@ class InputInvoiceMessageContent(InputMessageContent):
5836
5826
  for the majority of currencies). Defaults to 0. Not supported for payments
5837
5827
  in Telegram Stars."""
5838
5828
 
5839
- suggested_tip_amounts: Option[list[int]] = field(default=Nothing, converter=From[list[int] | None])
5829
+ suggested_tip_amounts: Option[list[int]] = field(default=UNSET, converter=From[list[int] | None])
5840
5830
  """Optional. A JSON-serialized array of suggested amounts of tip in the smallest
5841
5831
  units of the currency (integer, not float/double). At most 4 suggested
5842
5832
  tip amounts can be specified. The suggested tip amounts must be positive,
5843
5833
  passed in a strictly increased order and must not exceed max_tip_amount."""
5844
5834
 
5845
- provider_data: Option[str] = field(default=Nothing, converter=From[str | None])
5835
+ provider_data: Option[str] = field(default=UNSET, converter=From[str | None])
5846
5836
  """Optional. A JSON-serialized object for data about the invoice, which will
5847
5837
  be shared with the payment provider. A detailed description of the required
5848
5838
  fields should be provided by the payment provider."""
5849
5839
 
5850
- photo_url: Option[str] = field(default=Nothing, converter=From[str | None])
5840
+ photo_url: Option[str] = field(default=UNSET, converter=From[str | None])
5851
5841
  """Optional. URL of the product photo for the invoice. Can be a photo of the goods
5852
5842
  or a marketing image for a service."""
5853
5843
 
5854
- photo_size: Option[int] = field(default=Nothing, converter=From[int | None])
5844
+ photo_size: Option[int] = field(default=UNSET, converter=From[int | None])
5855
5845
  """Optional. Photo size in bytes."""
5856
5846
 
5857
- photo_width: Option[int] = field(default=Nothing, converter=From[int | None])
5847
+ photo_width: Option[int] = field(default=UNSET, converter=From[int | None])
5858
5848
  """Optional. Photo width."""
5859
5849
 
5860
- photo_height: Option[int] = field(default=Nothing, converter=From[int | None])
5850
+ photo_height: Option[int] = field(default=UNSET, converter=From[int | None])
5861
5851
  """Optional. Photo height."""
5862
5852
 
5863
- need_name: Option[bool] = field(default=Nothing, converter=From[bool | None])
5853
+ need_name: Option[bool] = field(default=UNSET, converter=From[bool | None])
5864
5854
  """Optional. Pass True if you require the user's full name to complete the order.
5865
5855
  Ignored for payments in Telegram Stars."""
5866
5856
 
5867
- need_phone_number: Option[bool] = field(default=Nothing, converter=From[bool | None])
5857
+ need_phone_number: Option[bool] = field(default=UNSET, converter=From[bool | None])
5868
5858
  """Optional. Pass True if you require the user's phone number to complete the
5869
5859
  order. Ignored for payments in Telegram Stars."""
5870
5860
 
5871
- need_email: Option[bool] = field(default=Nothing, converter=From[bool | None])
5861
+ need_email: Option[bool] = field(default=UNSET, converter=From[bool | None])
5872
5862
  """Optional. Pass True if you require the user's email address to complete
5873
5863
  the order. Ignored for payments in Telegram Stars."""
5874
5864
 
5875
- need_shipping_address: Option[bool] = field(default=Nothing, converter=From[bool | None])
5865
+ need_shipping_address: Option[bool] = field(default=UNSET, converter=From[bool | None])
5876
5866
  """Optional. Pass True if you require the user's shipping address to complete
5877
5867
  the order. Ignored for payments in Telegram Stars."""
5878
5868
 
5879
- send_phone_number_to_provider: Option[bool] = field(default=Nothing, converter=From[bool | None])
5869
+ send_phone_number_to_provider: Option[bool] = field(default=UNSET, converter=From[bool | None])
5880
5870
  """Optional. Pass True if the user's phone number should be sent to the provider.
5881
5871
  Ignored for payments in Telegram Stars."""
5882
5872
 
5883
- send_email_to_provider: Option[bool] = field(default=Nothing, converter=From[bool | None])
5873
+ send_email_to_provider: Option[bool] = field(default=UNSET, converter=From[bool | None])
5884
5874
  """Optional. Pass True if the user's email address should be sent to the provider.
5885
5875
  Ignored for payments in Telegram Stars."""
5886
5876
 
5887
- is_flexible: Option[bool] = field(default=Nothing, converter=From[bool | None])
5877
+ is_flexible: Option[bool] = field(default=UNSET, converter=From[bool | None])
5888
5878
  """Optional. Pass True if the final price depends on the shipping method. Ignored
5889
5879
  for payments in Telegram Stars."""
5890
5880
 
@@ -5905,10 +5895,10 @@ class ChosenInlineResult(Model):
5905
5895
  query: str = field()
5906
5896
  """The query that was used to obtain the result."""
5907
5897
 
5908
- location: Option[Location] = field(default=Nothing, converter=From["Location | None"])
5898
+ location: Option[Location] = field(default=UNSET, converter=From["Location | None"])
5909
5899
  """Optional. Sender location, only for bots that require user location."""
5910
5900
 
5911
- inline_message_id: Option[str] = field(default=Nothing, converter=From[str | None])
5901
+ inline_message_id: Option[str] = field(default=UNSET, converter=From[str | None])
5912
5902
  """Optional. Identifier of the sent inline message. Available only if there
5913
5903
  is an inline keyboard attached to the message. Will be also received in callback
5914
5904
  queries and can be used to edit the message."""
@@ -5920,11 +5910,25 @@ class SentWebAppMessage(Model):
5920
5910
  Describes an inline message sent by a Web App on behalf of a user.
5921
5911
  """
5922
5912
 
5923
- inline_message_id: Option[str] = field(default=Nothing, converter=From[str | None])
5913
+ inline_message_id: Option[str] = field(default=UNSET, converter=From[str | None])
5924
5914
  """Optional. Identifier of the sent inline message. Available only if there
5925
5915
  is an inline keyboard attached to the message."""
5926
5916
 
5927
5917
 
5918
+ class PreparedInlineMessage(Model):
5919
+ """Object `PreparedInlineMessage`, see the [documentation](https://core.telegram.org/bots/api#preparedinlinemessage).
5920
+
5921
+ Describes an inline message to be sent by a user of a Mini App.
5922
+ """
5923
+
5924
+ id: str = field()
5925
+ """Unique identifier of the prepared message."""
5926
+
5927
+ expiration_date: datetime = field()
5928
+ """Expiration date of the prepared message, in Unix time. Expired prepared
5929
+ messages can no longer be used."""
5930
+
5931
+
5928
5932
  class LabeledPrice(Model):
5929
5933
  """Object `LabeledPrice`, see the [documentation](https://core.telegram.org/bots/api#labeledprice).
5930
5934
 
@@ -5998,18 +6002,16 @@ class OrderInfo(Model):
5998
6002
  This object represents information about an order.
5999
6003
  """
6000
6004
 
6001
- name: Option[str] = field(default=Nothing, converter=From[str | None])
6005
+ name: Option[str] = field(default=UNSET, converter=From[str | None])
6002
6006
  """Optional. User name."""
6003
6007
 
6004
- phone_number: Option[str] = field(default=Nothing, converter=From[str | None])
6008
+ phone_number: Option[str] = field(default=UNSET, converter=From[str | None])
6005
6009
  """Optional. User's phone number."""
6006
6010
 
6007
- email: Option[str] = field(default=Nothing, converter=From[str | None])
6011
+ email: Option[str] = field(default=UNSET, converter=From[str | None])
6008
6012
  """Optional. User email."""
6009
6013
 
6010
- shipping_address: Option[ShippingAddress] = field(
6011
- default=Nothing, converter=From["ShippingAddress | None"]
6012
- )
6014
+ shipping_address: Option[ShippingAddress] = field(default=UNSET, converter=From["ShippingAddress | None"])
6013
6015
  """Optional. User shipping address."""
6014
6016
 
6015
6017
 
@@ -6032,7 +6034,7 @@ class ShippingOption(Model):
6032
6034
  class SuccessfulPayment(Model):
6033
6035
  """Object `SuccessfulPayment`, see the [documentation](https://core.telegram.org/bots/api#successfulpayment).
6034
6036
 
6035
- This object contains basic information about a successful payment.
6037
+ This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram's control.
6036
6038
  """
6037
6039
 
6038
6040
  currency: Currency = field()
@@ -6054,10 +6056,20 @@ class SuccessfulPayment(Model):
6054
6056
  provider_payment_charge_id: str = field()
6055
6057
  """Provider payment identifier."""
6056
6058
 
6057
- shipping_option_id: Option[str] = field(default=Nothing, converter=From[str | None])
6059
+ subscription_expiration_date: Option[datetime] = field(default=UNSET, converter=From[datetime | None])
6060
+ """Optional. Expiration date of the subscription, in Unix time; for recurring
6061
+ payments only."""
6062
+
6063
+ is_recurring: Option[bool] = field(default=UNSET, converter=From[bool | None])
6064
+ """Optional. True, if the payment is a recurring payment for a subscription."""
6065
+
6066
+ is_first_recurring: Option[bool] = field(default=UNSET, converter=From[bool | None])
6067
+ """Optional. True, if the payment is the first payment for a subscription."""
6068
+
6069
+ shipping_option_id: Option[str] = field(default=UNSET, converter=From[str | None])
6058
6070
  """Optional. Identifier of the shipping option chosen by the user."""
6059
6071
 
6060
- order_info: Option[OrderInfo] = field(default=Nothing, converter=From["OrderInfo | None"])
6072
+ order_info: Option[OrderInfo] = field(default=UNSET, converter=From["OrderInfo | None"])
6061
6073
  """Optional. Order information provided by the user."""
6062
6074
 
6063
6075
 
@@ -6083,7 +6095,7 @@ class RefundedPayment(Model):
6083
6095
  """Three-letter ISO 4217 currency code, or `XTR` for payments in Telegram
6084
6096
  Stars. Currently, always `XTR`."""
6085
6097
 
6086
- provider_payment_charge_id: Option[str] = field(default=Nothing, converter=From[str | None])
6098
+ provider_payment_charge_id: Option[str] = field(default=UNSET, converter=From[str | None])
6087
6099
  """Optional. Provider payment identifier."""
6088
6100
 
6089
6101
 
@@ -6131,10 +6143,10 @@ class PreCheckoutQuery(Model):
6131
6143
  invoice_payload: str = field()
6132
6144
  """Bot-specified invoice payload."""
6133
6145
 
6134
- shipping_option_id: Option[str] = field(default=Nothing, converter=From[str | None])
6146
+ shipping_option_id: Option[str] = field(default=UNSET, converter=From[str | None])
6135
6147
  """Optional. Identifier of the shipping option chosen by the user."""
6136
6148
 
6137
- order_info: Option[OrderInfo] = field(default=Nothing, converter=From["OrderInfo | None"])
6149
+ order_info: Option[OrderInfo] = field(default=UNSET, converter=From["OrderInfo | None"])
6138
6150
  """Optional. Order information provided by the user."""
6139
6151
 
6140
6152
 
@@ -6187,6 +6199,33 @@ class RevenueWithdrawalStateFailed(RevenueWithdrawalState):
6187
6199
  """Type of the state, always `failed`."""
6188
6200
 
6189
6201
 
6202
+ class AffiliateInfo(Model):
6203
+ """Object `AffiliateInfo`, see the [documentation](https://core.telegram.org/bots/api#affiliateinfo).
6204
+
6205
+ Contains information about the affiliate that received a commission via this transaction.
6206
+ """
6207
+
6208
+ commission_per_mille: int = field()
6209
+ """The number of Telegram Stars received by the affiliate for each 1000 Telegram
6210
+ Stars received by the bot from referred users."""
6211
+
6212
+ amount: int = field()
6213
+ """Integer amount of Telegram Stars received by the affiliate from the transaction,
6214
+ rounded to 0; can be negative for refunds."""
6215
+
6216
+ affiliate_user: Option[User] = field(default=UNSET, converter=From["User | None"])
6217
+ """Optional. The bot or the user that received an affiliate commission if it
6218
+ was received by a bot or a user."""
6219
+
6220
+ affiliate_chat: Option[Chat] = field(default=UNSET, converter=From["Chat | None"])
6221
+ """Optional. The chat that received an affiliate commission if it was received
6222
+ by a chat."""
6223
+
6224
+ nanostar_amount: Option[int] = field(default=UNSET, converter=From[int | None])
6225
+ """Optional. The number of 1/1000000000 shares of Telegram Stars received
6226
+ by the affiliate; from -999999999 to 999999999; can be negative for refunds."""
6227
+
6228
+
6190
6229
  class TransactionPartnerUser(TransactionPartner):
6191
6230
  """Object `TransactionPartnerUser`, see the [documentation](https://core.telegram.org/bots/api#transactionpartneruser).
6192
6231
 
@@ -6199,17 +6238,60 @@ class TransactionPartnerUser(TransactionPartner):
6199
6238
  type: typing.Literal["user"] = field(default="user")
6200
6239
  """Type of the transaction partner, always `user`."""
6201
6240
 
6202
- invoice_payload: Option[str] = field(default=Nothing, converter=From[str | None])
6241
+ affiliate: Option[AffiliateInfo] = field(default=UNSET, converter=From["AffiliateInfo | None"])
6242
+ """Optional. Information about the affiliate that received a commission
6243
+ via this transaction."""
6244
+
6245
+ invoice_payload: Option[str] = field(default=UNSET, converter=From[str | None])
6203
6246
  """Optional. Bot-specified invoice payload."""
6204
6247
 
6248
+ subscription_period: Option[int] = field(default=UNSET, converter=From[int | None])
6249
+ """Optional. The duration of the paid subscription."""
6250
+
6205
6251
  paid_media: Option[list[Variative[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo]]] = field(
6206
- default=Nothing, converter=From["list[PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo] | None"]
6252
+ default=UNSET, converter=From["list[PaidMediaPreview | PaidMediaPhoto | PaidMediaVideo] | None"]
6207
6253
  )
6208
6254
  """Optional. Information about the paid media bought by the user."""
6209
6255
 
6210
- paid_media_payload: Option[str] = field(default=Nothing, converter=From[str | None])
6256
+ paid_media_payload: Option[str] = field(default=UNSET, converter=From[str | None])
6211
6257
  """Optional. Bot-specified paid media payload."""
6212
6258
 
6259
+ gift: Option[Gift] = field(default=UNSET, converter=From["Gift | None"])
6260
+ """Optional. The gift sent to the user by the bot."""
6261
+
6262
+
6263
+ class TransactionPartnerChat(TransactionPartner):
6264
+ """Object `TransactionPartnerChat`, see the [documentation](https://core.telegram.org/bots/api#transactionpartnerchat).
6265
+
6266
+ Describes a transaction with a chat.
6267
+ """
6268
+
6269
+ type: str = field()
6270
+ """Type of the transaction partner, always `chat`."""
6271
+
6272
+ chat: Chat = field()
6273
+ """Information about the chat."""
6274
+
6275
+ gift: Option[Gift] = field(default=UNSET, converter=From["Gift | None"])
6276
+ """Optional. The gift sent to the chat by the bot."""
6277
+
6278
+
6279
+ class TransactionPartnerAffiliateProgram(TransactionPartner):
6280
+ """Object `TransactionPartnerAffiliateProgram`, see the [documentation](https://core.telegram.org/bots/api#transactionpartneraffiliateprogram).
6281
+
6282
+ Describes the affiliate program that issued the affiliate commission received via this transaction.
6283
+ """
6284
+
6285
+ commission_per_mille: int = field()
6286
+ """The number of Telegram Stars received by the bot for each 1000 Telegram Stars
6287
+ received by the affiliate program sponsor from referred users."""
6288
+
6289
+ type: typing.Literal["affiliate_program"] = field(default="affiliate_program")
6290
+ """Type of the transaction partner, always `affiliate_program`."""
6291
+
6292
+ sponsor_user: Option[User] = field(default=UNSET, converter=From["User | None"])
6293
+ """Optional. Information about the bot that sponsored the affiliate program."""
6294
+
6213
6295
 
6214
6296
  class TransactionPartnerFragment(TransactionPartner):
6215
6297
  """Object `TransactionPartnerFragment`, see the [documentation](https://core.telegram.org/bots/api#transactionpartnerfragment).
@@ -6221,11 +6303,9 @@ class TransactionPartnerFragment(TransactionPartner):
6221
6303
  """Type of the transaction partner, always `fragment`."""
6222
6304
 
6223
6305
  withdrawal_state: Option[
6224
- Variative[
6225
- RevenueWithdrawalStatePending, RevenueWithdrawalStateSucceeded, RevenueWithdrawalStateFailed
6226
- ]
6306
+ Variative[RevenueWithdrawalStatePending, RevenueWithdrawalStateSucceeded, RevenueWithdrawalStateFailed]
6227
6307
  ] = field(
6228
- default=Nothing,
6308
+ default=UNSET,
6229
6309
  converter=From[
6230
6310
  "RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed | None"
6231
6311
  ],
@@ -6243,6 +6323,20 @@ class TransactionPartnerTelegramAds(TransactionPartner):
6243
6323
  """Type of the transaction partner, always `telegram_ads`."""
6244
6324
 
6245
6325
 
6326
+ class TransactionPartnerTelegramApi(TransactionPartner):
6327
+ """Object `TransactionPartnerTelegramApi`, see the [documentation](https://core.telegram.org/bots/api#transactionpartnertelegramapi).
6328
+
6329
+ Describes a transaction with payment for paid broadcasting.
6330
+ """
6331
+
6332
+ type: str = field()
6333
+ """Type of the transaction partner, always `telegram_api`."""
6334
+
6335
+ request_count: int = field()
6336
+ """The number of successful requests that exceeded regular limits and were
6337
+ therefore billed."""
6338
+
6339
+
6246
6340
  class TransactionPartnerOther(TransactionPartner):
6247
6341
  """Object `TransactionPartnerOther`, see the [documentation](https://core.telegram.org/bots/api#transactionpartnerother).
6248
6342
 
@@ -6256,31 +6350,38 @@ class TransactionPartnerOther(TransactionPartner):
6256
6350
  class StarTransaction(Model):
6257
6351
  """Object `StarTransaction`, see the [documentation](https://core.telegram.org/bots/api#startransaction).
6258
6352
 
6259
- Describes a Telegram Star transaction.
6353
+ Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.
6260
6354
  """
6261
6355
 
6262
6356
  id: str = field()
6263
- """Unique identifier of the transaction. Coincides with the identifer of
6357
+ """Unique identifier of the transaction. Coincides with the identifier of
6264
6358
  the original transaction for refund transactions. Coincides with SuccessfulPayment.telegram_payment_charge_id
6265
6359
  for successful incoming payments from users."""
6266
6360
 
6267
6361
  amount: int = field()
6268
- """Number of Telegram Stars transferred by the transaction."""
6362
+ """Integer amount of Telegram Stars transferred by the transaction."""
6269
6363
 
6270
6364
  date: datetime = field()
6271
6365
  """Date the transaction was created in Unix time."""
6272
6366
 
6367
+ nanostar_amount: Option[int] = field(default=UNSET, converter=From[int | None])
6368
+ """Optional. The number of 1/1000000000 shares of Telegram Stars transferred
6369
+ by the transaction; from 0 to 999999999."""
6370
+
6273
6371
  source: Option[
6274
6372
  Variative[
6275
6373
  TransactionPartnerUser,
6374
+ TransactionPartnerChat,
6375
+ TransactionPartnerAffiliateProgram,
6276
6376
  TransactionPartnerFragment,
6277
6377
  TransactionPartnerTelegramAds,
6378
+ TransactionPartnerTelegramApi,
6278
6379
  TransactionPartnerOther,
6279
6380
  ]
6280
6381
  ] = field(
6281
- default=Nothing,
6382
+ default=UNSET,
6282
6383
  converter=From[
6283
- "TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther | None"
6384
+ "TransactionPartnerUser | TransactionPartnerChat | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther | None"
6284
6385
  ],
6285
6386
  )
6286
6387
  """Optional. Source of an incoming transaction (e.g., a user purchasing goods
@@ -6290,14 +6391,17 @@ class StarTransaction(Model):
6290
6391
  receiver: Option[
6291
6392
  Variative[
6292
6393
  TransactionPartnerUser,
6394
+ TransactionPartnerChat,
6395
+ TransactionPartnerAffiliateProgram,
6293
6396
  TransactionPartnerFragment,
6294
6397
  TransactionPartnerTelegramAds,
6398
+ TransactionPartnerTelegramApi,
6295
6399
  TransactionPartnerOther,
6296
6400
  ]
6297
6401
  ] = field(
6298
- default=Nothing,
6402
+ default=UNSET,
6299
6403
  converter=From[
6300
- "TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther | None"
6404
+ "TransactionPartnerUser | TransactionPartnerChat | TransactionPartnerAffiliateProgram | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerTelegramApi | TransactionPartnerOther | None"
6301
6405
  ],
6302
6406
  )
6303
6407
  """Optional. Receiver of an outgoing transaction (e.g., a user for a purchase
@@ -6363,45 +6467,43 @@ class EncryptedPassportElement(Model):
6363
6467
  hash: str = field()
6364
6468
  """Base64-encoded element hash for using in PassportElementErrorUnspecified."""
6365
6469
 
6366
- data: Option[str] = field(default=Nothing, converter=From[str | None])
6470
+ data: Option[str] = field(default=UNSET, converter=From[str | None])
6367
6471
  """Optional. Base64-encoded encrypted Telegram Passport element data provided
6368
6472
  by the user; available only for `personal_details`, `passport`, `driver_license`,
6369
6473
  `identity_card`, `internal_passport` and `address` types. Can be decrypted
6370
6474
  and verified using the accompanying EncryptedCredentials."""
6371
6475
 
6372
- phone_number: Option[str] = field(default=Nothing, converter=From[str | None])
6476
+ phone_number: Option[str] = field(default=UNSET, converter=From[str | None])
6373
6477
  """Optional. User's verified phone number; available only for `phone_number`
6374
6478
  type."""
6375
6479
 
6376
- email: Option[str] = field(default=Nothing, converter=From[str | None])
6480
+ email: Option[str] = field(default=UNSET, converter=From[str | None])
6377
6481
  """Optional. User's verified email address; available only for `email` type."""
6378
6482
 
6379
- files: Option[list[PassportFile]] = field(default=Nothing, converter=From["list[PassportFile] | None"])
6483
+ files: Option[list[PassportFile]] = field(default=UNSET, converter=From["list[PassportFile] | None"])
6380
6484
  """Optional. Array of encrypted files with documents provided by the user;
6381
6485
  available only for `utility_bill`, `bank_statement`, `rental_agreement`,
6382
6486
  `passport_registration` and `temporary_registration` types. Files
6383
6487
  can be decrypted and verified using the accompanying EncryptedCredentials."""
6384
6488
 
6385
- front_side: Option[PassportFile] = field(default=Nothing, converter=From["PassportFile | None"])
6489
+ front_side: Option[PassportFile] = field(default=UNSET, converter=From["PassportFile | None"])
6386
6490
  """Optional. Encrypted file with the front side of the document, provided
6387
6491
  by the user; available only for `passport`, `driver_license`, `identity_card`
6388
6492
  and `internal_passport`. The file can be decrypted and verified using
6389
6493
  the accompanying EncryptedCredentials."""
6390
6494
 
6391
- reverse_side: Option[PassportFile] = field(default=Nothing, converter=From["PassportFile | None"])
6495
+ reverse_side: Option[PassportFile] = field(default=UNSET, converter=From["PassportFile | None"])
6392
6496
  """Optional. Encrypted file with the reverse side of the document, provided
6393
6497
  by the user; available only for `driver_license` and `identity_card`.
6394
6498
  The file can be decrypted and verified using the accompanying EncryptedCredentials."""
6395
6499
 
6396
- selfie: Option[PassportFile] = field(default=Nothing, converter=From["PassportFile | None"])
6500
+ selfie: Option[PassportFile] = field(default=UNSET, converter=From["PassportFile | None"])
6397
6501
  """Optional. Encrypted file with the selfie of the user holding a document,
6398
6502
  provided by the user; available if requested for `passport`, `driver_license`,
6399
6503
  `identity_card` and `internal_passport`. The file can be decrypted and
6400
6504
  verified using the accompanying EncryptedCredentials."""
6401
6505
 
6402
- translation: Option[list[PassportFile]] = field(
6403
- default=Nothing, converter=From["list[PassportFile] | None"]
6404
- )
6506
+ translation: Option[list[PassportFile]] = field(default=UNSET, converter=From["list[PassportFile] | None"])
6405
6507
  """Optional. Array of encrypted files with translated versions of documents
6406
6508
  provided by the user; available if requested for `passport`, `driver_license`,
6407
6509
  `identity_card`, `internal_passport`, `utility_bill`, `bank_statement`,
@@ -6681,19 +6783,17 @@ class Game(Model):
6681
6783
  photo: list[PhotoSize] = field()
6682
6784
  """Photo that will be displayed in the game message in chats."""
6683
6785
 
6684
- text: Option[str] = field(default=Nothing, converter=From[str | None])
6786
+ text: Option[str] = field(default=UNSET, converter=From[str | None])
6685
6787
  """Optional. Brief description of the game or high scores included in the game
6686
6788
  message. Can be automatically edited to include current high scores for
6687
6789
  the game when the bot calls setGameScore, or manually edited using editMessageText.
6688
6790
  0-4096 characters."""
6689
6791
 
6690
- text_entities: Option[list[MessageEntity]] = field(
6691
- default=Nothing, converter=From["list[MessageEntity] | None"]
6692
- )
6792
+ text_entities: Option[list[MessageEntity]] = field(default=UNSET, converter=From["list[MessageEntity] | None"])
6693
6793
  """Optional. Special entities that appear in text, such as usernames, URLs,
6694
6794
  bot commands, etc."""
6695
6795
 
6696
- animation: Option[Animation] = field(default=Nothing, converter=From["Animation | None"])
6796
+ animation: Option[Animation] = field(default=UNSET, converter=From["Animation | None"])
6697
6797
  """Optional. Animation that will be displayed in the game message in chats.
6698
6798
  Upload via BotFather."""
6699
6799
 
@@ -6722,6 +6822,7 @@ class GameHighScore(Model):
6722
6822
 
6723
6823
 
6724
6824
  __all__ = (
6825
+ "AffiliateInfo",
6725
6826
  "Animation",
6726
6827
  "Audio",
6727
6828
  "BackgroundFill",
@@ -6782,6 +6883,7 @@ __all__ = (
6782
6883
  "ChatShared",
6783
6884
  "ChosenInlineResult",
6784
6885
  "Contact",
6886
+ "CopyTextButton",
6785
6887
  "Dice",
6786
6888
  "Document",
6787
6889
  "EncryptedCredentials",
@@ -6798,6 +6900,8 @@ __all__ = (
6798
6900
  "GameHighScore",
6799
6901
  "GeneralForumTopicHidden",
6800
6902
  "GeneralForumTopicUnhidden",
6903
+ "Gift",
6904
+ "Gifts",
6801
6905
  "Giveaway",
6802
6906
  "GiveawayCompleted",
6803
6907
  "GiveawayCreated",
@@ -6897,6 +7001,7 @@ __all__ = (
6897
7001
  "PollAnswer",
6898
7002
  "PollOption",
6899
7003
  "PreCheckoutQuery",
7004
+ "PreparedInlineMessage",
6900
7005
  "ProximityAlertTriggered",
6901
7006
  "ReactionCount",
6902
7007
  "ReactionType",
@@ -6926,9 +7031,12 @@ __all__ = (
6926
7031
  "SwitchInlineQueryChosenChat",
6927
7032
  "TextQuote",
6928
7033
  "TransactionPartner",
7034
+ "TransactionPartnerAffiliateProgram",
7035
+ "TransactionPartnerChat",
6929
7036
  "TransactionPartnerFragment",
6930
7037
  "TransactionPartnerOther",
6931
7038
  "TransactionPartnerTelegramAds",
7039
+ "TransactionPartnerTelegramApi",
6932
7040
  "TransactionPartnerUser",
6933
7041
  "Update",
6934
7042
  "User",