ng-bot-api 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. ng_bot_api/__init__.py +56 -0
  2. ng_bot_api/api_version.py +2 -0
  3. ng_bot_api/async_bot.py +97 -0
  4. ng_bot_api/core/__init__.py +31 -0
  5. ng_bot_api/core/base.py +36 -0
  6. ng_bot_api/core/caller.py +17 -0
  7. ng_bot_api/core/decoding.py +85 -0
  8. ng_bot_api/core/encoding.py +42 -0
  9. ng_bot_api/core/errors.py +75 -0
  10. ng_bot_api/core/input_file.py +56 -0
  11. ng_bot_api/core/polling.py +39 -0
  12. ng_bot_api/core/registry.py +72 -0
  13. ng_bot_api/core/request.py +67 -0
  14. ng_bot_api/core/typespec.py +57 -0
  15. ng_bot_api/dispatcher/__init__.py +17 -0
  16. ng_bot_api/dispatcher/dispatcher.py +95 -0
  17. ng_bot_api/dispatcher/filter_base.py +78 -0
  18. ng_bot_api/dispatcher/filters.py +124 -0
  19. ng_bot_api/dispatcher/handler.py +34 -0
  20. ng_bot_api/dispatcher/router.py +69 -0
  21. ng_bot_api/methods/__init__.py +115 -0
  22. ng_bot_api/methods/async_01.py +99 -0
  23. ng_bot_api/methods/async_02.py +114 -0
  24. ng_bot_api/methods/async_03.py +85 -0
  25. ng_bot_api/methods/async_04.py +110 -0
  26. ng_bot_api/methods/async_05.py +114 -0
  27. ng_bot_api/methods/async_06.py +74 -0
  28. ng_bot_api/methods/async_07.py +114 -0
  29. ng_bot_api/methods/async_08.py +106 -0
  30. ng_bot_api/methods/async_09.py +97 -0
  31. ng_bot_api/methods/async_10.py +92 -0
  32. ng_bot_api/methods/async_11.py +107 -0
  33. ng_bot_api/methods/async_12.py +119 -0
  34. ng_bot_api/methods/async_13.py +119 -0
  35. ng_bot_api/methods/async_14.py +113 -0
  36. ng_bot_api/methods/async_15.py +117 -0
  37. ng_bot_api/methods/async_16.py +115 -0
  38. ng_bot_api/methods/async_17.py +121 -0
  39. ng_bot_api/methods/async_18.py +118 -0
  40. ng_bot_api/methods/async_19.py +128 -0
  41. ng_bot_api/methods/async_20.py +115 -0
  42. ng_bot_api/methods/async_21.py +127 -0
  43. ng_bot_api/methods/async_22.py +110 -0
  44. ng_bot_api/methods/async_23.py +116 -0
  45. ng_bot_api/methods/async_24.py +118 -0
  46. ng_bot_api/methods/async_25.py +109 -0
  47. ng_bot_api/methods/async_26.py +124 -0
  48. ng_bot_api/methods/async_27.py +119 -0
  49. ng_bot_api/methods/async_28.py +119 -0
  50. ng_bot_api/methods/async_29.py +108 -0
  51. ng_bot_api/methods/async_30.py +115 -0
  52. ng_bot_api/methods/async_31.py +112 -0
  53. ng_bot_api/methods/async_32.py +126 -0
  54. ng_bot_api/methods/async_33.py +105 -0
  55. ng_bot_api/methods/async_34.py +117 -0
  56. ng_bot_api/methods/async_35.py +122 -0
  57. ng_bot_api/methods/async_36.py +121 -0
  58. ng_bot_api/methods/async_37.py +126 -0
  59. ng_bot_api/methods/async_38.py +112 -0
  60. ng_bot_api/methods/async_39.py +84 -0
  61. ng_bot_api/methods/async_40.py +125 -0
  62. ng_bot_api/methods/async_41.py +115 -0
  63. ng_bot_api/methods/async_42.py +30 -0
  64. ng_bot_api/methods/sync_01.py +99 -0
  65. ng_bot_api/methods/sync_02.py +114 -0
  66. ng_bot_api/methods/sync_03.py +85 -0
  67. ng_bot_api/methods/sync_04.py +110 -0
  68. ng_bot_api/methods/sync_05.py +114 -0
  69. ng_bot_api/methods/sync_06.py +74 -0
  70. ng_bot_api/methods/sync_07.py +114 -0
  71. ng_bot_api/methods/sync_08.py +106 -0
  72. ng_bot_api/methods/sync_09.py +97 -0
  73. ng_bot_api/methods/sync_10.py +92 -0
  74. ng_bot_api/methods/sync_11.py +107 -0
  75. ng_bot_api/methods/sync_12.py +119 -0
  76. ng_bot_api/methods/sync_13.py +119 -0
  77. ng_bot_api/methods/sync_14.py +113 -0
  78. ng_bot_api/methods/sync_15.py +117 -0
  79. ng_bot_api/methods/sync_16.py +115 -0
  80. ng_bot_api/methods/sync_17.py +121 -0
  81. ng_bot_api/methods/sync_18.py +118 -0
  82. ng_bot_api/methods/sync_19.py +128 -0
  83. ng_bot_api/methods/sync_20.py +115 -0
  84. ng_bot_api/methods/sync_21.py +127 -0
  85. ng_bot_api/methods/sync_22.py +110 -0
  86. ng_bot_api/methods/sync_23.py +116 -0
  87. ng_bot_api/methods/sync_24.py +118 -0
  88. ng_bot_api/methods/sync_25.py +109 -0
  89. ng_bot_api/methods/sync_26.py +124 -0
  90. ng_bot_api/methods/sync_27.py +119 -0
  91. ng_bot_api/methods/sync_28.py +119 -0
  92. ng_bot_api/methods/sync_29.py +108 -0
  93. ng_bot_api/methods/sync_30.py +115 -0
  94. ng_bot_api/methods/sync_31.py +112 -0
  95. ng_bot_api/methods/sync_32.py +126 -0
  96. ng_bot_api/methods/sync_33.py +105 -0
  97. ng_bot_api/methods/sync_34.py +117 -0
  98. ng_bot_api/methods/sync_35.py +122 -0
  99. ng_bot_api/methods/sync_36.py +121 -0
  100. ng_bot_api/methods/sync_37.py +126 -0
  101. ng_bot_api/methods/sync_38.py +112 -0
  102. ng_bot_api/methods/sync_39.py +84 -0
  103. ng_bot_api/methods/sync_40.py +125 -0
  104. ng_bot_api/methods/sync_41.py +115 -0
  105. ng_bot_api/methods/sync_42.py +30 -0
  106. ng_bot_api/py.typed +0 -0
  107. ng_bot_api/sync_bot.py +95 -0
  108. ng_bot_api/types/__init__.py +82 -0
  109. ng_bot_api/types/available_types_01.py +102 -0
  110. ng_bot_api/types/available_types_02.py +141 -0
  111. ng_bot_api/types/available_types_03.py +311 -0
  112. ng_bot_api/types/available_types_04.py +84 -0
  113. ng_bot_api/types/available_types_05.py +134 -0
  114. ng_bot_api/types/available_types_06.py +126 -0
  115. ng_bot_api/types/available_types_07.py +119 -0
  116. ng_bot_api/types/available_types_08.py +120 -0
  117. ng_bot_api/types/available_types_09.py +115 -0
  118. ng_bot_api/types/available_types_10.py +109 -0
  119. ng_bot_api/types/available_types_11.py +121 -0
  120. ng_bot_api/types/available_types_12.py +120 -0
  121. ng_bot_api/types/available_types_13.py +128 -0
  122. ng_bot_api/types/available_types_14.py +124 -0
  123. ng_bot_api/types/available_types_15.py +129 -0
  124. ng_bot_api/types/available_types_16.py +121 -0
  125. ng_bot_api/types/available_types_17.py +124 -0
  126. ng_bot_api/types/available_types_18.py +128 -0
  127. ng_bot_api/types/available_types_19.py +115 -0
  128. ng_bot_api/types/available_types_20.py +123 -0
  129. ng_bot_api/types/available_types_21.py +101 -0
  130. ng_bot_api/types/available_types_22.py +121 -0
  131. ng_bot_api/types/available_types_23.py +128 -0
  132. ng_bot_api/types/available_types_24.py +107 -0
  133. ng_bot_api/types/available_types_25.py +100 -0
  134. ng_bot_api/types/available_types_26.py +81 -0
  135. ng_bot_api/types/available_types_27.py +114 -0
  136. ng_bot_api/types/available_types_28.py +125 -0
  137. ng_bot_api/types/available_types_29.py +118 -0
  138. ng_bot_api/types/available_types_30.py +113 -0
  139. ng_bot_api/types/available_types_31.py +120 -0
  140. ng_bot_api/types/available_types_32.py +124 -0
  141. ng_bot_api/types/available_types_33.py +125 -0
  142. ng_bot_api/types/available_types_34.py +113 -0
  143. ng_bot_api/types/available_types_35.py +125 -0
  144. ng_bot_api/types/available_types_36.py +119 -0
  145. ng_bot_api/types/available_types_37.py +126 -0
  146. ng_bot_api/types/available_types_38.py +118 -0
  147. ng_bot_api/types/available_types_39.py +121 -0
  148. ng_bot_api/types/available_types_40.py +121 -0
  149. ng_bot_api/types/available_types_41.py +116 -0
  150. ng_bot_api/types/available_types_42.py +112 -0
  151. ng_bot_api/types/available_types_43.py +110 -0
  152. ng_bot_api/types/available_types_44.py +30 -0
  153. ng_bot_api/types/games_01.py +57 -0
  154. ng_bot_api/types/getting_updates_01.py +123 -0
  155. ng_bot_api/types/inline_mode_01.py +124 -0
  156. ng_bot_api/types/inline_mode_02.py +91 -0
  157. ng_bot_api/types/inline_mode_03.py +116 -0
  158. ng_bot_api/types/inline_mode_04.py +126 -0
  159. ng_bot_api/types/inline_mode_05.py +124 -0
  160. ng_bot_api/types/inline_mode_06.py +124 -0
  161. ng_bot_api/types/inline_mode_07.py +119 -0
  162. ng_bot_api/types/inline_mode_08.py +104 -0
  163. ng_bot_api/types/inline_mode_09.py +84 -0
  164. ng_bot_api/types/payments_01.py +124 -0
  165. ng_bot_api/types/payments_02.py +124 -0
  166. ng_bot_api/types/payments_03.py +119 -0
  167. ng_bot_api/types/payments_04.py +70 -0
  168. ng_bot_api/types/rich_messages_01.py +126 -0
  169. ng_bot_api/types/rich_messages_02.py +125 -0
  170. ng_bot_api/types/rich_messages_03.py +115 -0
  171. ng_bot_api/types/rich_messages_04.py +116 -0
  172. ng_bot_api/types/rich_messages_05.py +128 -0
  173. ng_bot_api/types/rich_messages_06.py +125 -0
  174. ng_bot_api/types/rich_messages_07.py +114 -0
  175. ng_bot_api/types/rich_messages_08.py +118 -0
  176. ng_bot_api/types/rich_messages_09.py +124 -0
  177. ng_bot_api/types/rich_messages_10.py +125 -0
  178. ng_bot_api/types/rich_messages_11.py +122 -0
  179. ng_bot_api/types/rich_messages_12.py +122 -0
  180. ng_bot_api/types/stickers_01.py +107 -0
  181. ng_bot_api/types/telegram_passport_01.py +120 -0
  182. ng_bot_api/types/telegram_passport_02.py +113 -0
  183. ng_bot_api/types/telegram_passport_03.py +24 -0
  184. ng_bot_api/types/unions_01.py +140 -0
  185. ng_bot_api/types/unions_02.py +132 -0
  186. ng_bot_api/types/unions_03.py +134 -0
  187. ng_bot_api/types/unions_04.py +149 -0
  188. ng_bot_api/types/unions_05.py +96 -0
  189. ng_bot_api/webhook.py +78 -0
  190. ng_bot_api-0.1.0.dist-info/METADATA +179 -0
  191. ng_bot_api-0.1.0.dist-info/RECORD +193 -0
  192. ng_bot_api-0.1.0.dist-info/WHEEL +4 -0
  193. ng_bot_api-0.1.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,99 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..core.input_file import InputFile
5
+ from ..types import BotFullInfo, Update, WebhookInfo
6
+
7
+
8
+ class AsyncMethods01(AsyncCaller):
9
+ __slots__ = ()
10
+
11
+ async def get_updates(
12
+ self,
13
+ *,
14
+ offset: int | None = None,
15
+ limit: int | None = None,
16
+ timeout: int | None = None,
17
+ allowed_updates: list[str] | None = None,
18
+ ) -> list[Update]:
19
+ """Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.
20
+
21
+ Args:
22
+ offset: Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will be forgotten.
23
+ limit: Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
24
+ timeout: Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive; short polling should be used for testing purposes only.
25
+ allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. Please note that this parameter doesn't affect updates created before the call to getUpdates, so unwanted updates may be received for a short period of time.
26
+
27
+ https://core.telegram.org/bots/api#getupdates
28
+ """
29
+ return await self._call('getUpdates', locals(), 'list[Update]')
30
+
31
+ async def set_webhook(
32
+ self,
33
+ url: str,
34
+ *,
35
+ certificate: InputFile | None = None,
36
+ ip_address: str | None = None,
37
+ max_connections: int | None = None,
38
+ allowed_updates: list[str] | None = None,
39
+ drop_pending_updates: bool | None = None,
40
+ secret_token: str | None = None,
41
+ ) -> bool:
42
+ """Use this method to specify a URL and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update. In case of an unsuccessful request (a request with response HTTP status code different from 2XY), we will repeat the request and give up after a reasonable number of attempts. Returns True on success.
43
+
44
+ If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token. If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.
45
+
46
+ Args:
47
+ url: HTTPS URL to send updates to. Use an empty string to remove webhook integration.
48
+ certificate: Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
49
+ ip_address: The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
50
+ max_connections: The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.
51
+ allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify ["message", "edited_channel_post", "callback_query"] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used. Please note that this parameter doesn't affect updates created before the call to setWebhook, so unwanted updates may be received for a short period of time.
52
+ drop_pending_updates: Pass True to drop all pending updates
53
+ secret_token: A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.
54
+
55
+ https://core.telegram.org/bots/api#setwebhook
56
+ """
57
+ return await self._call('setWebhook', locals(), 'bool')
58
+
59
+ async def delete_webhook(
60
+ self,
61
+ *,
62
+ drop_pending_updates: bool | None = None,
63
+ ) -> bool:
64
+ """Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.
65
+
66
+ Args:
67
+ drop_pending_updates: Pass True to drop all pending updates
68
+
69
+ https://core.telegram.org/bots/api#deletewebhook
70
+ """
71
+ return await self._call('deleteWebhook', locals(), 'bool')
72
+
73
+ async def get_webhook_info(self) -> WebhookInfo:
74
+ """Use this method to get the current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, it will return an object with the url field empty.
75
+
76
+ https://core.telegram.org/bots/api#getwebhookinfo
77
+ """
78
+ return await self._call('getWebhookInfo', {}, 'WebhookInfo')
79
+
80
+ async def get_me(self) -> BotFullInfo:
81
+ """A simple method for testing your bot's authentication token. Requires no parameters. Returns information about the bot in the form of a BotFullInfo object.
82
+
83
+ https://core.telegram.org/bots/api#getme
84
+ """
85
+ return await self._call('getMe', {}, 'BotFullInfo')
86
+
87
+ async def log_out(self) -> bool:
88
+ """Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally; otherwise, there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log back in to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.
89
+
90
+ https://core.telegram.org/bots/api#logout
91
+ """
92
+ return await self._call('logOut', {}, 'bool')
93
+
94
+ async def close(self) -> bool:
95
+ """Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.
96
+
97
+ https://core.telegram.org/bots/api#close
98
+ """
99
+ return await self._call('close', {}, 'bool')
@@ -0,0 +1,114 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import (
5
+ EphemeralMessageParameters, ForceReply, InlineKeyboardMarkup, LinkPreviewOptions, Message,
6
+ MessageEntity, MessageId, ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyParameters,
7
+ SuggestedPostParameters,
8
+ )
9
+
10
+
11
+ class AsyncMethods02(AsyncCaller):
12
+ __slots__ = ()
13
+
14
+ async def send_message(
15
+ self,
16
+ chat_id: int | str | None,
17
+ text: str,
18
+ *,
19
+ business_connection_id: str | None = None,
20
+ message_thread_id: int | None = None,
21
+ direct_messages_topic_id: int | None = None,
22
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
23
+ parse_mode: str | None = None,
24
+ entities: list[MessageEntity] | None = None,
25
+ link_preview_options: LinkPreviewOptions | None = None,
26
+ disable_notification: bool | None = None,
27
+ protect_content: bool | None = None,
28
+ allow_paid_broadcast: bool | None = None,
29
+ message_effect_id: str | None = None,
30
+ suggested_post_parameters: SuggestedPostParameters | None = None,
31
+ reply_parameters: ReplyParameters | None = None,
32
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
33
+ ) -> Message:
34
+ """Use this method to send text messages. On success, the sent Message is returned.
35
+
36
+ Args:
37
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
38
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
39
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
40
+ direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
41
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
42
+ text: Text of the message to be sent, 1-4096 characters after entities parsing
43
+ parse_mode: Mode for parsing entities in the message text. See formatting options for more details.
44
+ entities: A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
45
+ link_preview_options: Link preview generation options for the message
46
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
47
+ protect_content: Protects the contents of the sent message from forwarding and saving
48
+ allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
49
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
50
+ suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
51
+ reply_parameters: Description of the message to reply to
52
+ reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
53
+
54
+ https://core.telegram.org/bots/api#sendmessage
55
+ """
56
+ return await self._call('sendMessage', locals(), 'Message')
57
+
58
+ async def forward_message(
59
+ self,
60
+ chat_id: int | str,
61
+ from_chat_id: int | str,
62
+ message_id: int,
63
+ *,
64
+ message_thread_id: int | None = None,
65
+ direct_messages_topic_id: int | None = None,
66
+ video_start_timestamp: int | None = None,
67
+ disable_notification: bool | None = None,
68
+ protect_content: bool | None = None,
69
+ message_effect_id: str | None = None,
70
+ suggested_post_parameters: SuggestedPostParameters | None = None,
71
+ ) -> Message:
72
+ """Use this method to forward messages of any kind. Service messages and messages with protected content can't be forwarded. On success, the sent Message is returned.
73
+
74
+ Args:
75
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
76
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
77
+ direct_messages_topic_id: Identifier of the direct messages topic to which the message will be forwarded; required if the message is forwarded to a direct messages chat
78
+ from_chat_id: Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username)
79
+ video_start_timestamp: New start timestamp for the forwarded video in the message
80
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
81
+ protect_content: Protects the contents of the forwarded message from forwarding and saving
82
+ message_effect_id: Unique identifier of the message effect to be added to the message; only available when forwarding to private chats
83
+ suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only
84
+ message_id: Message identifier in the chat specified in from_chat_id
85
+
86
+ https://core.telegram.org/bots/api#forwardmessage
87
+ """
88
+ return await self._call('forwardMessage', locals(), 'Message')
89
+
90
+ async def forward_messages(
91
+ self,
92
+ chat_id: int | str,
93
+ from_chat_id: int | str,
94
+ message_ids: list[int],
95
+ *,
96
+ message_thread_id: int | None = None,
97
+ direct_messages_topic_id: int | None = None,
98
+ disable_notification: bool | None = None,
99
+ protect_content: bool | None = None,
100
+ ) -> list[MessageId]:
101
+ """Use this method to forward multiple messages of any kind. If some of the specified messages can't be found or forwarded, they are skipped. Service messages and messages with protected content can't be forwarded. Album grouping is kept for forwarded messages. On success, an Array of MessageId of the sent messages is returned.
102
+
103
+ Args:
104
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
105
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
106
+ direct_messages_topic_id: Identifier of the direct messages topic to which the messages will be forwarded; required if the messages are forwarded to a direct messages chat
107
+ from_chat_id: Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username)
108
+ message_ids: A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to forward. The identifiers must be specified in a strictly increasing order.
109
+ disable_notification: Sends the messages silently. Users will receive a notification with no sound.
110
+ protect_content: Protects the contents of the forwarded messages from forwarding and saving
111
+
112
+ https://core.telegram.org/bots/api#forwardmessages
113
+ """
114
+ return await self._call('forwardMessages', locals(), 'list[MessageId]')
@@ -0,0 +1,85 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import (
5
+ ForceReply, InlineKeyboardMarkup, MessageEntity, MessageId, ReplyKeyboardMarkup,
6
+ ReplyKeyboardRemove, ReplyParameters, SuggestedPostParameters,
7
+ )
8
+
9
+
10
+ class AsyncMethods03(AsyncCaller):
11
+ __slots__ = ()
12
+
13
+ async def copy_message(
14
+ self,
15
+ chat_id: int | str,
16
+ from_chat_id: int | str,
17
+ message_id: int,
18
+ *,
19
+ message_thread_id: int | None = None,
20
+ direct_messages_topic_id: int | None = None,
21
+ video_start_timestamp: int | None = None,
22
+ caption: str | None = None,
23
+ parse_mode: str | None = None,
24
+ caption_entities: list[MessageEntity] | None = None,
25
+ show_caption_above_media: bool | None = None,
26
+ disable_notification: bool | None = None,
27
+ protect_content: bool | None = None,
28
+ allow_paid_broadcast: bool | None = None,
29
+ message_effect_id: str | None = None,
30
+ suggested_post_parameters: SuggestedPostParameters | None = None,
31
+ reply_parameters: ReplyParameters | None = None,
32
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
33
+ ) -> MessageId:
34
+ """Use this method to copy messages of any kind. Service messages, paid media messages, giveaway messages, giveaway winners messages, invoice messages, and widget messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.
35
+
36
+ Args:
37
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
38
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
39
+ direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
40
+ from_chat_id: Unique identifier for the chat where the original message was sent (or username of the target bot, supergroup, or channel in the format @username)
41
+ message_id: Message identifier in the chat specified in from_chat_id
42
+ video_start_timestamp: New start timestamp for the copied video in the message
43
+ caption: New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept.
44
+ parse_mode: Mode for parsing entities in the new caption. See formatting options for more details.
45
+ caption_entities: A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
46
+ show_caption_above_media: Pass True if the caption must be shown above the message media. Ignored if a new caption isn't specified.
47
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
48
+ protect_content: Protects the contents of the sent message from forwarding and saving
49
+ allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
50
+ message_effect_id: Unique identifier of the message effect to be added to the message; only available when copying to private chats
51
+ suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
52
+ reply_parameters: Description of the message to reply to
53
+ reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
54
+
55
+ https://core.telegram.org/bots/api#copymessage
56
+ """
57
+ return await self._call('copyMessage', locals(), 'MessageId')
58
+
59
+ async def copy_messages(
60
+ self,
61
+ chat_id: int | str,
62
+ from_chat_id: int | str,
63
+ message_ids: list[int],
64
+ *,
65
+ message_thread_id: int | None = None,
66
+ direct_messages_topic_id: int | None = None,
67
+ disable_notification: bool | None = None,
68
+ protect_content: bool | None = None,
69
+ remove_caption: bool | None = None,
70
+ ) -> list[MessageId]:
71
+ """Use this method to copy messages of any kind. If some of the specified messages can't be found or copied, they are skipped. Service messages, paid media messages, giveaway messages, giveaway winners messages, invoice messages, and widget messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_ids is known to the bot. The method is analogous to the method forwardMessages, but the copied messages don't have a link to the original message. Album grouping is kept for copied messages. On success, an Array of MessageId of the sent messages is returned.
72
+
73
+ Args:
74
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
75
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
76
+ direct_messages_topic_id: Identifier of the direct messages topic to which the messages will be sent; required if the messages are sent to a direct messages chat
77
+ from_chat_id: Unique identifier for the chat where the original messages were sent (or username of the target bot, supergroup, or channel in the format @username)
78
+ message_ids: A JSON-serialized list of 1-100 identifiers of messages in the chat from_chat_id to copy. The identifiers must be specified in a strictly increasing order.
79
+ disable_notification: Sends the messages silently. Users will receive a notification with no sound.
80
+ protect_content: Protects the contents of the sent messages from forwarding and saving
81
+ remove_caption: Pass True to copy the messages without their captions
82
+
83
+ https://core.telegram.org/bots/api#copymessages
84
+ """
85
+ return await self._call('copyMessages', locals(), 'list[MessageId]')
@@ -0,0 +1,110 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..core.input_file import InputFile
5
+ from ..types import (
6
+ EphemeralMessageParameters, ForceReply, InlineKeyboardMarkup, Message, MessageEntity,
7
+ ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyParameters, SuggestedPostParameters,
8
+ )
9
+
10
+
11
+ class AsyncMethods04(AsyncCaller):
12
+ __slots__ = ()
13
+
14
+ async def send_photo(
15
+ self,
16
+ chat_id: int | str | None,
17
+ photo: InputFile | str,
18
+ *,
19
+ business_connection_id: str | None = None,
20
+ message_thread_id: int | None = None,
21
+ direct_messages_topic_id: int | None = None,
22
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
23
+ caption: str | None = None,
24
+ parse_mode: str | None = None,
25
+ caption_entities: list[MessageEntity] | None = None,
26
+ show_caption_above_media: bool | None = None,
27
+ has_spoiler: bool | None = None,
28
+ disable_notification: bool | None = None,
29
+ protect_content: bool | None = None,
30
+ allow_paid_broadcast: bool | None = None,
31
+ message_effect_id: str | None = None,
32
+ suggested_post_parameters: SuggestedPostParameters | None = None,
33
+ reply_parameters: ReplyParameters | None = None,
34
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
35
+ ) -> Message:
36
+ """Use this method to send photos. On success, the sent Message is returned.
37
+
38
+ Args:
39
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
40
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
41
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
42
+ direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
43
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
44
+ photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files »
45
+ caption: Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
46
+ parse_mode: Mode for parsing entities in the photo caption. See formatting options for more details.
47
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
48
+ show_caption_above_media: Pass True if the caption must be shown above the message media
49
+ has_spoiler: Pass True if the photo needs to be covered with a spoiler animation
50
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
51
+ protect_content: Protects the contents of the sent message from forwarding and saving
52
+ allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
53
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
54
+ suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
55
+ reply_parameters: Description of the message to reply to
56
+ reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
57
+
58
+ https://core.telegram.org/bots/api#sendphoto
59
+ """
60
+ return await self._call('sendPhoto', locals(), 'Message')
61
+
62
+ async def send_live_photo(
63
+ self,
64
+ chat_id: int | str | None,
65
+ live_photo: InputFile | str,
66
+ photo: InputFile | str,
67
+ *,
68
+ business_connection_id: str | None = None,
69
+ message_thread_id: int | None = None,
70
+ direct_messages_topic_id: int | None = None,
71
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
72
+ caption: str | None = None,
73
+ parse_mode: str | None = None,
74
+ caption_entities: list[MessageEntity] | None = None,
75
+ show_caption_above_media: bool | None = None,
76
+ has_spoiler: bool | None = None,
77
+ disable_notification: bool | None = None,
78
+ protect_content: bool | None = None,
79
+ allow_paid_broadcast: bool | None = None,
80
+ message_effect_id: str | None = None,
81
+ suggested_post_parameters: SuggestedPostParameters | None = None,
82
+ reply_parameters: ReplyParameters | None = None,
83
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
84
+ ) -> Message:
85
+ """Use this method to send live photos. On success, the sent Message is returned.
86
+
87
+ Args:
88
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
89
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
90
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
91
+ direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
92
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
93
+ live_photo: Live photo video to send. The video must be no longer than 10 seconds and must not exceed 10 MB in size. Pass a file_id as String to send a video that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported.
94
+ photo: The static photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended) or upload a new photo using multipart/form-data. More information on Sending Files ». Sending live photos by a URL is currently unsupported.
95
+ caption: Live photo caption (may also be used when resending live photos by file_id), 0-1024 characters after entities parsing
96
+ parse_mode: Mode for parsing entities in the live photo caption. See formatting options for more details.
97
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
98
+ show_caption_above_media: Pass True if the caption must be shown above the message media
99
+ has_spoiler: Pass True if the live photo needs to be covered with a spoiler animation
100
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
101
+ protect_content: Protects the contents of the sent message from forwarding and saving
102
+ allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
103
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
104
+ suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
105
+ reply_parameters: Description of the message to reply to
106
+ reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
107
+
108
+ https://core.telegram.org/bots/api#sendlivephoto
109
+ """
110
+ return await self._call('sendLivePhoto', locals(), 'Message')
@@ -0,0 +1,114 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..core.input_file import InputFile
5
+ from ..types import (
6
+ EphemeralMessageParameters, ForceReply, InlineKeyboardMarkup, Message, MessageEntity,
7
+ ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyParameters, SuggestedPostParameters,
8
+ )
9
+
10
+
11
+ class AsyncMethods05(AsyncCaller):
12
+ __slots__ = ()
13
+
14
+ async def send_audio(
15
+ self,
16
+ chat_id: int | str | None,
17
+ audio: InputFile | str,
18
+ *,
19
+ business_connection_id: str | None = None,
20
+ message_thread_id: int | None = None,
21
+ direct_messages_topic_id: int | None = None,
22
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
23
+ caption: str | None = None,
24
+ parse_mode: str | None = None,
25
+ caption_entities: list[MessageEntity] | None = None,
26
+ duration: int | None = None,
27
+ performer: str | None = None,
28
+ title: str | None = None,
29
+ thumbnail: InputFile | str | None = None,
30
+ disable_notification: bool | None = None,
31
+ protect_content: bool | None = None,
32
+ allow_paid_broadcast: bool | None = None,
33
+ message_effect_id: str | None = None,
34
+ suggested_post_parameters: SuggestedPostParameters | None = None,
35
+ reply_parameters: ReplyParameters | None = None,
36
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
37
+ ) -> Message:
38
+ """Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size; this limit may be changed in the future.
39
+
40
+ For sending voice messages, use the sendVoice method instead.
41
+
42
+ Args:
43
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
44
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
45
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
46
+ direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
47
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
48
+ audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
49
+ caption: Audio caption, 0-1024 characters after entities parsing
50
+ parse_mode: Mode for parsing entities in the audio caption. See formatting options for more details.
51
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
52
+ duration: Duration of the audio in seconds
53
+ performer: Performer
54
+ title: Track name
55
+ thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
56
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
57
+ protect_content: Protects the contents of the sent message from forwarding and saving
58
+ allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
59
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
60
+ suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
61
+ reply_parameters: Description of the message to reply to
62
+ reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
63
+
64
+ https://core.telegram.org/bots/api#sendaudio
65
+ """
66
+ return await self._call('sendAudio', locals(), 'Message')
67
+
68
+ async def send_document(
69
+ self,
70
+ chat_id: int | str | None,
71
+ document: InputFile | str,
72
+ *,
73
+ business_connection_id: str | None = None,
74
+ message_thread_id: int | None = None,
75
+ direct_messages_topic_id: int | None = None,
76
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
77
+ thumbnail: InputFile | str | None = None,
78
+ caption: str | None = None,
79
+ parse_mode: str | None = None,
80
+ caption_entities: list[MessageEntity] | None = None,
81
+ disable_content_type_detection: bool | None = None,
82
+ disable_notification: bool | None = None,
83
+ protect_content: bool | None = None,
84
+ allow_paid_broadcast: bool | None = None,
85
+ message_effect_id: str | None = None,
86
+ suggested_post_parameters: SuggestedPostParameters | None = None,
87
+ reply_parameters: ReplyParameters | None = None,
88
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
89
+ ) -> Message:
90
+ """Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size; this limit may be changed in the future.
91
+
92
+ Args:
93
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
94
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
95
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
96
+ direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
97
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
98
+ document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »
99
+ thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
100
+ caption: Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
101
+ parse_mode: Mode for parsing entities in the document caption. See formatting options for more details.
102
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
103
+ disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data
104
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
105
+ protect_content: Protects the contents of the sent message from forwarding and saving
106
+ allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
107
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
108
+ suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
109
+ reply_parameters: Description of the message to reply to
110
+ reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
111
+
112
+ https://core.telegram.org/bots/api#senddocument
113
+ """
114
+ return await self._call('sendDocument', locals(), 'Message')
@@ -0,0 +1,74 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..core.input_file import InputFile
5
+ from ..types import (
6
+ EphemeralMessageParameters, ForceReply, InlineKeyboardMarkup, Message, MessageEntity,
7
+ ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyParameters, SuggestedPostParameters,
8
+ )
9
+
10
+
11
+ class AsyncMethods06(AsyncCaller):
12
+ __slots__ = ()
13
+
14
+ async def send_video(
15
+ self,
16
+ chat_id: int | str | None,
17
+ video: InputFile | str,
18
+ *,
19
+ business_connection_id: str | None = None,
20
+ message_thread_id: int | None = None,
21
+ direct_messages_topic_id: int | None = None,
22
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
23
+ duration: int | None = None,
24
+ width: int | None = None,
25
+ height: int | None = None,
26
+ thumbnail: InputFile | str | None = None,
27
+ cover: InputFile | str | None = None,
28
+ start_timestamp: int | None = None,
29
+ caption: str | None = None,
30
+ parse_mode: str | None = None,
31
+ caption_entities: list[MessageEntity] | None = None,
32
+ show_caption_above_media: bool | None = None,
33
+ has_spoiler: bool | None = None,
34
+ supports_streaming: bool | None = None,
35
+ disable_notification: bool | None = None,
36
+ protect_content: bool | None = None,
37
+ allow_paid_broadcast: bool | None = None,
38
+ message_effect_id: str | None = None,
39
+ suggested_post_parameters: SuggestedPostParameters | None = None,
40
+ reply_parameters: ReplyParameters | None = None,
41
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
42
+ ) -> Message:
43
+ """Use this method to send video files; Telegram clients support MPEG4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size; this limit may be changed in the future.
44
+
45
+ Args:
46
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
47
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username; required unless the message is sent as an ephemeral reply to a callback query
48
+ message_thread_id: Unique identifier for the target message thread (topic) of a forum; for forum supergroups and private chats of bots with forum topic mode enabled only
49
+ direct_messages_topic_id: Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
50
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
51
+ video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files »
52
+ duration: Duration of sent video in seconds
53
+ width: Video width
54
+ height: Video height
55
+ thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can only be uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
56
+ cover: Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
57
+ start_timestamp: Start timestamp for the video in the message
58
+ caption: Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
59
+ parse_mode: Mode for parsing entities in the video caption. See formatting options for more details.
60
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
61
+ show_caption_above_media: Pass True if the caption must be shown above the message media
62
+ has_spoiler: Pass True if the video needs to be covered with a spoiler animation
63
+ supports_streaming: Pass True if the uploaded video is suitable for streaming
64
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
65
+ protect_content: Protects the contents of the sent message from forwarding and saving
66
+ allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance.
67
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
68
+ suggested_post_parameters: A JSON-serialized object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
69
+ reply_parameters: Description of the message to reply to
70
+ reply_markup: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove a reply keyboard or to force a reply from the user.
71
+
72
+ https://core.telegram.org/bots/api#sendvideo
73
+ """
74
+ return await self._call('sendVideo', locals(), 'Message')