telegrinder 0.1.dev168__py3-none-any.whl → 0.1.dev170__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 (100) hide show
  1. telegrinder/__init__.py +9 -3
  2. telegrinder/bot/__init__.py +7 -5
  3. telegrinder/bot/cute_types/base.py +12 -14
  4. telegrinder/bot/cute_types/callback_query.py +54 -43
  5. telegrinder/bot/cute_types/chat_join_request.py +8 -7
  6. telegrinder/bot/cute_types/chat_member_updated.py +23 -17
  7. telegrinder/bot/cute_types/inline_query.py +1 -1
  8. telegrinder/bot/cute_types/message.py +331 -183
  9. telegrinder/bot/cute_types/update.py +4 -8
  10. telegrinder/bot/cute_types/utils.py +1 -5
  11. telegrinder/bot/dispatch/__init__.py +2 -3
  12. telegrinder/bot/dispatch/abc.py +4 -0
  13. telegrinder/bot/dispatch/context.py +9 -4
  14. telegrinder/bot/dispatch/dispatch.py +35 -33
  15. telegrinder/bot/dispatch/handler/func.py +34 -13
  16. telegrinder/bot/dispatch/handler/message_reply.py +6 -3
  17. telegrinder/bot/dispatch/middleware/abc.py +4 -4
  18. telegrinder/bot/dispatch/process.py +40 -13
  19. telegrinder/bot/dispatch/return_manager/abc.py +12 -12
  20. telegrinder/bot/dispatch/return_manager/callback_query.py +1 -3
  21. telegrinder/bot/dispatch/return_manager/inline_query.py +1 -3
  22. telegrinder/bot/dispatch/view/abc.py +37 -45
  23. telegrinder/bot/dispatch/view/box.py +66 -50
  24. telegrinder/bot/dispatch/view/message.py +1 -5
  25. telegrinder/bot/dispatch/view/raw.py +6 -6
  26. telegrinder/bot/dispatch/waiter_machine/__init__.py +2 -1
  27. telegrinder/bot/dispatch/waiter_machine/machine.py +77 -35
  28. telegrinder/bot/dispatch/waiter_machine/middleware.py +31 -7
  29. telegrinder/bot/dispatch/waiter_machine/short_state.py +17 -8
  30. telegrinder/bot/polling/polling.py +4 -4
  31. telegrinder/bot/rules/__init__.py +9 -6
  32. telegrinder/bot/rules/abc.py +99 -22
  33. telegrinder/bot/rules/adapter/__init__.py +4 -1
  34. telegrinder/bot/rules/adapter/abc.py +11 -6
  35. telegrinder/bot/rules/adapter/errors.py +1 -2
  36. telegrinder/bot/rules/adapter/event.py +14 -9
  37. telegrinder/bot/rules/adapter/node.py +42 -0
  38. telegrinder/bot/rules/callback_data.py +4 -4
  39. telegrinder/bot/rules/chat_join.py +3 -2
  40. telegrinder/bot/rules/command.py +26 -14
  41. telegrinder/bot/rules/enum_text.py +5 -5
  42. telegrinder/bot/rules/func.py +6 -6
  43. telegrinder/bot/rules/fuzzy.py +5 -7
  44. telegrinder/bot/rules/inline.py +4 -5
  45. telegrinder/bot/rules/integer.py +10 -8
  46. telegrinder/bot/rules/is_from.py +63 -91
  47. telegrinder/bot/rules/markup.py +5 -5
  48. telegrinder/bot/rules/mention.py +4 -4
  49. telegrinder/bot/rules/message.py +1 -1
  50. telegrinder/bot/rules/node.py +27 -0
  51. telegrinder/bot/rules/regex.py +5 -5
  52. telegrinder/bot/rules/rule_enum.py +4 -4
  53. telegrinder/bot/rules/start.py +5 -5
  54. telegrinder/bot/rules/text.py +9 -13
  55. telegrinder/bot/rules/update.py +4 -4
  56. telegrinder/bot/scenario/__init__.py +3 -3
  57. telegrinder/bot/scenario/choice.py +2 -3
  58. telegrinder/model.py +51 -16
  59. telegrinder/modules.py +14 -6
  60. telegrinder/msgspec_utils.py +67 -23
  61. telegrinder/node/__init__.py +26 -8
  62. telegrinder/node/attachment.py +13 -9
  63. telegrinder/node/base.py +27 -14
  64. telegrinder/node/callback_query.py +18 -0
  65. telegrinder/node/command.py +29 -0
  66. telegrinder/node/composer.py +119 -30
  67. telegrinder/node/me.py +14 -0
  68. telegrinder/node/message.py +2 -4
  69. telegrinder/node/polymorphic.py +44 -0
  70. telegrinder/node/rule.py +26 -22
  71. telegrinder/node/scope.py +36 -0
  72. telegrinder/node/source.py +37 -10
  73. telegrinder/node/text.py +11 -5
  74. telegrinder/node/tools/__init__.py +2 -2
  75. telegrinder/node/tools/generator.py +6 -6
  76. telegrinder/tools/__init__.py +8 -13
  77. telegrinder/tools/buttons.py +23 -17
  78. telegrinder/tools/error_handler/error_handler.py +11 -14
  79. telegrinder/tools/formatting/__init__.py +0 -6
  80. telegrinder/tools/formatting/html.py +10 -12
  81. telegrinder/tools/formatting/links.py +0 -5
  82. telegrinder/tools/formatting/spec_html_formats.py +0 -11
  83. telegrinder/tools/global_context/abc.py +1 -3
  84. telegrinder/tools/global_context/global_context.py +6 -16
  85. telegrinder/tools/i18n/simple.py +1 -3
  86. telegrinder/tools/kb_set/yaml.py +1 -2
  87. telegrinder/tools/keyboard.py +7 -8
  88. telegrinder/tools/limited_dict.py +1 -1
  89. telegrinder/tools/loop_wrapper/loop_wrapper.py +6 -5
  90. telegrinder/tools/magic.py +27 -5
  91. telegrinder/types/__init__.py +20 -0
  92. telegrinder/types/enums.py +37 -31
  93. telegrinder/types/methods.py +608 -327
  94. telegrinder/types/objects.py +1139 -716
  95. {telegrinder-0.1.dev168.dist-info → telegrinder-0.1.dev170.dist-info}/LICENSE +1 -1
  96. {telegrinder-0.1.dev168.dist-info → telegrinder-0.1.dev170.dist-info}/METADATA +6 -5
  97. telegrinder-0.1.dev170.dist-info/RECORD +143 -0
  98. telegrinder/bot/dispatch/composition.py +0 -88
  99. telegrinder-0.1.dev168.dist-info/RECORD +0 -137
  100. {telegrinder-0.1.dev168.dist-info → telegrinder-0.1.dev170.dist-info}/WHEEL +0 -0
@@ -4,7 +4,7 @@ from datetime import datetime
4
4
  from fntypes.co import Result, Variative
5
5
 
6
6
  from telegrinder.api.error import APIError
7
- from telegrinder.model import full_result, get_params
7
+ from telegrinder.model import ProxiedDict, full_result, get_params
8
8
  from telegrinder.types.enums import * # noqa: F403
9
9
  from telegrinder.types.objects import * # noqa: F403
10
10
 
@@ -13,7 +13,13 @@ if typing.TYPE_CHECKING:
13
13
 
14
14
 
15
15
  class APIMethods:
16
- """Telegram Bot API 7.3 methods, released `May 6, 2024`."""
16
+ """Telegram Bot API 7.7 methods, released `July 7, 2024`."""
17
+
18
+ default_params = ProxiedDict(
19
+ typing.TypedDict(
20
+ "DefaultParams", {"parse_mode": str, "question_parse_mode": str, "explanation_parse_mode": str}
21
+ )
22
+ )
17
23
 
18
24
  def __init__(self, api: "ABCAPI") -> None:
19
25
  self.api = api
@@ -28,7 +34,7 @@ class APIMethods:
28
34
  ) -> Result[list[Update], APIError]:
29
35
  """Method `getUpdates`, see the [documentation](https://core.telegram.org/bots/api#getupdates)
30
36
 
31
- Use this method to receive incoming updates using long polling (wiki).
37
+ Use this method to receive incoming updates using long polling (wiki).
32
38
  Returns an Array of Update objects.
33
39
 
34
40
  :param offset: Identifier of the first update to be returned. Must be greater by one than \
@@ -75,13 +81,13 @@ class APIMethods:
75
81
  ) -> Result[bool, APIError]:
76
82
  """Method `setWebhook`, see the [documentation](https://core.telegram.org/bots/api#setwebhook)
77
83
 
78
- Use this method to specify a URL and receive incoming updates via an outgoing
79
- webhook. Whenever there is an update for the bot, we will send an HTTPS POST
80
- request to the specified URL, containing a JSON-serialized Update. In
81
- case of an unsuccessful request, we will give up after a reasonable amount
82
- of attempts. Returns True on success. If you'd like to make sure that the
83
- webhook was set by you, you can specify secret data in the parameter secret_token.
84
- If specified, the request will contain a header "X-Telegram-Bot-Api-Secret-Token"
84
+ Use this method to specify a URL and receive incoming updates via an outgoing
85
+ webhook. Whenever there is an update for the bot, we will send an HTTPS POST
86
+ request to the specified URL, containing a JSON-serialized Update. In
87
+ case of an unsuccessful request, we will give up after a reasonable amount
88
+ of attempts. Returns True on success. If you'd like to make sure that the
89
+ webhook was set by you, you can specify secret data in the parameter secret_token.
90
+ If specified, the request will contain a header "X-Telegram-Bot-Api-Secret-Token"
85
91
  with the secret token as content.
86
92
 
87
93
  :param url: HTTPS URL to send updates to. Use an empty string to remove webhook integration. \
@@ -206,15 +212,18 @@ class APIMethods:
206
212
  text: str,
207
213
  business_connection_id: str | None = None,
208
214
  message_thread_id: int | None = None,
209
- parse_mode: str | None = None,
215
+ parse_mode: str | None = default_params["parse_mode"],
210
216
  entities: list[MessageEntity] | None = None,
211
217
  link_preview_options: LinkPreviewOptions | None = None,
212
218
  disable_notification: bool | None = None,
213
219
  protect_content: bool | None = None,
220
+ message_effect_id: str | None = None,
214
221
  reply_parameters: ReplyParameters | None = None,
215
- reply_markup: (
216
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
217
- ) = None,
222
+ reply_markup: InlineKeyboardMarkup
223
+ | ReplyKeyboardMarkup
224
+ | ReplyKeyboardRemove
225
+ | ForceReply
226
+ | None = None,
218
227
  **other: typing.Any,
219
228
  ) -> Result[Message, APIError]:
220
229
  """Method `sendMessage`, see the [documentation](https://core.telegram.org/bots/api#sendmessage)
@@ -244,6 +253,9 @@ class APIMethods:
244
253
 
245
254
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
246
255
 
256
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
257
+ chats only.
258
+
247
259
  :param reply_parameters: Description of the message to reply to.
248
260
 
249
261
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -269,8 +281,8 @@ class APIMethods:
269
281
  ) -> Result[Message, APIError]:
270
282
  """Method `forwardMessage`, see the [documentation](https://core.telegram.org/bots/api#forwardmessage)
271
283
 
272
- Use this method to forward messages of any kind. Service messages and messages
273
- with protected content can't be forwarded. On success, the sent Message
284
+ Use this method to forward messages of any kind. Service messages and messages
285
+ with protected content can't be forwarded. On success, the sent Message
274
286
  is returned.
275
287
 
276
288
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -307,10 +319,10 @@ class APIMethods:
307
319
  ) -> Result[list[MessageId], APIError]:
308
320
  """Method `forwardMessages`, see the [documentation](https://core.telegram.org/bots/api#forwardmessages)
309
321
 
310
- Use this method to forward multiple messages of any kind. If some of the specified
311
- messages can't be found or forwarded, they are skipped. Service messages
312
- and messages with protected content can't be forwarded. Album grouping
313
- is kept for forwarded messages. On success, an array of MessageId of the
322
+ Use this method to forward multiple messages of any kind. If some of the specified
323
+ messages can't be found or forwarded, they are skipped. Service messages
324
+ and messages with protected content can't be forwarded. Album grouping
325
+ is kept for forwarded messages. On success, an array of MessageId of the
314
326
  sent messages is returned.
315
327
 
316
328
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -345,24 +357,27 @@ class APIMethods:
345
357
  message_id: int,
346
358
  message_thread_id: int | None = None,
347
359
  caption: str | None = None,
348
- parse_mode: str | None = None,
360
+ parse_mode: str | None = default_params["parse_mode"],
349
361
  caption_entities: list[MessageEntity] | None = None,
362
+ show_caption_above_media: bool | None = None,
350
363
  disable_notification: bool | None = None,
351
364
  protect_content: bool | None = None,
352
365
  reply_parameters: ReplyParameters | None = None,
353
- reply_markup: (
354
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
355
- ) = None,
366
+ reply_markup: InlineKeyboardMarkup
367
+ | ReplyKeyboardMarkup
368
+ | ReplyKeyboardRemove
369
+ | ForceReply
370
+ | None = None,
356
371
  **other: typing.Any,
357
372
  ) -> Result[MessageId, APIError]:
358
373
  """Method `copyMessage`, see the [documentation](https://core.telegram.org/bots/api#copymessage)
359
374
 
360
- Use this method to copy messages of any kind. Service messages, giveaway
361
- messages, giveaway winners messages, and invoice messages can't be copied.
362
- A quiz poll can be copied only if the value of the field correct_option_id
363
- is known to the bot. The method is analogous to the method forwardMessage,
364
- but the copied message doesn't have a link to the original message. Returns
365
- the MessageId of the sent message on success.
375
+ Use this method to copy messages of any kind. Service messages, paid media
376
+ messages, giveaway messages, giveaway winners messages, and invoice
377
+ messages can't be copied. A quiz poll can be copied only if the value of the
378
+ field correct_option_id is known to the bot. The method is analogous to
379
+ the method forwardMessage, but the copied message doesn't have a link to
380
+ the original message. Returns the MessageId of the sent message on success.
366
381
 
367
382
  :param chat_id: Unique identifier for the target chat or username of the target channel \
368
383
  (in the format @channelusername).
@@ -384,6 +399,9 @@ class APIMethods:
384
399
  :param caption_entities: A JSON-serialized list of special entities that appear in the new caption, \
385
400
  which can be specified instead of parse_mode.
386
401
 
402
+ :param show_caption_above_media: Pass True, if the caption must be shown above the message media. Ignored \
403
+ if a new caption isn't specified.
404
+
387
405
  :param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
388
406
 
389
407
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
@@ -414,14 +432,14 @@ class APIMethods:
414
432
  ) -> Result[list[MessageId], APIError]:
415
433
  """Method `copyMessages`, see the [documentation](https://core.telegram.org/bots/api#copymessages)
416
434
 
417
- Use this method to copy messages of any kind. If some of the specified messages
418
- can't be found or copied, they are skipped. Service messages, giveaway
419
- messages, giveaway winners messages, and invoice messages can't be copied.
420
- A quiz poll can be copied only if the value of the field correct_option_id
421
- is known to the bot. The method is analogous to the method forwardMessages,
422
- but the copied messages don't have a link to the original message. Album
423
- grouping is kept for copied messages. On success, an array of MessageId
424
- of the sent messages is returned.
435
+ Use this method to copy messages of any kind. If some of the specified messages
436
+ can't be found or copied, they are skipped. Service messages, paid media
437
+ messages, giveaway messages, giveaway winners messages, and invoice
438
+ messages can't be copied. A quiz poll can be copied only if the value of the
439
+ field correct_option_id is known to the bot. The method is analogous to
440
+ the method forwardMessages, but the copied messages don't have a link to
441
+ the original message. Album grouping is kept for copied messages. On success,
442
+ an array of MessageId of the sent messages is returned.
425
443
 
426
444
  :param chat_id: Unique identifier for the target chat or username of the target channel \
427
445
  (in the format @channelusername).
@@ -456,15 +474,19 @@ class APIMethods:
456
474
  business_connection_id: str | None = None,
457
475
  message_thread_id: int | None = None,
458
476
  caption: str | None = None,
459
- parse_mode: str | None = None,
477
+ parse_mode: str | None = default_params["parse_mode"],
460
478
  caption_entities: list[MessageEntity] | None = None,
479
+ show_caption_above_media: bool | None = None,
461
480
  has_spoiler: bool | None = None,
462
481
  disable_notification: bool | None = None,
463
482
  protect_content: bool | None = None,
483
+ message_effect_id: str | None = None,
464
484
  reply_parameters: ReplyParameters | None = None,
465
- reply_markup: (
466
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
467
- ) = None,
485
+ reply_markup: InlineKeyboardMarkup
486
+ | ReplyKeyboardMarkup
487
+ | ReplyKeyboardRemove
488
+ | ForceReply
489
+ | None = None,
468
490
  **other: typing.Any,
469
491
  ) -> Result[Message, APIError]:
470
492
  """Method `sendPhoto`, see the [documentation](https://core.telegram.org/bots/api#sendphoto)
@@ -496,12 +518,17 @@ class APIMethods:
496
518
  :param caption_entities: A JSON-serialized list of special entities that appear in the caption, \
497
519
  which can be specified instead of parse_mode.
498
520
 
521
+ :param show_caption_above_media: Pass True, if the caption must be shown above the message media.
522
+
499
523
  :param has_spoiler: Pass True if the photo needs to be covered with a spoiler animation.
500
524
 
501
525
  :param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
502
526
 
503
527
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
504
528
 
529
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
530
+ chats only.
531
+
505
532
  :param reply_parameters: Description of the message to reply to.
506
533
 
507
534
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -522,7 +549,7 @@ class APIMethods:
522
549
  business_connection_id: str | None = None,
523
550
  message_thread_id: int | None = None,
524
551
  caption: str | None = None,
525
- parse_mode: str | None = None,
552
+ parse_mode: str | None = default_params["parse_mode"],
526
553
  caption_entities: list[MessageEntity] | None = None,
527
554
  duration: int | None = None,
528
555
  performer: str | None = None,
@@ -530,18 +557,21 @@ class APIMethods:
530
557
  thumbnail: InputFile | str | None = None,
531
558
  disable_notification: bool | None = None,
532
559
  protect_content: bool | None = None,
560
+ message_effect_id: str | None = None,
533
561
  reply_parameters: ReplyParameters | None = None,
534
- reply_markup: (
535
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
536
- ) = None,
562
+ reply_markup: InlineKeyboardMarkup
563
+ | ReplyKeyboardMarkup
564
+ | ReplyKeyboardRemove
565
+ | ForceReply
566
+ | None = None,
537
567
  **other: typing.Any,
538
568
  ) -> Result[Message, APIError]:
539
569
  """Method `sendAudio`, see the [documentation](https://core.telegram.org/bots/api#sendaudio)
540
570
 
541
- Use this method to send audio files, if you want Telegram clients to display
542
- them in the music player. Your audio must be in the .MP3 or .M4A format. On
543
- success, the sent Message is returned. Bots can currently send audio files
544
- of up to 50 MB in size, this limit may be changed in the future. For sending
571
+ Use this method to send audio files, if you want Telegram clients to display
572
+ them in the music player. Your audio must be in the .MP3 or .M4A format. On
573
+ success, the sent Message is returned. Bots can currently send audio files
574
+ of up to 50 MB in size, this limit may be changed in the future. For sending
545
575
  voice messages, use the sendVoice method instead.
546
576
 
547
577
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -584,6 +614,9 @@ class APIMethods:
584
614
 
585
615
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
586
616
 
617
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
618
+ chats only.
619
+
587
620
  :param reply_parameters: Description of the message to reply to.
588
621
 
589
622
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -605,21 +638,24 @@ class APIMethods:
605
638
  message_thread_id: int | None = None,
606
639
  thumbnail: InputFile | str | None = None,
607
640
  caption: str | None = None,
608
- parse_mode: str | None = None,
641
+ parse_mode: str | None = default_params["parse_mode"],
609
642
  caption_entities: list[MessageEntity] | None = None,
610
643
  disable_content_type_detection: bool | None = None,
611
644
  disable_notification: bool | None = None,
612
645
  protect_content: bool | None = None,
646
+ message_effect_id: str | None = None,
613
647
  reply_parameters: ReplyParameters | None = None,
614
- reply_markup: (
615
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
616
- ) = None,
648
+ reply_markup: InlineKeyboardMarkup
649
+ | ReplyKeyboardMarkup
650
+ | ReplyKeyboardRemove
651
+ | ForceReply
652
+ | None = None,
617
653
  **other: typing.Any,
618
654
  ) -> Result[Message, APIError]:
619
655
  """Method `sendDocument`, see the [documentation](https://core.telegram.org/bots/api#senddocument)
620
656
 
621
- Use this method to send general files. On success, the sent Message is returned.
622
- Bots can currently send files of any type of up to 50 MB in size, this limit
657
+ Use this method to send general files. On success, the sent Message is returned.
658
+ Bots can currently send files of any type of up to 50 MB in size, this limit
623
659
  may be changed in the future.
624
660
 
625
661
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -660,6 +696,9 @@ class APIMethods:
660
696
 
661
697
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
662
698
 
699
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
700
+ chats only.
701
+
663
702
  :param reply_parameters: Description of the message to reply to.
664
703
 
665
704
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -684,23 +723,27 @@ class APIMethods:
684
723
  height: int | None = None,
685
724
  thumbnail: InputFile | str | None = None,
686
725
  caption: str | None = None,
687
- parse_mode: str | None = None,
726
+ parse_mode: str | None = default_params["parse_mode"],
688
727
  caption_entities: list[MessageEntity] | None = None,
728
+ show_caption_above_media: bool | None = None,
689
729
  has_spoiler: bool | None = None,
690
730
  supports_streaming: bool | None = None,
691
731
  disable_notification: bool | None = None,
692
732
  protect_content: bool | None = None,
733
+ message_effect_id: str | None = None,
693
734
  reply_parameters: ReplyParameters | None = None,
694
- reply_markup: (
695
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
696
- ) = None,
735
+ reply_markup: InlineKeyboardMarkup
736
+ | ReplyKeyboardMarkup
737
+ | ReplyKeyboardRemove
738
+ | ForceReply
739
+ | None = None,
697
740
  **other: typing.Any,
698
741
  ) -> Result[Message, APIError]:
699
742
  """Method `sendVideo`, see the [documentation](https://core.telegram.org/bots/api#sendvideo)
700
743
 
701
- Use this method to send video files, Telegram clients support MPEG4 videos
702
- (other formats may be sent as Document). On success, the sent Message is
703
- returned. Bots can currently send video files of up to 50 MB in size, this
744
+ Use this method to send video files, Telegram clients support MPEG4 videos
745
+ (other formats may be sent as Document). On success, the sent Message is
746
+ returned. Bots can currently send video files of up to 50 MB in size, this
704
747
  limit may be changed in the future.
705
748
 
706
749
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -740,6 +783,8 @@ class APIMethods:
740
783
  :param caption_entities: A JSON-serialized list of special entities that appear in the caption, \
741
784
  which can be specified instead of parse_mode.
742
785
 
786
+ :param show_caption_above_media: Pass True, if the caption must be shown above the message media.
787
+
743
788
  :param has_spoiler: Pass True if the video needs to be covered with a spoiler animation.
744
789
 
745
790
  :param supports_streaming: Pass True if the uploaded video is suitable for streaming.
@@ -748,6 +793,9 @@ class APIMethods:
748
793
 
749
794
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
750
795
 
796
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
797
+ chats only.
798
+
751
799
  :param reply_parameters: Description of the message to reply to.
752
800
 
753
801
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -772,21 +820,25 @@ class APIMethods:
772
820
  height: int | None = None,
773
821
  thumbnail: InputFile | str | None = None,
774
822
  caption: str | None = None,
775
- parse_mode: str | None = None,
823
+ parse_mode: str | None = default_params["parse_mode"],
776
824
  caption_entities: list[MessageEntity] | None = None,
825
+ show_caption_above_media: bool | None = None,
777
826
  has_spoiler: bool | None = None,
778
827
  disable_notification: bool | None = None,
779
828
  protect_content: bool | None = None,
829
+ message_effect_id: str | None = None,
780
830
  reply_parameters: ReplyParameters | None = None,
781
- reply_markup: (
782
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
783
- ) = None,
831
+ reply_markup: InlineKeyboardMarkup
832
+ | ReplyKeyboardMarkup
833
+ | ReplyKeyboardRemove
834
+ | ForceReply
835
+ | None = None,
784
836
  **other: typing.Any,
785
837
  ) -> Result[Message, APIError]:
786
838
  """Method `sendAnimation`, see the [documentation](https://core.telegram.org/bots/api#sendanimation)
787
839
 
788
- Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without
789
- sound). On success, the sent Message is returned. Bots can currently send
840
+ Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without
841
+ sound). On success, the sent Message is returned. Bots can currently send
790
842
  animation files of up to 50 MB in size, this limit may be changed in the future.
791
843
 
792
844
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -826,12 +878,17 @@ class APIMethods:
826
878
  :param caption_entities: A JSON-serialized list of special entities that appear in the caption, \
827
879
  which can be specified instead of parse_mode.
828
880
 
881
+ :param show_caption_above_media: Pass True, if the caption must be shown above the message media.
882
+
829
883
  :param has_spoiler: Pass True if the animation needs to be covered with a spoiler animation. \
830
884
 
831
885
  :param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
832
886
 
833
887
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
834
888
 
889
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
890
+ chats only.
891
+
835
892
  :param reply_parameters: Description of the message to reply to.
836
893
 
837
894
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -852,24 +909,27 @@ class APIMethods:
852
909
  business_connection_id: str | None = None,
853
910
  message_thread_id: int | None = None,
854
911
  caption: str | None = None,
855
- parse_mode: str | None = None,
912
+ parse_mode: str | None = default_params["parse_mode"],
856
913
  caption_entities: list[MessageEntity] | None = None,
857
914
  duration: int | None = None,
858
915
  disable_notification: bool | None = None,
859
916
  protect_content: bool | None = None,
917
+ message_effect_id: str | None = None,
860
918
  reply_parameters: ReplyParameters | None = None,
861
- reply_markup: (
862
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
863
- ) = None,
919
+ reply_markup: InlineKeyboardMarkup
920
+ | ReplyKeyboardMarkup
921
+ | ReplyKeyboardRemove
922
+ | ForceReply
923
+ | None = None,
864
924
  **other: typing.Any,
865
925
  ) -> Result[Message, APIError]:
866
926
  """Method `sendVoice`, see the [documentation](https://core.telegram.org/bots/api#sendvoice)
867
927
 
868
- Use this method to send audio files, if you want Telegram clients to display
869
- the file as a playable voice message. For this to work, your audio must be
870
- in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other
871
- formats may be sent as Audio or Document). On success, the sent Message is
872
- returned. Bots can currently send voice messages of up to 50 MB in size, this
928
+ Use this method to send audio files, if you want Telegram clients to display
929
+ the file as a playable voice message. For this to work, your audio must be
930
+ in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other
931
+ formats may be sent as Audio or Document). On success, the sent Message is
932
+ returned. Bots can currently send voice messages of up to 50 MB in size, this
873
933
  limit may be changed in the future.
874
934
 
875
935
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -900,6 +960,9 @@ class APIMethods:
900
960
 
901
961
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
902
962
 
963
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
964
+ chats only.
965
+
903
966
  :param reply_parameters: Description of the message to reply to.
904
967
 
905
968
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -924,16 +987,19 @@ class APIMethods:
924
987
  thumbnail: InputFile | str | None = None,
925
988
  disable_notification: bool | None = None,
926
989
  protect_content: bool | None = None,
990
+ message_effect_id: str | None = None,
927
991
  reply_parameters: ReplyParameters | None = None,
928
- reply_markup: (
929
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
930
- ) = None,
992
+ reply_markup: InlineKeyboardMarkup
993
+ | ReplyKeyboardMarkup
994
+ | ReplyKeyboardRemove
995
+ | ForceReply
996
+ | None = None,
931
997
  **other: typing.Any,
932
998
  ) -> Result[Message, APIError]:
933
999
  """Method `sendVideoNote`, see the [documentation](https://core.telegram.org/bots/api#sendvideonote)
934
1000
 
935
- As of v.4.0, Telegram clients support rounded square MPEG4 videos of up
936
- to 1 minute long. Use this method to send video messages. On success, the
1001
+ As of v.4.0, Telegram clients support rounded square MPEG4 videos of up
1002
+ to 1 minute long. Use this method to send video messages. On success, the
937
1003
  sent Message is returned.
938
1004
 
939
1005
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -966,6 +1032,9 @@ class APIMethods:
966
1032
 
967
1033
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
968
1034
 
1035
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
1036
+ chats only.
1037
+
969
1038
  :param reply_parameters: Description of the message to reply to.
970
1039
 
971
1040
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -979,6 +1048,64 @@ class APIMethods:
979
1048
  )
980
1049
  return full_result(method_response, Message)
981
1050
 
1051
+ async def send_paid_media(
1052
+ self,
1053
+ chat_id: int | str,
1054
+ star_count: int,
1055
+ media: list[InputPaidMedia],
1056
+ caption: str | None = None,
1057
+ parse_mode: str | None = default_params["parse_mode"],
1058
+ caption_entities: list[MessageEntity] | None = None,
1059
+ show_caption_above_media: bool | None = None,
1060
+ disable_notification: bool | None = None,
1061
+ protect_content: bool | None = None,
1062
+ reply_parameters: ReplyParameters | None = None,
1063
+ reply_markup: InlineKeyboardMarkup
1064
+ | ReplyKeyboardMarkup
1065
+ | ReplyKeyboardRemove
1066
+ | ForceReply
1067
+ | None = None,
1068
+ **other: typing.Any,
1069
+ ) -> Result[Message, APIError]:
1070
+ """Method `sendPaidMedia`, see the [documentation](https://core.telegram.org/bots/api#sendpaidmedia)
1071
+
1072
+ Use this method to send paid media to channel chats. On success, the sent
1073
+ Message is returned.
1074
+
1075
+ :param chat_id: Unique identifier for the target chat or username of the target channel \
1076
+ (in the format @channelusername).
1077
+
1078
+ :param star_count: The number of Telegram Stars that must be paid to buy access to the media. \
1079
+
1080
+ :param media: A JSON-serialized array describing the media to be sent; up to 10 items. \
1081
+
1082
+ :param caption: Media caption, 0-1024 characters after entities parsing.
1083
+
1084
+ :param parse_mode: Mode for parsing entities in the media caption. See formatting options \
1085
+ for more details.
1086
+
1087
+ :param caption_entities: A JSON-serialized list of special entities that appear in the caption, \
1088
+ which can be specified instead of parse_mode.
1089
+
1090
+ :param show_caption_above_media: Pass True, if the caption must be shown above the message media.
1091
+
1092
+ :param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
1093
+
1094
+ :param protect_content: Protects the contents of the sent message from forwarding and saving.
1095
+
1096
+ :param reply_parameters: Description of the message to reply to.
1097
+
1098
+ :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
1099
+ keyboard, custom reply keyboard, instructions to remove a reply keyboard \
1100
+ or to force a reply from the user.
1101
+ """
1102
+
1103
+ method_response = await self.api.request_raw(
1104
+ "sendPaidMedia",
1105
+ get_params(locals()),
1106
+ )
1107
+ return full_result(method_response, Message)
1108
+
982
1109
  async def send_media_group(
983
1110
  self,
984
1111
  chat_id: int | str,
@@ -987,13 +1114,14 @@ class APIMethods:
987
1114
  message_thread_id: int | None = None,
988
1115
  disable_notification: bool | None = None,
989
1116
  protect_content: bool | None = None,
1117
+ message_effect_id: str | None = None,
990
1118
  reply_parameters: ReplyParameters | None = None,
991
1119
  **other: typing.Any,
992
1120
  ) -> Result[list[Message], APIError]:
993
1121
  """Method `sendMediaGroup`, see the [documentation](https://core.telegram.org/bots/api#sendmediagroup)
994
1122
 
995
- Use this method to send a group of photos, videos, documents or audios as
996
- an album. Documents and audio files can be only grouped in an album with messages
1123
+ Use this method to send a group of photos, videos, documents or audios as
1124
+ an album. Documents and audio files can be only grouped in an album with messages
997
1125
  of the same type. On success, an array of Messages that were sent is returned.
998
1126
 
999
1127
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -1012,6 +1140,9 @@ class APIMethods:
1012
1140
 
1013
1141
  :param protect_content: Protects the contents of the sent messages from forwarding and saving. \
1014
1142
 
1143
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
1144
+ chats only.
1145
+
1015
1146
  :param reply_parameters: Description of the message to reply to.
1016
1147
  """
1017
1148
 
@@ -1034,10 +1165,13 @@ class APIMethods:
1034
1165
  proximity_alert_radius: int | None = None,
1035
1166
  disable_notification: bool | None = None,
1036
1167
  protect_content: bool | None = None,
1168
+ message_effect_id: str | None = None,
1037
1169
  reply_parameters: ReplyParameters | None = None,
1038
- reply_markup: (
1039
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
1040
- ) = None,
1170
+ reply_markup: InlineKeyboardMarkup
1171
+ | ReplyKeyboardMarkup
1172
+ | ReplyKeyboardRemove
1173
+ | ForceReply
1174
+ | None = None,
1041
1175
  **other: typing.Any,
1042
1176
  ) -> Result[Message, APIError]:
1043
1177
  """Method `sendLocation`, see the [documentation](https://core.telegram.org/bots/api#sendlocation)
@@ -1073,6 +1207,9 @@ class APIMethods:
1073
1207
 
1074
1208
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
1075
1209
 
1210
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
1211
+ chats only.
1212
+
1076
1213
  :param reply_parameters: Description of the message to reply to.
1077
1214
 
1078
1215
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -1101,15 +1238,18 @@ class APIMethods:
1101
1238
  google_place_type: str | None = None,
1102
1239
  disable_notification: bool | None = None,
1103
1240
  protect_content: bool | None = None,
1241
+ message_effect_id: str | None = None,
1104
1242
  reply_parameters: ReplyParameters | None = None,
1105
- reply_markup: (
1106
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
1107
- ) = None,
1243
+ reply_markup: InlineKeyboardMarkup
1244
+ | ReplyKeyboardMarkup
1245
+ | ReplyKeyboardRemove
1246
+ | ForceReply
1247
+ | None = None,
1108
1248
  **other: typing.Any,
1109
1249
  ) -> Result[Message, APIError]:
1110
1250
  """Method `sendVenue`, see the [documentation](https://core.telegram.org/bots/api#sendvenue)
1111
1251
 
1112
- Use this method to send information about a venue. On success, the sent Message
1252
+ Use this method to send information about a venue. On success, the sent Message
1113
1253
  is returned.
1114
1254
 
1115
1255
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -1142,6 +1282,9 @@ class APIMethods:
1142
1282
 
1143
1283
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
1144
1284
 
1285
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
1286
+ chats only.
1287
+
1145
1288
  :param reply_parameters: Description of the message to reply to.
1146
1289
 
1147
1290
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -1166,10 +1309,13 @@ class APIMethods:
1166
1309
  vcard: str | None = None,
1167
1310
  disable_notification: bool | None = None,
1168
1311
  protect_content: bool | None = None,
1312
+ message_effect_id: str | None = None,
1169
1313
  reply_parameters: ReplyParameters | None = None,
1170
- reply_markup: (
1171
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
1172
- ) = None,
1314
+ reply_markup: InlineKeyboardMarkup
1315
+ | ReplyKeyboardMarkup
1316
+ | ReplyKeyboardRemove
1317
+ | ForceReply
1318
+ | None = None,
1173
1319
  **other: typing.Any,
1174
1320
  ) -> Result[Message, APIError]:
1175
1321
  """Method `sendContact`, see the [documentation](https://core.telegram.org/bots/api#sendcontact)
@@ -1197,6 +1343,9 @@ class APIMethods:
1197
1343
 
1198
1344
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
1199
1345
 
1346
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
1347
+ chats only.
1348
+
1200
1349
  :param reply_parameters: Description of the message to reply to.
1201
1350
 
1202
1351
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -1217,24 +1366,27 @@ class APIMethods:
1217
1366
  options: list[InputPollOption],
1218
1367
  business_connection_id: str | None = None,
1219
1368
  message_thread_id: int | None = None,
1220
- question_parse_mode: str | None = None,
1369
+ question_parse_mode: str | None = default_params["question_parse_mode"],
1221
1370
  question_entities: list[MessageEntity] | None = None,
1222
1371
  is_anonymous: bool | None = None,
1223
1372
  type: typing.Literal["quiz", "regular"] | None = None,
1224
1373
  allows_multiple_answers: bool | None = None,
1225
1374
  correct_option_id: int | None = None,
1226
1375
  explanation: str | None = None,
1227
- explanation_parse_mode: str | None = None,
1376
+ explanation_parse_mode: str | None = default_params["explanation_parse_mode"],
1228
1377
  explanation_entities: list[MessageEntity] | None = None,
1229
1378
  open_period: int | None = None,
1230
1379
  close_date: datetime | int | None = None,
1231
1380
  is_closed: bool | None = None,
1232
1381
  disable_notification: bool | None = None,
1233
1382
  protect_content: bool | None = None,
1383
+ message_effect_id: str | None = None,
1234
1384
  reply_parameters: ReplyParameters | None = None,
1235
- reply_markup: (
1236
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
1237
- ) = None,
1385
+ reply_markup: InlineKeyboardMarkup
1386
+ | ReplyKeyboardMarkup
1387
+ | ReplyKeyboardRemove
1388
+ | ForceReply
1389
+ | None = None,
1238
1390
  **other: typing.Any,
1239
1391
  ) -> Result[Message, APIError]:
1240
1392
  """Method `sendPoll`, see the [documentation](https://core.telegram.org/bots/api#sendpoll)
@@ -1294,6 +1446,9 @@ class APIMethods:
1294
1446
 
1295
1447
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
1296
1448
 
1449
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
1450
+ chats only.
1451
+
1297
1452
  :param reply_parameters: Description of the message to reply to.
1298
1453
 
1299
1454
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -1315,15 +1470,18 @@ class APIMethods:
1315
1470
  emoji: DiceEmoji | None = None,
1316
1471
  disable_notification: bool | None = None,
1317
1472
  protect_content: bool | None = None,
1473
+ message_effect_id: str | None = None,
1318
1474
  reply_parameters: ReplyParameters | None = None,
1319
- reply_markup: (
1320
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
1321
- ) = None,
1475
+ reply_markup: InlineKeyboardMarkup
1476
+ | ReplyKeyboardMarkup
1477
+ | ReplyKeyboardRemove
1478
+ | ForceReply
1479
+ | None = None,
1322
1480
  **other: typing.Any,
1323
1481
  ) -> Result[Message, APIError]:
1324
1482
  """Method `sendDice`, see the [documentation](https://core.telegram.org/bots/api#senddice)
1325
1483
 
1326
- Use this method to send an animated emoji that will display a random value.
1484
+ Use this method to send an animated emoji that will display a random value.
1327
1485
  On success, the sent Message is returned.
1328
1486
 
1329
1487
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -1343,6 +1501,9 @@ class APIMethods:
1343
1501
 
1344
1502
  :param protect_content: Protects the contents of the sent message from forwarding.
1345
1503
 
1504
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
1505
+ chats only.
1506
+
1346
1507
  :param reply_parameters: Description of the message to reply to.
1347
1508
 
1348
1509
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -1366,10 +1527,10 @@ class APIMethods:
1366
1527
  ) -> Result[bool, APIError]:
1367
1528
  """Method `sendChatAction`, see the [documentation](https://core.telegram.org/bots/api#sendchataction)
1368
1529
 
1369
- Use this method when you need to tell the user that something is happening
1370
- on the bot's side. The status is set for 5 seconds or less (when a message arrives
1371
- from your bot, Telegram clients clear its typing status). Returns True
1372
- on success. We only recommend using this method when a response from the
1530
+ Use this method when you need to tell the user that something is happening
1531
+ on the bot's side. The status is set for 5 seconds or less (when a message arrives
1532
+ from your bot, Telegram clients clear its typing status). Returns True
1533
+ on success. We only recommend using this method when a response from the
1373
1534
  bot will take a noticeable amount of time to arrive.
1374
1535
 
1375
1536
  :param business_connection_id: Unique identifier of the business connection on behalf of which the action \
@@ -1404,9 +1565,9 @@ class APIMethods:
1404
1565
  ) -> Result[bool, APIError]:
1405
1566
  """Method `setMessageReaction`, see the [documentation](https://core.telegram.org/bots/api#setmessagereaction)
1406
1567
 
1407
- Use this method to change the chosen reactions on a message. Service messages
1408
- can't be reacted to. Automatically forwarded messages from a channel to
1409
- its discussion group have the same available reactions as messages in the
1568
+ Use this method to change the chosen reactions on a message. Service messages
1569
+ can't be reacted to. Automatically forwarded messages from a channel to
1570
+ its discussion group have the same available reactions as messages in the
1410
1571
  channel. Returns True on success.
1411
1572
 
1412
1573
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1438,7 +1599,7 @@ class APIMethods:
1438
1599
  ) -> Result[UserProfilePhotos, APIError]:
1439
1600
  """Method `getUserProfilePhotos`, see the [documentation](https://core.telegram.org/bots/api#getuserprofilephotos)
1440
1601
 
1441
- Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos
1602
+ Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos
1442
1603
  object.
1443
1604
 
1444
1605
  :param user_id: Unique identifier of the target user.
@@ -1491,10 +1652,10 @@ class APIMethods:
1491
1652
  ) -> Result[bool, APIError]:
1492
1653
  """Method `banChatMember`, see the [documentation](https://core.telegram.org/bots/api#banchatmember)
1493
1654
 
1494
- Use this method to ban a user in a group, a supergroup or a channel. In the case
1495
- of supergroups and channels, the user will not be able to return to the chat
1496
- on their own using invite links, etc., unless unbanned first. The bot must
1497
- be an administrator in the chat for this to work and must have the appropriate
1655
+ Use this method to ban a user in a group, a supergroup or a channel. In the case
1656
+ of supergroups and channels, the user will not be able to return to the chat
1657
+ on their own using invite links, etc., unless unbanned first. The bot must
1658
+ be an administrator in the chat for this to work and must have the appropriate
1498
1659
  administrator rights. Returns True on success.
1499
1660
 
1500
1661
  :param chat_id: Unique identifier for the target group or username of the target supergroup \
@@ -1526,12 +1687,12 @@ class APIMethods:
1526
1687
  ) -> Result[bool, APIError]:
1527
1688
  """Method `unbanChatMember`, see the [documentation](https://core.telegram.org/bots/api#unbanchatmember)
1528
1689
 
1529
- Use this method to unban a previously banned user in a supergroup or channel.
1530
- The user will not return to the group or channel automatically, but will
1531
- be able to join via link, etc. The bot must be an administrator for this to
1532
- work. By default, this method guarantees that after the call the user is
1533
- not a member of the chat, but will be able to join it. So if the user is a member
1534
- of the chat they will also be removed from the chat. If you don't want this,
1690
+ Use this method to unban a previously banned user in a supergroup or channel.
1691
+ The user will not return to the group or channel automatically, but will
1692
+ be able to join via link, etc. The bot must be an administrator for this to
1693
+ work. By default, this method guarantees that after the call the user is
1694
+ not a member of the chat, but will be able to join it. So if the user is a member
1695
+ of the chat they will also be removed from the chat. If you don't want this,
1535
1696
  use the parameter only_if_banned. Returns True on success.
1536
1697
 
1537
1698
  :param chat_id: Unique identifier for the target group or username of the target supergroup \
@@ -1559,9 +1720,9 @@ class APIMethods:
1559
1720
  ) -> Result[bool, APIError]:
1560
1721
  """Method `restrictChatMember`, see the [documentation](https://core.telegram.org/bots/api#restrictchatmember)
1561
1722
 
1562
- Use this method to restrict a user in a supergroup. The bot must be an administrator
1563
- in the supergroup for this to work and must have the appropriate administrator
1564
- rights. Pass True for all permissions to lift restrictions from a user.
1723
+ Use this method to restrict a user in a supergroup. The bot must be an administrator
1724
+ in the supergroup for this to work and must have the appropriate administrator
1725
+ rights. Pass True for all permissions to lift restrictions from a user.
1565
1726
  Returns True on success.
1566
1727
 
1567
1728
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -1611,9 +1772,9 @@ class APIMethods:
1611
1772
  ) -> Result[bool, APIError]:
1612
1773
  """Method `promoteChatMember`, see the [documentation](https://core.telegram.org/bots/api#promotechatmember)
1613
1774
 
1614
- Use this method to promote or demote a user in a supergroup or a channel. The
1615
- bot must be an administrator in the chat for this to work and must have the
1616
- appropriate administrator rights. Pass False for all boolean parameters
1775
+ Use this method to promote or demote a user in a supergroup or a channel. The
1776
+ bot must be an administrator in the chat for this to work and must have the
1777
+ appropriate administrator rights. Pass False for all boolean parameters
1617
1778
  to demote a user. Returns True on success.
1618
1779
 
1619
1780
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1677,7 +1838,7 @@ class APIMethods:
1677
1838
  ) -> Result[bool, APIError]:
1678
1839
  """Method `setChatAdministratorCustomTitle`, see the [documentation](https://core.telegram.org/bots/api#setchatadministratorcustomtitle)
1679
1840
 
1680
- Use this method to set a custom title for an administrator in a supergroup
1841
+ Use this method to set a custom title for an administrator in a supergroup
1681
1842
  promoted by the bot. Returns True on success.
1682
1843
 
1683
1844
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -1703,10 +1864,10 @@ class APIMethods:
1703
1864
  ) -> Result[bool, APIError]:
1704
1865
  """Method `banChatSenderChat`, see the [documentation](https://core.telegram.org/bots/api#banchatsenderchat)
1705
1866
 
1706
- Use this method to ban a channel chat in a supergroup or a channel. Until the
1707
- chat is unbanned, the owner of the banned chat won't be able to send messages
1708
- on behalf of any of their channels. The bot must be an administrator in the
1709
- supergroup or channel for this to work and must have the appropriate administrator
1867
+ Use this method to ban a channel chat in a supergroup or a channel. Until the
1868
+ chat is unbanned, the owner of the banned chat won't be able to send messages
1869
+ on behalf of any of their channels. The bot must be an administrator in the
1870
+ supergroup or channel for this to work and must have the appropriate administrator
1710
1871
  rights. Returns True on success.
1711
1872
 
1712
1873
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1729,8 +1890,8 @@ class APIMethods:
1729
1890
  ) -> Result[bool, APIError]:
1730
1891
  """Method `unbanChatSenderChat`, see the [documentation](https://core.telegram.org/bots/api#unbanchatsenderchat)
1731
1892
 
1732
- Use this method to unban a previously banned channel chat in a supergroup
1733
- or channel. The bot must be an administrator for this to work and must have
1893
+ Use this method to unban a previously banned channel chat in a supergroup
1894
+ or channel. The bot must be an administrator for this to work and must have
1734
1895
  the appropriate administrator rights. Returns True on success.
1735
1896
 
1736
1897
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1754,9 +1915,9 @@ class APIMethods:
1754
1915
  ) -> Result[bool, APIError]:
1755
1916
  """Method `setChatPermissions`, see the [documentation](https://core.telegram.org/bots/api#setchatpermissions)
1756
1917
 
1757
- Use this method to set default chat permissions for all members. The bot
1758
- must be an administrator in the group or a supergroup for this to work and
1759
- must have the can_restrict_members administrator rights. Returns True
1918
+ Use this method to set default chat permissions for all members. The bot
1919
+ must be an administrator in the group or a supergroup for this to work and
1920
+ must have the can_restrict_members administrator rights. Returns True
1760
1921
  on success.
1761
1922
 
1762
1923
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -1784,9 +1945,9 @@ class APIMethods:
1784
1945
  ) -> Result[str, APIError]:
1785
1946
  """Method `exportChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#exportchatinvitelink)
1786
1947
 
1787
- Use this method to generate a new primary invite link for a chat; any previously
1788
- generated primary link is revoked. The bot must be an administrator in the
1789
- chat for this to work and must have the appropriate administrator rights.
1948
+ Use this method to generate a new primary invite link for a chat; any previously
1949
+ generated primary link is revoked. The bot must be an administrator in the
1950
+ chat for this to work and must have the appropriate administrator rights.
1790
1951
  Returns the new invite link as String on success.
1791
1952
 
1792
1953
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1810,9 +1971,9 @@ class APIMethods:
1810
1971
  ) -> Result[ChatInviteLink, APIError]:
1811
1972
  """Method `createChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#createchatinvitelink)
1812
1973
 
1813
- Use this method to create an additional invite link for a chat. The bot must
1814
- be an administrator in the chat for this to work and must have the appropriate
1815
- administrator rights. The link can be revoked using the method revokeChatInviteLink.
1974
+ Use this method to create an additional invite link for a chat. The bot must
1975
+ be an administrator in the chat for this to work and must have the appropriate
1976
+ administrator rights. The link can be revoked using the method revokeChatInviteLink.
1816
1977
  Returns the new invite link as ChatInviteLink object.
1817
1978
 
1818
1979
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1847,9 +2008,9 @@ class APIMethods:
1847
2008
  ) -> Result[ChatInviteLink, APIError]:
1848
2009
  """Method `editChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#editchatinvitelink)
1849
2010
 
1850
- Use this method to edit a non-primary invite link created by the bot. The
1851
- bot must be an administrator in the chat for this to work and must have the
1852
- appropriate administrator rights. Returns the edited invite link as a
2011
+ Use this method to edit a non-primary invite link created by the bot. The
2012
+ bot must be an administrator in the chat for this to work and must have the
2013
+ appropriate administrator rights. Returns the edited invite link as a
1853
2014
  ChatInviteLink object.
1854
2015
 
1855
2016
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1882,10 +2043,10 @@ class APIMethods:
1882
2043
  ) -> Result[ChatInviteLink, APIError]:
1883
2044
  """Method `revokeChatInviteLink`, see the [documentation](https://core.telegram.org/bots/api#revokechatinvitelink)
1884
2045
 
1885
- Use this method to revoke an invite link created by the bot. If the primary
1886
- link is revoked, a new link is automatically generated. The bot must be an
1887
- administrator in the chat for this to work and must have the appropriate
1888
- administrator rights. Returns the revoked invite link as ChatInviteLink
2046
+ Use this method to revoke an invite link created by the bot. If the primary
2047
+ link is revoked, a new link is automatically generated. The bot must be an
2048
+ administrator in the chat for this to work and must have the appropriate
2049
+ administrator rights. Returns the revoked invite link as ChatInviteLink
1889
2050
  object.
1890
2051
 
1891
2052
  :param chat_id: Unique identifier of the target chat or username of the target channel (in \
@@ -1908,8 +2069,8 @@ class APIMethods:
1908
2069
  ) -> Result[bool, APIError]:
1909
2070
  """Method `approveChatJoinRequest`, see the [documentation](https://core.telegram.org/bots/api#approvechatjoinrequest)
1910
2071
 
1911
- Use this method to approve a chat join request. The bot must be an administrator
1912
- in the chat for this to work and must have the can_invite_users administrator
2072
+ Use this method to approve a chat join request. The bot must be an administrator
2073
+ in the chat for this to work and must have the can_invite_users administrator
1913
2074
  right. Returns True on success.
1914
2075
 
1915
2076
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1932,8 +2093,8 @@ class APIMethods:
1932
2093
  ) -> Result[bool, APIError]:
1933
2094
  """Method `declineChatJoinRequest`, see the [documentation](https://core.telegram.org/bots/api#declinechatjoinrequest)
1934
2095
 
1935
- Use this method to decline a chat join request. The bot must be an administrator
1936
- in the chat for this to work and must have the can_invite_users administrator
2096
+ Use this method to decline a chat join request. The bot must be an administrator
2097
+ in the chat for this to work and must have the can_invite_users administrator
1937
2098
  right. Returns True on success.
1938
2099
 
1939
2100
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1956,9 +2117,9 @@ class APIMethods:
1956
2117
  ) -> Result[bool, APIError]:
1957
2118
  """Method `setChatPhoto`, see the [documentation](https://core.telegram.org/bots/api#setchatphoto)
1958
2119
 
1959
- Use this method to set a new profile photo for the chat. Photos can't be changed
1960
- for private chats. The bot must be an administrator in the chat for this to
1961
- work and must have the appropriate administrator rights. Returns True
2120
+ Use this method to set a new profile photo for the chat. Photos can't be changed
2121
+ for private chats. The bot must be an administrator in the chat for this to
2122
+ work and must have the appropriate administrator rights. Returns True
1962
2123
  on success.
1963
2124
 
1964
2125
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -1980,8 +2141,8 @@ class APIMethods:
1980
2141
  ) -> Result[bool, APIError]:
1981
2142
  """Method `deleteChatPhoto`, see the [documentation](https://core.telegram.org/bots/api#deletechatphoto)
1982
2143
 
1983
- Use this method to delete a chat photo. Photos can't be changed for private
1984
- chats. The bot must be an administrator in the chat for this to work and must
2144
+ Use this method to delete a chat photo. Photos can't be changed for private
2145
+ chats. The bot must be an administrator in the chat for this to work and must
1985
2146
  have the appropriate administrator rights. Returns True on success.
1986
2147
 
1987
2148
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -2002,8 +2163,8 @@ class APIMethods:
2002
2163
  ) -> Result[bool, APIError]:
2003
2164
  """Method `setChatTitle`, see the [documentation](https://core.telegram.org/bots/api#setchattitle)
2004
2165
 
2005
- Use this method to change the title of a chat. Titles can't be changed for
2006
- private chats. The bot must be an administrator in the chat for this to work
2166
+ Use this method to change the title of a chat. Titles can't be changed for
2167
+ private chats. The bot must be an administrator in the chat for this to work
2007
2168
  and must have the appropriate administrator rights. Returns True on success.
2008
2169
 
2009
2170
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -2026,8 +2187,8 @@ class APIMethods:
2026
2187
  ) -> Result[bool, APIError]:
2027
2188
  """Method `setChatDescription`, see the [documentation](https://core.telegram.org/bots/api#setchatdescription)
2028
2189
 
2029
- Use this method to change the description of a group, a supergroup or a channel.
2030
- The bot must be an administrator in the chat for this to work and must have
2190
+ Use this method to change the description of a group, a supergroup or a channel.
2191
+ The bot must be an administrator in the chat for this to work and must have
2031
2192
  the appropriate administrator rights. Returns True on success.
2032
2193
 
2033
2194
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -2051,10 +2212,10 @@ class APIMethods:
2051
2212
  ) -> Result[bool, APIError]:
2052
2213
  """Method `pinChatMessage`, see the [documentation](https://core.telegram.org/bots/api#pinchatmessage)
2053
2214
 
2054
- Use this method to add a message to the list of pinned messages in a chat. If
2055
- the chat is not a private chat, the bot must be an administrator in the chat
2056
- for this to work and must have the 'can_pin_messages' administrator right
2057
- in a supergroup or 'can_edit_messages' administrator right in a channel.
2215
+ Use this method to add a message to the list of pinned messages in a chat. If
2216
+ the chat is not a private chat, the bot must be an administrator in the chat
2217
+ for this to work and must have the 'can_pin_messages' administrator right
2218
+ in a supergroup or 'can_edit_messages' administrator right in a channel.
2058
2219
  Returns True on success.
2059
2220
 
2060
2221
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -2081,10 +2242,10 @@ class APIMethods:
2081
2242
  ) -> Result[bool, APIError]:
2082
2243
  """Method `unpinChatMessage`, see the [documentation](https://core.telegram.org/bots/api#unpinchatmessage)
2083
2244
 
2084
- Use this method to remove a message from the list of pinned messages in a chat.
2085
- If the chat is not a private chat, the bot must be an administrator in the chat
2086
- for this to work and must have the 'can_pin_messages' administrator right
2087
- in a supergroup or 'can_edit_messages' administrator right in a channel.
2245
+ Use this method to remove a message from the list of pinned messages in a chat.
2246
+ If the chat is not a private chat, the bot must be an administrator in the chat
2247
+ for this to work and must have the 'can_pin_messages' administrator right
2248
+ in a supergroup or 'can_edit_messages' administrator right in a channel.
2088
2249
  Returns True on success.
2089
2250
 
2090
2251
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -2107,10 +2268,10 @@ class APIMethods:
2107
2268
  ) -> Result[bool, APIError]:
2108
2269
  """Method `unpinAllChatMessages`, see the [documentation](https://core.telegram.org/bots/api#unpinallchatmessages)
2109
2270
 
2110
- Use this method to clear the list of pinned messages in a chat. If the chat
2111
- is not a private chat, the bot must be an administrator in the chat for this
2112
- to work and must have the 'can_pin_messages' administrator right in a supergroup
2113
- or 'can_edit_messages' administrator right in a channel. Returns True
2271
+ Use this method to clear the list of pinned messages in a chat. If the chat
2272
+ is not a private chat, the bot must be an administrator in the chat for this
2273
+ to work and must have the 'can_pin_messages' administrator right in a supergroup
2274
+ or 'can_edit_messages' administrator right in a channel. Returns True
2114
2275
  on success.
2115
2276
 
2116
2277
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -2130,7 +2291,7 @@ class APIMethods:
2130
2291
  ) -> Result[bool, APIError]:
2131
2292
  """Method `leaveChat`, see the [documentation](https://core.telegram.org/bots/api#leavechat)
2132
2293
 
2133
- Use this method for your bot to leave a group, supergroup or channel. Returns
2294
+ Use this method for your bot to leave a group, supergroup or channel. Returns
2134
2295
  True on success.
2135
2296
 
2136
2297
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2150,7 +2311,7 @@ class APIMethods:
2150
2311
  ) -> Result[ChatFullInfo, APIError]:
2151
2312
  """Method `getChat`, see the [documentation](https://core.telegram.org/bots/api#getchat)
2152
2313
 
2153
- Use this method to get up-to-date information about the chat. Returns a
2314
+ Use this method to get up-to-date information about the chat. Returns a
2154
2315
  ChatFullInfo object on success.
2155
2316
 
2156
2317
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2182,7 +2343,7 @@ class APIMethods:
2182
2343
  ]:
2183
2344
  """Method `getChatAdministrators`, see the [documentation](https://core.telegram.org/bots/api#getchatadministrators)
2184
2345
 
2185
- Use this method to get a list of administrators in a chat, which aren't bots.
2346
+ Use this method to get a list of administrators in a chat, which aren't bots.
2186
2347
  Returns an Array of ChatMember objects.
2187
2348
 
2188
2349
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2244,8 +2405,8 @@ class APIMethods:
2244
2405
  ]:
2245
2406
  """Method `getChatMember`, see the [documentation](https://core.telegram.org/bots/api#getchatmember)
2246
2407
 
2247
- Use this method to get information about a member of a chat. The method is
2248
- only guaranteed to work for other users if the bot is an administrator in
2408
+ Use this method to get information about a member of a chat. The method is
2409
+ only guaranteed to work for other users if the bot is an administrator in
2249
2410
  the chat. Returns a ChatMember object on success.
2250
2411
 
2251
2412
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2278,10 +2439,10 @@ class APIMethods:
2278
2439
  ) -> Result[bool, APIError]:
2279
2440
  """Method `setChatStickerSet`, see the [documentation](https://core.telegram.org/bots/api#setchatstickerset)
2280
2441
 
2281
- Use this method to set a new group sticker set for a supergroup. The bot must
2282
- be an administrator in the chat for this to work and must have the appropriate
2283
- administrator rights. Use the field can_set_sticker_set optionally
2284
- returned in getChat requests to check if the bot can use this method. Returns
2442
+ Use this method to set a new group sticker set for a supergroup. The bot must
2443
+ be an administrator in the chat for this to work and must have the appropriate
2444
+ administrator rights. Use the field can_set_sticker_set optionally
2445
+ returned in getChat requests to check if the bot can use this method. Returns
2285
2446
  True on success.
2286
2447
 
2287
2448
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2303,10 +2464,10 @@ class APIMethods:
2303
2464
  ) -> Result[bool, APIError]:
2304
2465
  """Method `deleteChatStickerSet`, see the [documentation](https://core.telegram.org/bots/api#deletechatstickerset)
2305
2466
 
2306
- Use this method to delete a group sticker set from a supergroup. The bot must
2307
- be an administrator in the chat for this to work and must have the appropriate
2308
- administrator rights. Use the field can_set_sticker_set optionally
2309
- returned in getChat requests to check if the bot can use this method. Returns
2467
+ Use this method to delete a group sticker set from a supergroup. The bot must
2468
+ be an administrator in the chat for this to work and must have the appropriate
2469
+ administrator rights. Use the field can_set_sticker_set optionally
2470
+ returned in getChat requests to check if the bot can use this method. Returns
2310
2471
  True on success.
2311
2472
 
2312
2473
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2343,9 +2504,9 @@ class APIMethods:
2343
2504
  ) -> Result[ForumTopic, APIError]:
2344
2505
  """Method `createForumTopic`, see the [documentation](https://core.telegram.org/bots/api#createforumtopic)
2345
2506
 
2346
- Use this method to create a topic in a forum supergroup chat. The bot must
2347
- be an administrator in the chat for this to work and must have the can_manage_topics
2348
- administrator rights. Returns information about the created topic as
2507
+ Use this method to create a topic in a forum supergroup chat. The bot must
2508
+ be an administrator in the chat for this to work and must have the can_manage_topics
2509
+ administrator rights. Returns information about the created topic as
2349
2510
  a ForumTopic object.
2350
2511
 
2351
2512
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2377,9 +2538,9 @@ class APIMethods:
2377
2538
  ) -> Result[bool, APIError]:
2378
2539
  """Method `editForumTopic`, see the [documentation](https://core.telegram.org/bots/api#editforumtopic)
2379
2540
 
2380
- Use this method to edit name and icon of a topic in a forum supergroup chat.
2381
- The bot must be an administrator in the chat for this to work and must have
2382
- can_manage_topics administrator rights, unless it is the creator of the
2541
+ Use this method to edit name and icon of a topic in a forum supergroup chat.
2542
+ The bot must be an administrator in the chat for this to work and must have
2543
+ can_manage_topics administrator rights, unless it is the creator of the
2383
2544
  topic. Returns True on success.
2384
2545
 
2385
2546
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2409,9 +2570,9 @@ class APIMethods:
2409
2570
  ) -> Result[bool, APIError]:
2410
2571
  """Method `closeForumTopic`, see the [documentation](https://core.telegram.org/bots/api#closeforumtopic)
2411
2572
 
2412
- Use this method to close an open topic in a forum supergroup chat. The bot
2413
- must be an administrator in the chat for this to work and must have the can_manage_topics
2414
- administrator rights, unless it is the creator of the topic. Returns True
2573
+ Use this method to close an open topic in a forum supergroup chat. The bot
2574
+ must be an administrator in the chat for this to work and must have the can_manage_topics
2575
+ administrator rights, unless it is the creator of the topic. Returns True
2415
2576
  on success.
2416
2577
 
2417
2578
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2434,9 +2595,9 @@ class APIMethods:
2434
2595
  ) -> Result[bool, APIError]:
2435
2596
  """Method `reopenForumTopic`, see the [documentation](https://core.telegram.org/bots/api#reopenforumtopic)
2436
2597
 
2437
- Use this method to reopen a closed topic in a forum supergroup chat. The bot
2438
- must be an administrator in the chat for this to work and must have the can_manage_topics
2439
- administrator rights, unless it is the creator of the topic. Returns True
2598
+ Use this method to reopen a closed topic in a forum supergroup chat. The bot
2599
+ must be an administrator in the chat for this to work and must have the can_manage_topics
2600
+ administrator rights, unless it is the creator of the topic. Returns True
2440
2601
  on success.
2441
2602
 
2442
2603
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2459,9 +2620,9 @@ class APIMethods:
2459
2620
  ) -> Result[bool, APIError]:
2460
2621
  """Method `deleteForumTopic`, see the [documentation](https://core.telegram.org/bots/api#deleteforumtopic)
2461
2622
 
2462
- Use this method to delete a forum topic along with all its messages in a forum
2463
- supergroup chat. The bot must be an administrator in the chat for this to
2464
- work and must have the can_delete_messages administrator rights. Returns
2623
+ Use this method to delete a forum topic along with all its messages in a forum
2624
+ supergroup chat. The bot must be an administrator in the chat for this to
2625
+ work and must have the can_delete_messages administrator rights. Returns
2465
2626
  True on success.
2466
2627
 
2467
2628
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2484,9 +2645,9 @@ class APIMethods:
2484
2645
  ) -> Result[bool, APIError]:
2485
2646
  """Method `unpinAllForumTopicMessages`, see the [documentation](https://core.telegram.org/bots/api#unpinallforumtopicmessages)
2486
2647
 
2487
- Use this method to clear the list of pinned messages in a forum topic. The
2488
- bot must be an administrator in the chat for this to work and must have the
2489
- can_pin_messages administrator right in the supergroup. Returns True
2648
+ Use this method to clear the list of pinned messages in a forum topic. The
2649
+ bot must be an administrator in the chat for this to work and must have the
2650
+ can_pin_messages administrator right in the supergroup. Returns True
2490
2651
  on success.
2491
2652
 
2492
2653
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2509,8 +2670,8 @@ class APIMethods:
2509
2670
  ) -> Result[bool, APIError]:
2510
2671
  """Method `editGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#editgeneralforumtopic)
2511
2672
 
2512
- Use this method to edit the name of the 'General' topic in a forum supergroup
2513
- chat. The bot must be an administrator in the chat for this to work and must
2673
+ Use this method to edit the name of the 'General' topic in a forum supergroup
2674
+ chat. The bot must be an administrator in the chat for this to work and must
2514
2675
  have can_manage_topics administrator rights. Returns True on success.
2515
2676
 
2516
2677
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2532,8 +2693,8 @@ class APIMethods:
2532
2693
  ) -> Result[bool, APIError]:
2533
2694
  """Method `closeGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#closegeneralforumtopic)
2534
2695
 
2535
- Use this method to close an open 'General' topic in a forum supergroup chat.
2536
- The bot must be an administrator in the chat for this to work and must have
2696
+ Use this method to close an open 'General' topic in a forum supergroup chat.
2697
+ The bot must be an administrator in the chat for this to work and must have
2537
2698
  the can_manage_topics administrator rights. Returns True on success.
2538
2699
 
2539
2700
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2553,9 +2714,9 @@ class APIMethods:
2553
2714
  ) -> Result[bool, APIError]:
2554
2715
  """Method `reopenGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#reopengeneralforumtopic)
2555
2716
 
2556
- Use this method to reopen a closed 'General' topic in a forum supergroup
2557
- chat. The bot must be an administrator in the chat for this to work and must
2558
- have the can_manage_topics administrator rights. The topic will be automatically
2717
+ Use this method to reopen a closed 'General' topic in a forum supergroup
2718
+ chat. The bot must be an administrator in the chat for this to work and must
2719
+ have the can_manage_topics administrator rights. The topic will be automatically
2559
2720
  unhidden if it was hidden. Returns True on success.
2560
2721
 
2561
2722
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2575,9 +2736,9 @@ class APIMethods:
2575
2736
  ) -> Result[bool, APIError]:
2576
2737
  """Method `hideGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#hidegeneralforumtopic)
2577
2738
 
2578
- Use this method to hide the 'General' topic in a forum supergroup chat. The
2579
- bot must be an administrator in the chat for this to work and must have the
2580
- can_manage_topics administrator rights. The topic will be automatically
2739
+ Use this method to hide the 'General' topic in a forum supergroup chat. The
2740
+ bot must be an administrator in the chat for this to work and must have the
2741
+ can_manage_topics administrator rights. The topic will be automatically
2581
2742
  closed if it was open. Returns True on success.
2582
2743
 
2583
2744
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2597,8 +2758,8 @@ class APIMethods:
2597
2758
  ) -> Result[bool, APIError]:
2598
2759
  """Method `unhideGeneralForumTopic`, see the [documentation](https://core.telegram.org/bots/api#unhidegeneralforumtopic)
2599
2760
 
2600
- Use this method to unhide the 'General' topic in a forum supergroup chat.
2601
- The bot must be an administrator in the chat for this to work and must have
2761
+ Use this method to unhide the 'General' topic in a forum supergroup chat.
2762
+ The bot must be an administrator in the chat for this to work and must have
2602
2763
  the can_manage_topics administrator rights. Returns True on success.
2603
2764
 
2604
2765
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2618,9 +2779,9 @@ class APIMethods:
2618
2779
  ) -> Result[bool, APIError]:
2619
2780
  """Method `unpinAllGeneralForumTopicMessages`, see the [documentation](https://core.telegram.org/bots/api#unpinallgeneralforumtopicmessages)
2620
2781
 
2621
- Use this method to clear the list of pinned messages in a General forum topic.
2622
- The bot must be an administrator in the chat for this to work and must have
2623
- the can_pin_messages administrator right in the supergroup. Returns
2782
+ Use this method to clear the list of pinned messages in a General forum topic.
2783
+ The bot must be an administrator in the chat for this to work and must have
2784
+ the can_pin_messages administrator right in the supergroup. Returns
2624
2785
  True on success.
2625
2786
 
2626
2787
  :param chat_id: Unique identifier for the target chat or username of the target supergroup \
@@ -2644,8 +2805,8 @@ class APIMethods:
2644
2805
  ) -> Result[bool, APIError]:
2645
2806
  """Method `answerCallbackQuery`, see the [documentation](https://core.telegram.org/bots/api#answercallbackquery)
2646
2807
 
2647
- Use this method to send answers to callback queries sent from inline keyboards.
2648
- The answer will be displayed to the user as a notification at the top of the
2808
+ Use this method to send answers to callback queries sent from inline keyboards.
2809
+ The answer will be displayed to the user as a notification at the top of the
2649
2810
  chat screen or as an alert. On success, True is returned.
2650
2811
 
2651
2812
  :param callback_query_id: Unique identifier for the query to be answered.
@@ -2681,7 +2842,7 @@ class APIMethods:
2681
2842
  ) -> Result[UserChatBoosts, APIError]:
2682
2843
  """Method `getUserChatBoosts`, see the [documentation](https://core.telegram.org/bots/api#getuserchatboosts)
2683
2844
 
2684
- Use this method to get the list of boosts added to a chat by a user. Requires
2845
+ Use this method to get the list of boosts added to a chat by a user. Requires
2685
2846
  administrator rights in the chat. Returns a UserChatBoosts object.
2686
2847
 
2687
2848
  :param chat_id: Unique identifier for the chat or username of the channel (in the format \
@@ -2724,7 +2885,7 @@ class APIMethods:
2724
2885
  ) -> Result[bool, APIError]:
2725
2886
  """Method `setMyCommands`, see the [documentation](https://core.telegram.org/bots/api#setmycommands)
2726
2887
 
2727
- Use this method to change the list of the bot's commands. See this manual
2888
+ Use this method to change the list of the bot's commands. See this manual
2728
2889
  for more details about bot commands. Returns True on success.
2729
2890
 
2730
2891
  :param commands: A JSON-serialized list of bot commands to be set as the list of the bot's commands. \
@@ -2752,8 +2913,8 @@ class APIMethods:
2752
2913
  ) -> Result[bool, APIError]:
2753
2914
  """Method `deleteMyCommands`, see the [documentation](https://core.telegram.org/bots/api#deletemycommands)
2754
2915
 
2755
- Use this method to delete the list of the bot's commands for the given scope
2756
- and user language. After deletion, higher level commands will be shown
2916
+ Use this method to delete the list of the bot's commands for the given scope
2917
+ and user language. After deletion, higher level commands will be shown
2757
2918
  to affected users. Returns True on success.
2758
2919
 
2759
2920
  :param scope: A JSON-serialized object, describing scope of users for which the commands \
@@ -2778,8 +2939,8 @@ class APIMethods:
2778
2939
  ) -> Result[list[BotCommand], APIError]:
2779
2940
  """Method `getMyCommands`, see the [documentation](https://core.telegram.org/bots/api#getmycommands)
2780
2941
 
2781
- Use this method to get the current list of the bot's commands for the given
2782
- scope and user language. Returns an Array of BotCommand objects. If commands
2942
+ Use this method to get the current list of the bot's commands for the given
2943
+ scope and user language. Returns an Array of BotCommand objects. If commands
2783
2944
  aren't set, an empty list is returned.
2784
2945
 
2785
2946
  :param scope: A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault. \
@@ -2843,7 +3004,7 @@ class APIMethods:
2843
3004
  ) -> Result[bool, APIError]:
2844
3005
  """Method `setMyDescription`, see the [documentation](https://core.telegram.org/bots/api#setmydescription)
2845
3006
 
2846
- Use this method to change the bot's description, which is shown in the chat
3007
+ Use this method to change the bot's description, which is shown in the chat
2847
3008
  with the bot if the chat is empty. Returns True on success.
2848
3009
 
2849
3010
  :param description: New bot description; 0-512 characters. Pass an empty string to remove the \
@@ -2886,8 +3047,8 @@ class APIMethods:
2886
3047
  ) -> Result[bool, APIError]:
2887
3048
  """Method `setMyShortDescription`, see the [documentation](https://core.telegram.org/bots/api#setmyshortdescription)
2888
3049
 
2889
- Use this method to change the bot's short description, which is shown on
2890
- the bot's profile page and is sent together with the link when users share
3050
+ Use this method to change the bot's short description, which is shown on
3051
+ the bot's profile page and is sent together with the link when users share
2891
3052
  the bot. Returns True on success.
2892
3053
 
2893
3054
  :param short_description: New short description for the bot; 0-120 characters. Pass an empty string \
@@ -2930,7 +3091,7 @@ class APIMethods:
2930
3091
  ) -> Result[bool, APIError]:
2931
3092
  """Method `setChatMenuButton`, see the [documentation](https://core.telegram.org/bots/api#setchatmenubutton)
2932
3093
 
2933
- Use this method to change the bot's menu button in a private chat, or the default
3094
+ Use this method to change the bot's menu button in a private chat, or the default
2934
3095
  menu button. Returns True on success.
2935
3096
 
2936
3097
  :param chat_id: Unique identifier for the target private chat. If not specified, default \
@@ -2952,7 +3113,7 @@ class APIMethods:
2952
3113
  ) -> Result[Variative[MenuButtonCommands, MenuButtonWebApp, MenuButtonDefault], APIError]:
2953
3114
  """Method `getChatMenuButton`, see the [documentation](https://core.telegram.org/bots/api#getchatmenubutton)
2954
3115
 
2955
- Use this method to get the current value of the bot's menu button in a private
3116
+ Use this method to get the current value of the bot's menu button in a private
2956
3117
  chat, or the default menu button. Returns MenuButton on success.
2957
3118
 
2958
3119
  :param chat_id: Unique identifier for the target private chat. If not specified, default \
@@ -2975,9 +3136,9 @@ class APIMethods:
2975
3136
  ) -> Result[bool, APIError]:
2976
3137
  """Method `setMyDefaultAdministratorRights`, see the [documentation](https://core.telegram.org/bots/api#setmydefaultadministratorrights)
2977
3138
 
2978
- Use this method to change the default administrator rights requested by
2979
- the bot when it's added as an administrator to groups or channels. These
2980
- rights will be suggested to users, but they are free to modify the list before
3139
+ Use this method to change the default administrator rights requested by
3140
+ the bot when it's added as an administrator to groups or channels. These
3141
+ rights will be suggested to users, but they are free to modify the list before
2981
3142
  adding the bot. Returns True on success.
2982
3143
 
2983
3144
  :param rights: A JSON-serialized object describing new default administrator rights. \
@@ -3001,7 +3162,7 @@ class APIMethods:
3001
3162
  ) -> Result[ChatAdministratorRights, APIError]:
3002
3163
  """Method `getMyDefaultAdministratorRights`, see the [documentation](https://core.telegram.org/bots/api#getmydefaultadministratorrights)
3003
3164
 
3004
- Use this method to get the current default administrator rights of the bot.
3165
+ Use this method to get the current default administrator rights of the bot.
3005
3166
  Returns ChatAdministratorRights on success.
3006
3167
 
3007
3168
  :param for_channels: Pass True to get default administrator rights of the bot in channels. Otherwise, \
@@ -3018,10 +3179,11 @@ class APIMethods:
3018
3179
  async def edit_message_text(
3019
3180
  self,
3020
3181
  text: str,
3182
+ business_connection_id: str | None = None,
3021
3183
  chat_id: int | str | None = None,
3022
3184
  message_id: int | None = None,
3023
3185
  inline_message_id: str | None = None,
3024
- parse_mode: str | None = None,
3186
+ parse_mode: str | None = default_params["parse_mode"],
3025
3187
  entities: list[MessageEntity] | None = None,
3026
3188
  link_preview_options: LinkPreviewOptions | None = None,
3027
3189
  reply_markup: InlineKeyboardMarkup | None = None,
@@ -3029,9 +3191,14 @@ class APIMethods:
3029
3191
  ) -> Result[Variative[Message, bool], APIError]:
3030
3192
  """Method `editMessageText`, see the [documentation](https://core.telegram.org/bots/api#editmessagetext)
3031
3193
 
3032
- Use this method to edit text and game messages. On success, if the edited
3033
- message is not an inline message, the edited Message is returned, otherwise
3034
- True is returned.
3194
+ Use this method to edit text and game messages. On success, if the edited
3195
+ message is not an inline message, the edited Message is returned, otherwise
3196
+ True is returned. Note that business messages that were not sent by the bot
3197
+ and do not contain an inline keyboard can only be edited within 48 hours from
3198
+ the time they were sent.
3199
+
3200
+ :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
3201
+ to be edited was sent.
3035
3202
 
3036
3203
  :param chat_id: Required if inline_message_id is not specified. Unique identifier for \
3037
3204
  the target chat or username of the target channel (in the format @channelusername). \
@@ -3063,20 +3230,27 @@ class APIMethods:
3063
3230
 
3064
3231
  async def edit_message_caption(
3065
3232
  self,
3233
+ business_connection_id: str | None = None,
3066
3234
  chat_id: int | str | None = None,
3067
3235
  message_id: int | None = None,
3068
3236
  inline_message_id: str | None = None,
3069
3237
  caption: str | None = None,
3070
- parse_mode: str | None = None,
3238
+ parse_mode: str | None = default_params["parse_mode"],
3071
3239
  caption_entities: list[MessageEntity] | None = None,
3240
+ show_caption_above_media: bool | None = None,
3072
3241
  reply_markup: InlineKeyboardMarkup | None = None,
3073
3242
  **other: typing.Any,
3074
3243
  ) -> Result[Variative[Message, bool], APIError]:
3075
3244
  """Method `editMessageCaption`, see the [documentation](https://core.telegram.org/bots/api#editmessagecaption)
3076
3245
 
3077
- Use this method to edit captions of messages. On success, if the edited message
3078
- is not an inline message, the edited Message is returned, otherwise True
3079
- is returned.
3246
+ Use this method to edit captions of messages. On success, if the edited message
3247
+ is not an inline message, the edited Message is returned, otherwise True
3248
+ is returned. Note that business messages that were not sent by the bot and
3249
+ do not contain an inline keyboard can only be edited within 48 hours from
3250
+ the time they were sent.
3251
+
3252
+ :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
3253
+ to be edited was sent.
3080
3254
 
3081
3255
  :param chat_id: Required if inline_message_id is not specified. Unique identifier for \
3082
3256
  the target chat or username of the target channel (in the format @channelusername). \
@@ -3095,6 +3269,9 @@ class APIMethods:
3095
3269
  :param caption_entities: A JSON-serialized list of special entities that appear in the caption, \
3096
3270
  which can be specified instead of parse_mode.
3097
3271
 
3272
+ :param show_caption_above_media: Pass True, if the caption must be shown above the message media. Supported \
3273
+ only for animation, photo and video messages.
3274
+
3098
3275
  :param reply_markup: A JSON-serialized object for an inline keyboard.
3099
3276
  """
3100
3277
 
@@ -3107,6 +3284,7 @@ class APIMethods:
3107
3284
  async def edit_message_media(
3108
3285
  self,
3109
3286
  media: InputMedia,
3287
+ business_connection_id: str | None = None,
3110
3288
  chat_id: int | str | None = None,
3111
3289
  message_id: int | None = None,
3112
3290
  inline_message_id: str | None = None,
@@ -3115,13 +3293,18 @@ class APIMethods:
3115
3293
  ) -> Result[Variative[Message, bool], APIError]:
3116
3294
  """Method `editMessageMedia`, see the [documentation](https://core.telegram.org/bots/api#editmessagemedia)
3117
3295
 
3118
- Use this method to edit animation, audio, document, photo, or video messages.
3119
- If a message is part of a message album, then it can be edited only to an audio
3120
- for audio albums, only to a document for document albums and to a photo or
3121
- a video otherwise. When an inline message is edited, a new file can't be uploaded;
3122
- use a previously uploaded file via its file_id or specify a URL. On success,
3123
- if the edited message is not an inline message, the edited Message is returned,
3124
- otherwise True is returned.
3296
+ Use this method to edit animation, audio, document, photo, or video messages.
3297
+ If a message is part of a message album, then it can be edited only to an audio
3298
+ for audio albums, only to a document for document albums and to a photo or
3299
+ a video otherwise. When an inline message is edited, a new file can't be uploaded;
3300
+ use a previously uploaded file via its file_id or specify a URL. On success,
3301
+ if the edited message is not an inline message, the edited Message is returned,
3302
+ otherwise True is returned. Note that business messages that were not sent
3303
+ by the bot and do not contain an inline keyboard can only be edited within
3304
+ 48 hours from the time they were sent.
3305
+
3306
+ :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
3307
+ to be edited was sent.
3125
3308
 
3126
3309
  :param chat_id: Required if inline_message_id is not specified. Unique identifier for \
3127
3310
  the target chat or username of the target channel (in the format @channelusername). \
@@ -3147,6 +3330,7 @@ class APIMethods:
3147
3330
  self,
3148
3331
  latitude: float,
3149
3332
  longitude: float,
3333
+ business_connection_id: str | None = None,
3150
3334
  chat_id: int | str | None = None,
3151
3335
  message_id: int | None = None,
3152
3336
  inline_message_id: str | None = None,
@@ -3159,11 +3343,14 @@ class APIMethods:
3159
3343
  ) -> Result[Variative[Message, bool], APIError]:
3160
3344
  """Method `editMessageLiveLocation`, see the [documentation](https://core.telegram.org/bots/api#editmessagelivelocation)
3161
3345
 
3162
- Use this method to edit live location messages. A location can be edited
3163
- until its live_period expires or editing is explicitly disabled by a call
3164
- to stopMessageLiveLocation. On success, if the edited message is not an
3346
+ Use this method to edit live location messages. A location can be edited
3347
+ until its live_period expires or editing is explicitly disabled by a call
3348
+ to stopMessageLiveLocation. On success, if the edited message is not an
3165
3349
  inline message, the edited Message is returned, otherwise True is returned.
3166
3350
 
3351
+ :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
3352
+ to be edited was sent.
3353
+
3167
3354
  :param chat_id: Required if inline_message_id is not specified. Unique identifier for \
3168
3355
  the target chat or username of the target channel (in the format @channelusername). \
3169
3356
 
@@ -3203,6 +3390,7 @@ class APIMethods:
3203
3390
 
3204
3391
  async def stop_message_live_location(
3205
3392
  self,
3393
+ business_connection_id: str | None = None,
3206
3394
  chat_id: int | str | None = None,
3207
3395
  message_id: int | None = None,
3208
3396
  inline_message_id: str | None = None,
@@ -3211,10 +3399,13 @@ class APIMethods:
3211
3399
  ) -> Result[Variative[Message, bool], APIError]:
3212
3400
  """Method `stopMessageLiveLocation`, see the [documentation](https://core.telegram.org/bots/api#stopmessagelivelocation)
3213
3401
 
3214
- Use this method to stop updating a live location message before live_period
3215
- expires. On success, if the message is not an inline message, the edited
3402
+ Use this method to stop updating a live location message before live_period
3403
+ expires. On success, if the message is not an inline message, the edited
3216
3404
  Message is returned, otherwise True is returned.
3217
3405
 
3406
+ :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
3407
+ to be edited was sent.
3408
+
3218
3409
  :param chat_id: Required if inline_message_id is not specified. Unique identifier for \
3219
3410
  the target chat or username of the target channel (in the format @channelusername). \
3220
3411
 
@@ -3235,6 +3426,7 @@ class APIMethods:
3235
3426
 
3236
3427
  async def edit_message_reply_markup(
3237
3428
  self,
3429
+ business_connection_id: str | None = None,
3238
3430
  chat_id: int | str | None = None,
3239
3431
  message_id: int | None = None,
3240
3432
  inline_message_id: str | None = None,
@@ -3243,9 +3435,14 @@ class APIMethods:
3243
3435
  ) -> Result[Variative[Message, bool], APIError]:
3244
3436
  """Method `editMessageReplyMarkup`, see the [documentation](https://core.telegram.org/bots/api#editmessagereplymarkup)
3245
3437
 
3246
- Use this method to edit only the reply markup of messages. On success, if
3247
- the edited message is not an inline message, the edited Message is returned,
3248
- otherwise True is returned.
3438
+ Use this method to edit only the reply markup of messages. On success, if
3439
+ the edited message is not an inline message, the edited Message is returned,
3440
+ otherwise True is returned. Note that business messages that were not sent
3441
+ by the bot and do not contain an inline keyboard can only be edited within
3442
+ 48 hours from the time they were sent.
3443
+
3444
+ :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
3445
+ to be edited was sent.
3249
3446
 
3250
3447
  :param chat_id: Required if inline_message_id is not specified. Unique identifier for \
3251
3448
  the target chat or username of the target channel (in the format @channelusername). \
@@ -3269,14 +3466,18 @@ class APIMethods:
3269
3466
  self,
3270
3467
  chat_id: int | str,
3271
3468
  message_id: int,
3469
+ business_connection_id: str | None = None,
3272
3470
  reply_markup: InlineKeyboardMarkup | None = None,
3273
3471
  **other: typing.Any,
3274
3472
  ) -> Result[Poll, APIError]:
3275
3473
  """Method `stopPoll`, see the [documentation](https://core.telegram.org/bots/api#stoppoll)
3276
3474
 
3277
- Use this method to stop a poll which was sent by the bot. On success, the stopped
3475
+ Use this method to stop a poll which was sent by the bot. On success, the stopped
3278
3476
  Poll is returned.
3279
3477
 
3478
+ :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
3479
+ to be edited was sent.
3480
+
3280
3481
  :param chat_id: Unique identifier for the target chat or username of the target channel \
3281
3482
  (in the format @channelusername).
3282
3483
 
@@ -3299,16 +3500,16 @@ class APIMethods:
3299
3500
  ) -> Result[bool, APIError]:
3300
3501
  """Method `deleteMessage`, see the [documentation](https://core.telegram.org/bots/api#deletemessage)
3301
3502
 
3302
- Use this method to delete a message, including service messages, with the
3303
- following limitations: - A message can only be deleted if it was sent less
3304
- than 48 hours ago. - Service messages about a supergroup, channel, or forum
3305
- topic creation can't be deleted. - A dice message in a private chat can only
3306
- be deleted if it was sent more than 24 hours ago. - Bots can delete outgoing
3307
- messages in private chats, groups, and supergroups. - Bots can delete incoming
3308
- messages in private chats. - Bots granted can_post_messages permissions
3309
- can delete outgoing messages in channels. - If the bot is an administrator
3310
- of a group, it can delete any message there. - If the bot has can_delete_messages
3311
- permission in a supergroup or a channel, it can delete any message there.
3503
+ Use this method to delete a message, including service messages, with the
3504
+ following limitations: - A message can only be deleted if it was sent less
3505
+ than 48 hours ago. - Service messages about a supergroup, channel, or forum
3506
+ topic creation can't be deleted. - A dice message in a private chat can only
3507
+ be deleted if it was sent more than 24 hours ago. - Bots can delete outgoing
3508
+ messages in private chats, groups, and supergroups. - Bots can delete incoming
3509
+ messages in private chats. - Bots granted can_post_messages permissions
3510
+ can delete outgoing messages in channels. - If the bot is an administrator
3511
+ of a group, it can delete any message there. - If the bot has can_delete_messages
3512
+ permission in a supergroup or a channel, it can delete any message there.
3312
3513
  Returns True on success.
3313
3514
 
3314
3515
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -3331,8 +3532,8 @@ class APIMethods:
3331
3532
  ) -> Result[bool, APIError]:
3332
3533
  """Method `deleteMessages`, see the [documentation](https://core.telegram.org/bots/api#deletemessages)
3333
3534
 
3334
- Use this method to delete multiple messages simultaneously. If some of
3335
- the specified messages can't be found, they are skipped. Returns True on
3535
+ Use this method to delete multiple messages simultaneously. If some of
3536
+ the specified messages can't be found, they are skipped. Returns True on
3336
3537
  success.
3337
3538
 
3338
3539
  :param chat_id: Unique identifier for the target chat or username of the target channel \
@@ -3357,15 +3558,18 @@ class APIMethods:
3357
3558
  emoji: str | None = None,
3358
3559
  disable_notification: bool | None = None,
3359
3560
  protect_content: bool | None = None,
3561
+ message_effect_id: str | None = None,
3360
3562
  reply_parameters: ReplyParameters | None = None,
3361
- reply_markup: (
3362
- InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None
3363
- ) = None,
3563
+ reply_markup: InlineKeyboardMarkup
3564
+ | ReplyKeyboardMarkup
3565
+ | ReplyKeyboardRemove
3566
+ | ForceReply
3567
+ | None = None,
3364
3568
  **other: typing.Any,
3365
3569
  ) -> Result[Message, APIError]:
3366
3570
  """Method `sendSticker`, see the [documentation](https://core.telegram.org/bots/api#sendsticker)
3367
3571
 
3368
- Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
3572
+ Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
3369
3573
  On success, the sent Message is returned.
3370
3574
 
3371
3575
  :param business_connection_id: Unique identifier of the business connection on behalf of which the message \
@@ -3390,6 +3594,9 @@ class APIMethods:
3390
3594
 
3391
3595
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
3392
3596
 
3597
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
3598
+ chats only.
3599
+
3393
3600
  :param reply_parameters: Description of the message to reply to.
3394
3601
 
3395
3602
  :param reply_markup: Additional interface options. A JSON-serialized object for an inline \
@@ -3428,7 +3635,7 @@ class APIMethods:
3428
3635
  ) -> Result[list[Sticker], APIError]:
3429
3636
  """Method `getCustomEmojiStickers`, see the [documentation](https://core.telegram.org/bots/api#getcustomemojistickers)
3430
3637
 
3431
- Use this method to get information about custom emoji stickers by their
3638
+ Use this method to get information about custom emoji stickers by their
3432
3639
  identifiers. Returns an Array of Sticker objects.
3433
3640
 
3434
3641
  :param custom_emoji_ids: A JSON-serialized list of custom emoji identifiers. At most 200 custom \
@@ -3450,8 +3657,8 @@ class APIMethods:
3450
3657
  ) -> Result[File, APIError]:
3451
3658
  """Method `uploadStickerFile`, see the [documentation](https://core.telegram.org/bots/api#uploadstickerfile)
3452
3659
 
3453
- Use this method to upload a file with a sticker for later use in the createNewStickerSet,
3454
- addStickerToSet, or replaceStickerInSet methods (the file can be used
3660
+ Use this method to upload a file with a sticker for later use in the createNewStickerSet,
3661
+ addStickerToSet, or replaceStickerInSet methods (the file can be used
3455
3662
  multiple times). Returns the uploaded File on success.
3456
3663
 
3457
3664
  :param user_id: User identifier of sticker file owner.
@@ -3480,7 +3687,7 @@ class APIMethods:
3480
3687
  ) -> Result[bool, APIError]:
3481
3688
  """Method `createNewStickerSet`, see the [documentation](https://core.telegram.org/bots/api#createnewstickerset)
3482
3689
 
3483
- Use this method to create a new sticker set owned by a user. The bot will be
3690
+ Use this method to create a new sticker set owned by a user. The bot will be
3484
3691
  able to edit the sticker set thus created. Returns True on success.
3485
3692
 
3486
3693
  :param user_id: User identifier of created sticker set owner.
@@ -3519,8 +3726,8 @@ class APIMethods:
3519
3726
  ) -> Result[bool, APIError]:
3520
3727
  """Method `addStickerToSet`, see the [documentation](https://core.telegram.org/bots/api#addstickertoset)
3521
3728
 
3522
- Use this method to add a new sticker to a set created by the bot. Emoji sticker
3523
- sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers.
3729
+ Use this method to add a new sticker to a set created by the bot. Emoji sticker
3730
+ sets can have up to 200 stickers. Other sticker sets can have up to 120 stickers.
3524
3731
  Returns True on success.
3525
3732
 
3526
3733
  :param user_id: User identifier of sticker set owner.
@@ -3589,8 +3796,8 @@ class APIMethods:
3589
3796
  ) -> Result[bool, APIError]:
3590
3797
  """Method `replaceStickerInSet`, see the [documentation](https://core.telegram.org/bots/api#replacestickerinset)
3591
3798
 
3592
- Use this method to replace an existing sticker in a sticker set with a new
3593
- one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet,
3799
+ Use this method to replace an existing sticker in a sticker set with a new
3800
+ one. The method is equivalent to calling deleteStickerFromSet, then addStickerToSet,
3594
3801
  then setStickerPositionInSet. Returns True on success.
3595
3802
 
3596
3803
  :param user_id: User identifier of the sticker set owner.
@@ -3641,8 +3848,8 @@ class APIMethods:
3641
3848
  ) -> Result[bool, APIError]:
3642
3849
  """Method `setStickerKeywords`, see the [documentation](https://core.telegram.org/bots/api#setstickerkeywords)
3643
3850
 
3644
- Use this method to change search keywords assigned to a regular or custom
3645
- emoji sticker. The sticker must belong to a sticker set created by the bot.
3851
+ Use this method to change search keywords assigned to a regular or custom
3852
+ emoji sticker. The sticker must belong to a sticker set created by the bot.
3646
3853
  Returns True on success.
3647
3854
 
3648
3855
  :param sticker: File identifier of the sticker.
@@ -3665,7 +3872,7 @@ class APIMethods:
3665
3872
  ) -> Result[bool, APIError]:
3666
3873
  """Method `setStickerMaskPosition`, see the [documentation](https://core.telegram.org/bots/api#setstickermaskposition)
3667
3874
 
3668
- Use this method to change the mask position of a mask sticker. The sticker
3875
+ Use this method to change the mask position of a mask sticker. The sticker
3669
3876
  must belong to a sticker set that was created by the bot. Returns True on success.
3670
3877
 
3671
3878
  :param sticker: File identifier of the sticker.
@@ -3712,8 +3919,8 @@ class APIMethods:
3712
3919
  ) -> Result[bool, APIError]:
3713
3920
  """Method `setStickerSetThumbnail`, see the [documentation](https://core.telegram.org/bots/api#setstickersetthumbnail)
3714
3921
 
3715
- Use this method to set the thumbnail of a regular or mask sticker set. The
3716
- format of the thumbnail file must match the format of the stickers in the
3922
+ Use this method to set the thumbnail of a regular or mask sticker set. The
3923
+ format of the thumbnail file must match the format of the stickers in the
3717
3924
  set. Returns True on success.
3718
3925
 
3719
3926
  :param name: Sticker set name.
@@ -3751,7 +3958,7 @@ class APIMethods:
3751
3958
  ) -> Result[bool, APIError]:
3752
3959
  """Method `setCustomEmojiStickerSetThumbnail`, see the [documentation](https://core.telegram.org/bots/api#setcustomemojistickersetthumbnail)
3753
3960
 
3754
- Use this method to set the thumbnail of a custom emoji sticker set. Returns
3961
+ Use this method to set the thumbnail of a custom emoji sticker set. Returns
3755
3962
  True on success.
3756
3963
 
3757
3964
  :param name: Sticker set name.
@@ -3797,7 +4004,7 @@ class APIMethods:
3797
4004
  ) -> Result[bool, APIError]:
3798
4005
  """Method `answerInlineQuery`, see the [documentation](https://core.telegram.org/bots/api#answerinlinequery)
3799
4006
 
3800
- Use this method to send answers to an inline query. On success, True is returned.
4007
+ Use this method to send answers to an inline query. On success, True is returned.
3801
4008
  No more than 50 results per query are allowed.
3802
4009
 
3803
4010
  :param inline_query_id: Unique identifier for the answered query.
@@ -3854,10 +4061,10 @@ class APIMethods:
3854
4061
  title: str,
3855
4062
  description: str,
3856
4063
  payload: str,
3857
- provider_token: str,
3858
4064
  currency: str,
3859
4065
  prices: list[LabeledPrice],
3860
4066
  message_thread_id: int | None = None,
4067
+ provider_token: str | None = None,
3861
4068
  max_tip_amount: int | None = None,
3862
4069
  suggested_tip_amounts: list[int] | None = None,
3863
4070
  start_parameter: str | None = None,
@@ -3875,6 +4082,7 @@ class APIMethods:
3875
4082
  is_flexible: bool | None = None,
3876
4083
  disable_notification: bool | None = None,
3877
4084
  protect_content: bool | None = None,
4085
+ message_effect_id: str | None = None,
3878
4086
  reply_parameters: ReplyParameters | None = None,
3879
4087
  reply_markup: InlineKeyboardMarkup | None = None,
3880
4088
  **other: typing.Any,
@@ -3896,18 +4104,22 @@ class APIMethods:
3896
4104
  :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to \
3897
4105
  the user, use for your internal processes.
3898
4106
 
3899
- :param provider_token: Payment provider token, obtained via @BotFather.
4107
+ :param provider_token: Payment provider token, obtained via @BotFather. Pass an empty string \
4108
+ for payments in Telegram Stars.
3900
4109
 
3901
- :param currency: Three-letter ISO 4217 currency code, see more on currencies.
4110
+ :param currency: Three-letter ISO 4217 currency code, see more on currencies. Pass `XTR` \
4111
+ for payments in Telegram Stars.
3902
4112
 
3903
4113
  :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, \
3904
- tax, discount, delivery cost, delivery tax, bonus, etc.).
4114
+ tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain \
4115
+ exactly one item for payments in Telegram Stars.
3905
4116
 
3906
4117
  :param max_tip_amount: The maximum accepted amount for tips in the smallest units of the currency \
3907
4118
  (integer, not float/double). For example, for a maximum tip of US$ 1.45 \
3908
4119
  pass max_tip_amount = 145. See the exp parameter in currencies.json, it \
3909
4120
  shows the number of digits past the decimal point for each currency (2 for \
3910
- the majority of currencies). Defaults to 0.
4121
+ the majority of currencies). Defaults to 0. Not supported for payments \
4122
+ in Telegram Stars.
3911
4123
 
3912
4124
  :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the smallest units \
3913
4125
  of the currency (integer, not float/double). At most 4 suggested tip amounts \
@@ -3934,24 +4146,34 @@ class APIMethods:
3934
4146
 
3935
4147
  :param photo_height: Photo height.
3936
4148
 
3937
- :param need_name: Pass True if you require the user's full name to complete the order.
4149
+ :param need_name: Pass True if you require the user's full name to complete the order. Ignored \
4150
+ for payments in Telegram Stars.
3938
4151
 
3939
- :param need_phone_number: Pass True if you require the user's phone number to complete the order.
4152
+ :param need_phone_number: Pass True if you require the user's phone number to complete the order. Ignored \
4153
+ for payments in Telegram Stars.
3940
4154
 
3941
4155
  :param need_email: Pass True if you require the user's email address to complete the order. \
4156
+ Ignored for payments in Telegram Stars.
3942
4157
 
3943
4158
  :param need_shipping_address: Pass True if you require the user's shipping address to complete the order. \
4159
+ Ignored for payments in Telegram Stars.
3944
4160
 
3945
- :param send_phone_number_to_provider: Pass True if the user's phone number should be sent to provider.
4161
+ :param send_phone_number_to_provider: Pass True if the user's phone number should be sent to the provider. Ignored \
4162
+ for payments in Telegram Stars.
3946
4163
 
3947
- :param send_email_to_provider: Pass True if the user's email address should be sent to provider.
4164
+ :param send_email_to_provider: Pass True if the user's email address should be sent to the provider. Ignored \
4165
+ for payments in Telegram Stars.
3948
4166
 
3949
- :param is_flexible: Pass True if the final price depends on the shipping method.
4167
+ :param is_flexible: Pass True if the final price depends on the shipping method. Ignored for \
4168
+ payments in Telegram Stars.
3950
4169
 
3951
4170
  :param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
3952
4171
 
3953
4172
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
3954
4173
 
4174
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
4175
+ chats only.
4176
+
3955
4177
  :param reply_parameters: Description of the message to reply to.
3956
4178
 
3957
4179
  :param reply_markup: A JSON-serialized object for an inline keyboard. If empty, one 'Pay total \
@@ -3969,9 +4191,9 @@ class APIMethods:
3969
4191
  title: str,
3970
4192
  description: str,
3971
4193
  payload: str,
3972
- provider_token: str,
3973
4194
  currency: str,
3974
4195
  prices: list[LabeledPrice],
4196
+ provider_token: str | None = None,
3975
4197
  max_tip_amount: int | None = None,
3976
4198
  suggested_tip_amounts: list[int] | None = None,
3977
4199
  provider_data: str | None = None,
@@ -3990,7 +4212,7 @@ class APIMethods:
3990
4212
  ) -> Result[str, APIError]:
3991
4213
  """Method `createInvoiceLink`, see the [documentation](https://core.telegram.org/bots/api#createinvoicelink)
3992
4214
 
3993
- Use this method to create a link for an invoice. Returns the created invoice
4215
+ Use this method to create a link for an invoice. Returns the created invoice
3994
4216
  link as String on success.
3995
4217
 
3996
4218
  :param title: Product name, 1-32 characters.
@@ -4000,18 +4222,22 @@ class APIMethods:
4000
4222
  :param payload: Bot-defined invoice payload, 1-128 bytes. This will not be displayed to \
4001
4223
  the user, use for your internal processes.
4002
4224
 
4003
- :param provider_token: Payment provider token, obtained via BotFather.
4225
+ :param provider_token: Payment provider token, obtained via @BotFather. Pass an empty string \
4226
+ for payments in Telegram Stars.
4004
4227
 
4005
- :param currency: Three-letter ISO 4217 currency code, see more on currencies.
4228
+ :param currency: Three-letter ISO 4217 currency code, see more on currencies. Pass `XTR` \
4229
+ for payments in Telegram Stars.
4006
4230
 
4007
4231
  :param prices: Price breakdown, a JSON-serialized list of components (e.g. product price, \
4008
- tax, discount, delivery cost, delivery tax, bonus, etc.).
4232
+ tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain \
4233
+ exactly one item for payments in Telegram Stars.
4009
4234
 
4010
4235
  :param max_tip_amount: The maximum accepted amount for tips in the smallest units of the currency \
4011
4236
  (integer, not float/double). For example, for a maximum tip of US$ 1.45 \
4012
4237
  pass max_tip_amount = 145. See the exp parameter in currencies.json, it \
4013
4238
  shows the number of digits past the decimal point for each currency (2 for \
4014
- the majority of currencies). Defaults to 0.
4239
+ the majority of currencies). Defaults to 0. Not supported for payments \
4240
+ in Telegram Stars.
4015
4241
 
4016
4242
  :param suggested_tip_amounts: A JSON-serialized array of suggested amounts of tips in the smallest units \
4017
4243
  of the currency (integer, not float/double). At most 4 suggested tip amounts \
@@ -4031,19 +4257,26 @@ class APIMethods:
4031
4257
 
4032
4258
  :param photo_height: Photo height.
4033
4259
 
4034
- :param need_name: Pass True if you require the user's full name to complete the order.
4260
+ :param need_name: Pass True if you require the user's full name to complete the order. Ignored \
4261
+ for payments in Telegram Stars.
4035
4262
 
4036
- :param need_phone_number: Pass True if you require the user's phone number to complete the order.
4263
+ :param need_phone_number: Pass True if you require the user's phone number to complete the order. Ignored \
4264
+ for payments in Telegram Stars.
4037
4265
 
4038
4266
  :param need_email: Pass True if you require the user's email address to complete the order. \
4267
+ Ignored for payments in Telegram Stars.
4039
4268
 
4040
4269
  :param need_shipping_address: Pass True if you require the user's shipping address to complete the order. \
4270
+ Ignored for payments in Telegram Stars.
4041
4271
 
4042
- :param send_phone_number_to_provider: Pass True if the user's phone number should be sent to the provider.
4272
+ :param send_phone_number_to_provider: Pass True if the user's phone number should be sent to the provider. Ignored \
4273
+ for payments in Telegram Stars.
4043
4274
 
4044
- :param send_email_to_provider: Pass True if the user's email address should be sent to the provider.
4275
+ :param send_email_to_provider: Pass True if the user's email address should be sent to the provider. Ignored \
4276
+ for payments in Telegram Stars.
4045
4277
 
4046
- :param is_flexible: Pass True if the final price depends on the shipping method.
4278
+ :param is_flexible: Pass True if the final price depends on the shipping method. Ignored for \
4279
+ payments in Telegram Stars.
4047
4280
  """
4048
4281
 
4049
4282
  method_response = await self.api.request_raw(
@@ -4062,9 +4295,9 @@ class APIMethods:
4062
4295
  ) -> Result[bool, APIError]:
4063
4296
  """Method `answerShippingQuery`, see the [documentation](https://core.telegram.org/bots/api#answershippingquery)
4064
4297
 
4065
- If you sent an invoice requesting a shipping address and the parameter is_flexible
4066
- was specified, the Bot API will send an Update with a shipping_query field
4067
- to the bot. Use this method to reply to shipping queries. On success, True
4298
+ If you sent an invoice requesting a shipping address and the parameter is_flexible
4299
+ was specified, the Bot API will send an Update with a shipping_query field
4300
+ to the bot. Use this method to reply to shipping queries. On success, True
4068
4301
  is returned.
4069
4302
 
4070
4303
  :param shipping_query_id: Unique identifier for the query to be answered.
@@ -4096,10 +4329,10 @@ class APIMethods:
4096
4329
  ) -> Result[bool, APIError]:
4097
4330
  """Method `answerPreCheckoutQuery`, see the [documentation](https://core.telegram.org/bots/api#answerprecheckoutquery)
4098
4331
 
4099
- Once the user has confirmed their payment and shipping details, the Bot
4100
- API sends the final confirmation in the form of an Update with the field pre_checkout_query.
4101
- Use this method to respond to such pre-checkout queries. On success, True
4102
- is returned. Note: The Bot API must receive an answer within 10 seconds after
4332
+ Once the user has confirmed their payment and shipping details, the Bot
4333
+ API sends the final confirmation in the form of an Update with the field pre_checkout_query.
4334
+ Use this method to respond to such pre-checkout queries. On success, True
4335
+ is returned. Note: The Bot API must receive an answer within 10 seconds after
4103
4336
  the pre-checkout query was sent.
4104
4337
 
4105
4338
  :param pre_checkout_query_id: Unique identifier for the query to be answered.
@@ -4120,6 +4353,50 @@ class APIMethods:
4120
4353
  )
4121
4354
  return full_result(method_response, bool)
4122
4355
 
4356
+ async def get_star_transactions(
4357
+ self,
4358
+ offset: int | None = None,
4359
+ limit: int | None = None,
4360
+ **other: typing.Any,
4361
+ ) -> Result[StarTransactions, APIError]:
4362
+ """Method `getStarTransactions`, see the [documentation](https://core.telegram.org/bots/api#getstartransactions)
4363
+
4364
+ Returns the bot's Telegram Star transactions in chronological order.
4365
+ On success, returns a StarTransactions object.
4366
+
4367
+ :param offset: Number of transactions to skip in the response.
4368
+
4369
+ :param limit: The maximum number of transactions to be retrieved. Values between 1-100 \
4370
+ are accepted. Defaults to 100.
4371
+ """
4372
+
4373
+ method_response = await self.api.request_raw(
4374
+ "getStarTransactions",
4375
+ get_params(locals()),
4376
+ )
4377
+ return full_result(method_response, StarTransactions)
4378
+
4379
+ async def refund_star_payment(
4380
+ self,
4381
+ user_id: int,
4382
+ telegram_payment_charge_id: str,
4383
+ **other: typing.Any,
4384
+ ) -> Result[bool, APIError]:
4385
+ """Method `refundStarPayment`, see the [documentation](https://core.telegram.org/bots/api#refundstarpayment)
4386
+
4387
+ Refunds a successful payment in Telegram Stars. Returns True on success.
4388
+
4389
+ :param user_id: Identifier of the user whose payment will be refunded.
4390
+
4391
+ :param telegram_payment_charge_id: Telegram payment identifier.
4392
+ """
4393
+
4394
+ method_response = await self.api.request_raw(
4395
+ "refundStarPayment",
4396
+ get_params(locals()),
4397
+ )
4398
+ return full_result(method_response, bool)
4399
+
4123
4400
  async def set_passport_data_errors(
4124
4401
  self,
4125
4402
  user_id: int,
@@ -4156,6 +4433,7 @@ class APIMethods:
4156
4433
  message_thread_id: int | None = None,
4157
4434
  disable_notification: bool | None = None,
4158
4435
  protect_content: bool | None = None,
4436
+ message_effect_id: str | None = None,
4159
4437
  reply_parameters: ReplyParameters | None = None,
4160
4438
  reply_markup: InlineKeyboardMarkup | None = None,
4161
4439
  **other: typing.Any,
@@ -4179,6 +4457,9 @@ class APIMethods:
4179
4457
 
4180
4458
  :param protect_content: Protects the contents of the sent message from forwarding and saving.
4181
4459
 
4460
+ :param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
4461
+ chats only.
4462
+
4182
4463
  :param reply_parameters: Description of the message to reply to.
4183
4464
 
4184
4465
  :param reply_markup: A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' \
@@ -4204,9 +4485,9 @@ class APIMethods:
4204
4485
  ) -> Result[Variative[Message, bool], APIError]:
4205
4486
  """Method `setGameScore`, see the [documentation](https://core.telegram.org/bots/api#setgamescore)
4206
4487
 
4207
- Use this method to set the score of the specified user in a game message. On
4208
- success, if the message is not an inline message, the Message is returned,
4209
- otherwise True is returned. Returns an error, if the new score is not greater
4488
+ Use this method to set the score of the specified user in a game message. On
4489
+ success, if the message is not an inline message, the Message is returned,
4490
+ otherwise True is returned. Returns an error, if the new score is not greater
4210
4491
  than the user's current score in the chat and force is False.
4211
4492
 
4212
4493
  :param user_id: User identifier.
@@ -4245,8 +4526,8 @@ class APIMethods:
4245
4526
  ) -> Result[list[GameHighScore], APIError]:
4246
4527
  """Method `getGameHighScores`, see the [documentation](https://core.telegram.org/bots/api#getgamehighscores)
4247
4528
 
4248
- Use this method to get data for high score tables. Will return the score of
4249
- the specified user and several of their neighbors in a game. Returns an Array
4529
+ Use this method to get data for high score tables. Will return the score of
4530
+ the specified user and several of their neighbors in a game. Returns an Array
4250
4531
  of GameHighScore objects.
4251
4532
 
4252
4533
  :param user_id: Target user id.