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,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 AsyncMethods07(AsyncCaller):
12
+ __slots__ = ()
13
+
14
+ async def send_animation(
15
+ self,
16
+ chat_id: int | str | None,
17
+ animation: 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
+ caption: str | None = None,
28
+ parse_mode: str | None = None,
29
+ caption_entities: list[MessageEntity] | None = None,
30
+ show_caption_above_media: bool | None = None,
31
+ has_spoiler: bool | None = None,
32
+ disable_notification: bool | None = None,
33
+ protect_content: bool | None = None,
34
+ allow_paid_broadcast: bool | None = None,
35
+ message_effect_id: str | None = None,
36
+ suggested_post_parameters: SuggestedPostParameters | None = None,
37
+ reply_parameters: ReplyParameters | None = None,
38
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
39
+ ) -> Message:
40
+ """Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size; this limit may be changed in the future.
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
+ animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files »
49
+ duration: Duration of sent animation in seconds
50
+ width: Animation width
51
+ height: Animation height
52
+ 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 »
53
+ caption: Animation caption (may also be used when resending animations by file_id), 0-1024 characters after entities parsing
54
+ parse_mode: Mode for parsing entities in the animation caption. See formatting options for more details.
55
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
56
+ show_caption_above_media: Pass True if the caption must be shown above the message media
57
+ has_spoiler: Pass True if the animation needs to be covered with a spoiler animation
58
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
59
+ protect_content: Protects the contents of the sent message from forwarding and saving
60
+ 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.
61
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
62
+ 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.
63
+ reply_parameters: Description of the message to reply to
64
+ 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.
65
+
66
+ https://core.telegram.org/bots/api#sendanimation
67
+ """
68
+ return await self._call('sendAnimation', locals(), 'Message')
69
+
70
+ async def send_voice(
71
+ self,
72
+ chat_id: int | str | None,
73
+ voice: InputFile | str,
74
+ *,
75
+ business_connection_id: str | None = None,
76
+ message_thread_id: int | None = None,
77
+ direct_messages_topic_id: int | None = None,
78
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
79
+ caption: str | None = None,
80
+ parse_mode: str | None = None,
81
+ caption_entities: list[MessageEntity] | None = None,
82
+ duration: int | None = None,
83
+ disable_notification: bool | None = None,
84
+ protect_content: bool | None = None,
85
+ allow_paid_broadcast: bool | None = None,
86
+ message_effect_id: str | None = None,
87
+ suggested_post_parameters: SuggestedPostParameters | None = None,
88
+ reply_parameters: ReplyParameters | None = None,
89
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
90
+ ) -> Message:
91
+ """Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS, or in .MP3 format, or in .M4A format (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size; this limit may be changed in the future.
92
+
93
+ Args:
94
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
95
+ 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
96
+ 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
97
+ 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
98
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
99
+ voice: Audio 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 »
100
+ caption: Voice message caption, 0-1024 characters after entities parsing
101
+ parse_mode: Mode for parsing entities in the voice message 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
+ duration: Duration of the voice message in seconds
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#sendvoice
113
+ """
114
+ return await self._call('sendVoice', locals(), 'Message')
@@ -0,0 +1,106 @@
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 AsyncMethods08(AsyncCaller):
12
+ __slots__ = ()
13
+
14
+ async def send_video_note(
15
+ self,
16
+ chat_id: int | str | None,
17
+ video_note: 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
+ length: int | None = None,
25
+ thumbnail: InputFile | str | 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 a rounded square MPEG4 video up to 1 minute long. 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
+ video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported.
43
+ duration: Duration of sent video in seconds
44
+ length: Video width and height, i.e. diameter of the video message
45
+ 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 »
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#sendvideonote
55
+ """
56
+ return await self._call('sendVideoNote', locals(), 'Message')
57
+
58
+ async def send_widget(
59
+ self,
60
+ chat_id: int | str,
61
+ html: str,
62
+ *,
63
+ message_thread_id: int | None = None,
64
+ width: int | None = None,
65
+ height: int | None = None,
66
+ public_data: str | None = None,
67
+ chat_data: str | None = None,
68
+ caption: str | None = None,
69
+ parse_mode: str | None = None,
70
+ caption_entities: list[MessageEntity] | None = None,
71
+ show_caption_above_media: bool | None = None,
72
+ allow_queries: bool | None = None,
73
+ is_shared: bool | None = None,
74
+ disable_notification: bool | None = None,
75
+ protect_content: bool | None = None,
76
+ allow_paid_broadcast: bool | None = None,
77
+ message_effect_id: str | None = None,
78
+ reply_parameters: ReplyParameters | None = None,
79
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
80
+ ) -> Message:
81
+ """Use this method to send a message with an HTML widget. Currently, in the production environment, widgets can be sent only to private chats, and sent widgets automatically have protected content and therefore can't be forwarded. On success, the sent Message is returned.
82
+
83
+ Args:
84
+ chat_id: Unique identifier for the target chat or username of the target supergroup in the format @username
85
+ 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
86
+ html: HTML code of the widget, 1-32768 bytes. The code must not exceed 4096 bytes when compressed by zlib with the maximum compression level.
87
+ width: Width of the widget in logical pixels; omit if the widget must occupy the whole width of the message bubble. The width is clamped by the app to the range from 200 to the maximum width of the message bubble.
88
+ height: Height of the widget in logical pixels; omit if the height of the widget isn't fixed. The height is clamped by the app to the range 50-600.
89
+ public_data: Public data of the widget, 0-1024 bytes, which will be available wherever the widget is shown. If the widget is shared, then all messages with it will have the same public data.
90
+ chat_data: Data of the widget, which is specific to the message, 0-1024 bytes
91
+ caption: Widget caption, 0-1024 characters after entities parsing
92
+ parse_mode: Mode for parsing entities in the widget caption. See formatting options for more details.
93
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
94
+ show_caption_above_media: Pass True if the caption must be shown above the widget
95
+ allow_queries: Pass True to allow the widget to send queries to the bot
96
+ is_shared: Pass True to create a shared widget, which can be sent again using the method sendSharedWidget
97
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
98
+ protect_content: Protects the contents of the sent message from forwarding and saving
99
+ 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.
100
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
101
+ reply_parameters: Description of the message to reply to
102
+ 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.
103
+
104
+ https://core.telegram.org/bots/api#sendwidget
105
+ """
106
+ return await self._call('sendWidget', locals(), 'Message')
@@ -0,0 +1,97 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import (
5
+ ForceReply, InlineKeyboardMarkup, InputPaidMedia, Message, MessageEntity,
6
+ ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyParameters, SuggestedPostParameters,
7
+ )
8
+
9
+
10
+ class AsyncMethods09(AsyncCaller):
11
+ __slots__ = ()
12
+
13
+ async def send_shared_widget(
14
+ self,
15
+ chat_id: int | str,
16
+ widget_id: str,
17
+ *,
18
+ message_thread_id: int | None = None,
19
+ chat_data: str | None = None,
20
+ caption: str | None = None,
21
+ parse_mode: str | None = None,
22
+ caption_entities: list[MessageEntity] | None = None,
23
+ show_caption_above_media: bool | None = None,
24
+ disable_notification: bool | None = None,
25
+ protect_content: bool | None = None,
26
+ allow_paid_broadcast: bool | None = None,
27
+ message_effect_id: str | None = None,
28
+ reply_parameters: ReplyParameters | None = None,
29
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
30
+ ) -> Message:
31
+ """Use this method to resend a shared widget created by the bot. Currently, in the production environment, widgets can be sent only to private chats, and sent widgets automatically have protected content and therefore can't be forwarded. On success, the sent Message is returned.
32
+
33
+ Args:
34
+ chat_id: Unique identifier for the target chat or username of the target supergroup in the format @username
35
+ 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
36
+ widget_id: Unique identifier of the shared widget
37
+ chat_data: Data of the widget, which is specific to the message, 0-1024 bytes
38
+ caption: Widget caption, 0-1024 characters after entities parsing
39
+ parse_mode: Mode for parsing entities in the widget caption. See formatting options for more details.
40
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
41
+ show_caption_above_media: Pass True if the caption must be shown above the widget
42
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
43
+ protect_content: Protects the contents of the sent message from forwarding and saving
44
+ 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.
45
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
46
+ reply_parameters: Description of the message to reply to
47
+ 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.
48
+
49
+ https://core.telegram.org/bots/api#sendsharedwidget
50
+ """
51
+ return await self._call('sendSharedWidget', locals(), 'Message')
52
+
53
+ async def send_paid_media(
54
+ self,
55
+ chat_id: int | str,
56
+ star_count: int,
57
+ media: list[InputPaidMedia],
58
+ *,
59
+ business_connection_id: str | None = None,
60
+ message_thread_id: int | None = None,
61
+ direct_messages_topic_id: int | None = None,
62
+ payload: str | None = None,
63
+ caption: str | None = None,
64
+ parse_mode: str | None = None,
65
+ caption_entities: list[MessageEntity] | None = None,
66
+ show_caption_above_media: bool | None = None,
67
+ disable_notification: bool | None = None,
68
+ protect_content: bool | None = None,
69
+ allow_paid_broadcast: bool | None = None,
70
+ suggested_post_parameters: SuggestedPostParameters | None = None,
71
+ reply_parameters: ReplyParameters | None = None,
72
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
73
+ ) -> Message:
74
+ """Use this method to send paid media. On success, the sent Message is returned.
75
+
76
+ Args:
77
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
78
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username. If the chat is a channel, all Telegram Star proceeds from this media will be credited to the chat's balance. Otherwise, they will be credited to the bot's balance.
79
+ 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
80
+ 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
81
+ star_count: The number of Telegram Stars that must be paid to buy access to the media; 1-25000
82
+ media: A JSON-serialized Array describing the media to be sent; up to 10 items
83
+ payload: Bot-defined paid media payload, 0-128 bytes. This will not be displayed to the user; use it for your internal processes.
84
+ caption: Media caption, 0-1024 characters after entities parsing
85
+ parse_mode: Mode for parsing entities in the media caption. See formatting options for more details.
86
+ caption_entities: A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
87
+ show_caption_above_media: Pass True if the caption must be shown above the message media
88
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
89
+ protect_content: Protects the contents of the sent message from forwarding and saving
90
+ 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.
91
+ 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.
92
+ reply_parameters: Description of the message to reply to
93
+ 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.
94
+
95
+ https://core.telegram.org/bots/api#sendpaidmedia
96
+ """
97
+ return await self._call('sendPaidMedia', locals(), 'Message')
@@ -0,0 +1,92 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import (
5
+ EphemeralMessageParameters, ForceReply, InlineKeyboardMarkup, InputMediaAudio,
6
+ InputMediaDocument, InputMediaLivePhoto, InputMediaPhoto, InputMediaVideo, Message,
7
+ ReplyKeyboardMarkup, ReplyKeyboardRemove, ReplyParameters, SuggestedPostParameters,
8
+ )
9
+
10
+
11
+ class AsyncMethods10(AsyncCaller):
12
+ __slots__ = ()
13
+
14
+ async def send_media_group(
15
+ self,
16
+ chat_id: int | str,
17
+ media: list[InputMediaAudio | InputMediaDocument | InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo],
18
+ *,
19
+ business_connection_id: str | None = None,
20
+ message_thread_id: int | None = None,
21
+ direct_messages_topic_id: int | None = None,
22
+ disable_notification: bool | None = None,
23
+ protect_content: bool | None = None,
24
+ allow_paid_broadcast: bool | None = None,
25
+ message_effect_id: str | None = None,
26
+ reply_parameters: ReplyParameters | None = None,
27
+ ) -> list[Message]:
28
+ """Use this method to send a group of photos, live photos, videos, documents or audios as an album. Documents and audio files can only be grouped in an album with messages of the same type. On success, an Array of Message objects that were sent is returned.
29
+
30
+ Args:
31
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
32
+ chat_id: Unique identifier for the target chat or username of the target bot, supergroup, or channel in the format @username
33
+ 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
34
+ 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
35
+ media: A JSON-serialized Array describing messages to be sent, must include 2-10 items
36
+ disable_notification: Sends messages silently. Users will receive a notification with no sound.
37
+ protect_content: Protects the contents of the sent messages from forwarding and saving
38
+ 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.
39
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
40
+ reply_parameters: Description of the message to reply to
41
+
42
+ https://core.telegram.org/bots/api#sendmediagroup
43
+ """
44
+ return await self._call('sendMediaGroup', locals(), 'list[Message]')
45
+
46
+ async def send_location(
47
+ self,
48
+ chat_id: int | str | None,
49
+ latitude: float,
50
+ longitude: float,
51
+ *,
52
+ business_connection_id: str | None = None,
53
+ message_thread_id: int | None = None,
54
+ direct_messages_topic_id: int | None = None,
55
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
56
+ horizontal_accuracy: float | None = None,
57
+ live_period: int | None = None,
58
+ heading: int | None = None,
59
+ proximity_alert_radius: int | None = None,
60
+ disable_notification: bool | None = None,
61
+ protect_content: bool | None = None,
62
+ allow_paid_broadcast: bool | None = None,
63
+ message_effect_id: str | None = None,
64
+ suggested_post_parameters: SuggestedPostParameters | None = None,
65
+ reply_parameters: ReplyParameters | None = None,
66
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
67
+ ) -> Message:
68
+ """Use this method to send a point on the map. On success, the sent Message is returned.
69
+
70
+ Args:
71
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
72
+ 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
73
+ 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
74
+ 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
75
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
76
+ latitude: Latitude of the location
77
+ longitude: Longitude of the location
78
+ horizontal_accuracy: The radius of uncertainty for the location, measured in meters; 0-1500
79
+ live_period: Period in seconds during which the location will be updated (see Live Locations), must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely. Must be 0 for ephemeral messages.
80
+ heading: For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
81
+ proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
82
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
83
+ protect_content: Protects the contents of the sent message from forwarding and saving
84
+ 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.
85
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
86
+ 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.
87
+ reply_parameters: Description of the message to reply to
88
+ 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.
89
+
90
+ https://core.telegram.org/bots/api#sendlocation
91
+ """
92
+ return await self._call('sendLocation', locals(), 'Message')
@@ -0,0 +1,107 @@
1
+ from __future__ import annotations
2
+
3
+ from ..core.caller import AsyncCaller
4
+ from ..types import (
5
+ EphemeralMessageParameters, ForceReply, InlineKeyboardMarkup, Message, ReplyKeyboardMarkup,
6
+ ReplyKeyboardRemove, ReplyParameters, SuggestedPostParameters,
7
+ )
8
+
9
+
10
+ class AsyncMethods11(AsyncCaller):
11
+ __slots__ = ()
12
+
13
+ async def send_venue(
14
+ self,
15
+ chat_id: int | str | None,
16
+ latitude: float,
17
+ longitude: float,
18
+ title: str,
19
+ address: str,
20
+ *,
21
+ business_connection_id: str | None = None,
22
+ message_thread_id: int | None = None,
23
+ direct_messages_topic_id: int | None = None,
24
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
25
+ foursquare_id: str | None = None,
26
+ foursquare_type: str | None = None,
27
+ google_place_id: str | None = None,
28
+ google_place_type: str | None = None,
29
+ disable_notification: bool | None = None,
30
+ protect_content: bool | None = None,
31
+ allow_paid_broadcast: bool | None = None,
32
+ message_effect_id: str | None = None,
33
+ suggested_post_parameters: SuggestedPostParameters | None = None,
34
+ reply_parameters: ReplyParameters | None = None,
35
+ reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
36
+ ) -> Message:
37
+ """Use this method to send information about a venue. On success, the sent Message is returned.
38
+
39
+ Args:
40
+ business_connection_id: Unique identifier of the business connection on behalf of which the message will be sent
41
+ 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
42
+ 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
43
+ 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
44
+ ephemeral_message_parameters: A JSON-serialized object containing the parameters of the ephemeral message to send
45
+ latitude: Latitude of the venue
46
+ longitude: Longitude of the venue
47
+ title: Name of the venue
48
+ address: Address of the venue
49
+ foursquare_id: Foursquare identifier of the venue
50
+ foursquare_type: Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
51
+ google_place_id: Google Places identifier of the venue
52
+ google_place_type: Google Places type of the venue. (See supported types.)
53
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
54
+ protect_content: Protects the contents of the sent message from forwarding and saving
55
+ 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.
56
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
57
+ 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.
58
+ reply_parameters: Description of the message to reply to
59
+ 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.
60
+
61
+ https://core.telegram.org/bots/api#sendvenue
62
+ """
63
+ return await self._call('sendVenue', locals(), 'Message')
64
+
65
+ async def send_contact(
66
+ self,
67
+ chat_id: int | str | None,
68
+ phone_number: str,
69
+ first_name: str,
70
+ *,
71
+ business_connection_id: str | None = None,
72
+ message_thread_id: int | None = None,
73
+ direct_messages_topic_id: int | None = None,
74
+ ephemeral_message_parameters: EphemeralMessageParameters | None = None,
75
+ last_name: str | None = None,
76
+ vcard: str | 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 phone contacts. 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
+ phone_number: Contact's phone number
94
+ first_name: Contact's first name
95
+ last_name: Contact's last name
96
+ vcard: Additional data about the contact in the form of a vCard, 0-2048 bytes
97
+ disable_notification: Sends the message silently. Users will receive a notification with no sound.
98
+ protect_content: Protects the contents of the sent message from forwarding and saving
99
+ 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.
100
+ message_effect_id: Unique identifier of the message effect to be added to the message; for private chats only
101
+ 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.
102
+ reply_parameters: Description of the message to reply to
103
+ 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.
104
+
105
+ https://core.telegram.org/bots/api#sendcontact
106
+ """
107
+ return await self._call('sendContact', locals(), 'Message')