telegrinder 0.3.4.post1__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of telegrinder might be problematic. Click here for more details.
- telegrinder/__init__.py +30 -31
- telegrinder/api/__init__.py +2 -1
- telegrinder/api/api.py +28 -20
- telegrinder/api/error.py +8 -4
- telegrinder/api/response.py +2 -2
- telegrinder/api/token.py +2 -2
- telegrinder/bot/__init__.py +6 -0
- telegrinder/bot/bot.py +38 -31
- telegrinder/bot/cute_types/__init__.py +2 -0
- telegrinder/bot/cute_types/base.py +55 -129
- telegrinder/bot/cute_types/callback_query.py +76 -61
- telegrinder/bot/cute_types/chat_join_request.py +4 -3
- telegrinder/bot/cute_types/chat_member_updated.py +28 -31
- telegrinder/bot/cute_types/inline_query.py +5 -4
- telegrinder/bot/cute_types/message.py +555 -602
- telegrinder/bot/cute_types/pre_checkout_query.py +42 -0
- telegrinder/bot/cute_types/update.py +20 -12
- telegrinder/bot/cute_types/utils.py +3 -36
- telegrinder/bot/dispatch/__init__.py +4 -0
- telegrinder/bot/dispatch/abc.py +8 -9
- telegrinder/bot/dispatch/context.py +5 -7
- telegrinder/bot/dispatch/dispatch.py +85 -33
- telegrinder/bot/dispatch/handler/abc.py +5 -6
- telegrinder/bot/dispatch/handler/audio_reply.py +2 -2
- telegrinder/bot/dispatch/handler/base.py +3 -3
- telegrinder/bot/dispatch/handler/document_reply.py +2 -2
- telegrinder/bot/dispatch/handler/func.py +36 -42
- telegrinder/bot/dispatch/handler/media_group_reply.py +5 -4
- telegrinder/bot/dispatch/handler/message_reply.py +2 -2
- telegrinder/bot/dispatch/handler/photo_reply.py +2 -2
- telegrinder/bot/dispatch/handler/sticker_reply.py +2 -2
- telegrinder/bot/dispatch/handler/video_reply.py +2 -2
- telegrinder/bot/dispatch/middleware/abc.py +83 -8
- telegrinder/bot/dispatch/middleware/global_middleware.py +70 -0
- telegrinder/bot/dispatch/process.py +44 -50
- telegrinder/bot/dispatch/return_manager/__init__.py +2 -0
- telegrinder/bot/dispatch/return_manager/abc.py +6 -10
- telegrinder/bot/dispatch/return_manager/pre_checkout_query.py +20 -0
- telegrinder/bot/dispatch/view/__init__.py +2 -0
- telegrinder/bot/dispatch/view/abc.py +10 -6
- telegrinder/bot/dispatch/view/base.py +81 -50
- telegrinder/bot/dispatch/view/box.py +20 -9
- telegrinder/bot/dispatch/view/callback_query.py +3 -4
- telegrinder/bot/dispatch/view/chat_join_request.py +2 -7
- telegrinder/bot/dispatch/view/chat_member.py +3 -5
- telegrinder/bot/dispatch/view/inline_query.py +3 -4
- telegrinder/bot/dispatch/view/message.py +3 -4
- telegrinder/bot/dispatch/view/pre_checkout_query.py +16 -0
- telegrinder/bot/dispatch/view/raw.py +42 -40
- telegrinder/bot/dispatch/waiter_machine/actions.py +5 -4
- telegrinder/bot/dispatch/waiter_machine/hasher/__init__.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/hasher/callback.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/hasher/hasher.py +9 -7
- telegrinder/bot/dispatch/waiter_machine/hasher/message.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/hasher/state.py +3 -2
- telegrinder/bot/dispatch/waiter_machine/machine.py +113 -34
- telegrinder/bot/dispatch/waiter_machine/middleware.py +15 -10
- telegrinder/bot/dispatch/waiter_machine/short_state.py +7 -18
- telegrinder/bot/polling/polling.py +62 -54
- telegrinder/bot/rules/__init__.py +24 -1
- telegrinder/bot/rules/abc.py +17 -10
- telegrinder/bot/rules/callback_data.py +20 -61
- telegrinder/bot/rules/chat_join.py +6 -4
- telegrinder/bot/rules/command.py +4 -4
- telegrinder/bot/rules/enum_text.py +1 -4
- telegrinder/bot/rules/func.py +5 -3
- telegrinder/bot/rules/fuzzy.py +1 -1
- telegrinder/bot/rules/id.py +24 -0
- telegrinder/bot/rules/inline.py +6 -4
- telegrinder/bot/rules/integer.py +2 -1
- telegrinder/bot/rules/logic.py +18 -0
- telegrinder/bot/rules/markup.py +5 -6
- telegrinder/bot/rules/message.py +2 -4
- telegrinder/bot/rules/message_entities.py +1 -3
- telegrinder/bot/rules/node.py +15 -9
- telegrinder/bot/rules/payload.py +81 -0
- telegrinder/bot/rules/payment_invoice.py +29 -0
- telegrinder/bot/rules/regex.py +5 -6
- telegrinder/bot/rules/state.py +1 -3
- telegrinder/bot/rules/text.py +10 -5
- telegrinder/bot/rules/update.py +0 -0
- telegrinder/bot/scenario/abc.py +2 -4
- telegrinder/bot/scenario/checkbox.py +12 -14
- telegrinder/bot/scenario/choice.py +6 -9
- telegrinder/client/__init__.py +9 -1
- telegrinder/client/abc.py +35 -10
- telegrinder/client/aiohttp.py +28 -24
- telegrinder/client/form_data.py +31 -0
- telegrinder/client/sonic.py +212 -0
- telegrinder/model.py +38 -145
- telegrinder/modules.py +3 -1
- telegrinder/msgspec_utils.py +136 -68
- telegrinder/node/__init__.py +74 -13
- telegrinder/node/attachment.py +92 -16
- telegrinder/node/base.py +196 -68
- telegrinder/node/callback_query.py +17 -16
- telegrinder/node/command.py +3 -2
- telegrinder/node/composer.py +40 -75
- telegrinder/node/container.py +13 -7
- telegrinder/node/either.py +82 -0
- telegrinder/node/event.py +20 -31
- telegrinder/node/file.py +51 -0
- telegrinder/node/me.py +4 -5
- telegrinder/node/payload.py +78 -0
- telegrinder/node/polymorphic.py +28 -9
- telegrinder/node/rule.py +2 -6
- telegrinder/node/scope.py +4 -6
- telegrinder/node/source.py +37 -21
- telegrinder/node/text.py +20 -8
- telegrinder/node/tools/generator.py +7 -11
- telegrinder/py.typed +0 -0
- telegrinder/rules.py +0 -61
- telegrinder/tools/__init__.py +97 -38
- telegrinder/tools/adapter/__init__.py +19 -0
- telegrinder/tools/adapter/abc.py +49 -0
- telegrinder/tools/adapter/dataclass.py +56 -0
- telegrinder/{bot/rules → tools}/adapter/event.py +8 -10
- telegrinder/{bot/rules → tools}/adapter/node.py +8 -10
- telegrinder/{bot/rules → tools}/adapter/raw_event.py +2 -2
- telegrinder/{bot/rules → tools}/adapter/raw_update.py +2 -2
- telegrinder/tools/buttons.py +52 -26
- telegrinder/tools/callback_data_serilization/__init__.py +5 -0
- telegrinder/tools/callback_data_serilization/abc.py +51 -0
- telegrinder/tools/callback_data_serilization/json_ser.py +60 -0
- telegrinder/tools/callback_data_serilization/msgpack_ser.py +172 -0
- telegrinder/tools/error_handler/abc.py +4 -7
- telegrinder/tools/error_handler/error.py +0 -0
- telegrinder/tools/error_handler/error_handler.py +34 -48
- telegrinder/tools/formatting/__init__.py +57 -37
- telegrinder/tools/formatting/deep_links.py +541 -0
- telegrinder/tools/formatting/{html.py → html_formatter.py} +51 -79
- telegrinder/tools/formatting/spec_html_formats.py +14 -60
- telegrinder/tools/functional.py +1 -5
- telegrinder/tools/global_context/global_context.py +26 -51
- telegrinder/tools/global_context/telegrinder_ctx.py +3 -3
- telegrinder/tools/i18n/abc.py +0 -0
- telegrinder/tools/i18n/middleware/abc.py +3 -6
- telegrinder/tools/input_file_directory.py +30 -0
- telegrinder/tools/keyboard.py +9 -9
- telegrinder/tools/lifespan.py +105 -0
- telegrinder/tools/limited_dict.py +5 -10
- telegrinder/tools/loop_wrapper/abc.py +7 -2
- telegrinder/tools/loop_wrapper/loop_wrapper.py +40 -95
- telegrinder/tools/magic.py +236 -60
- telegrinder/tools/state_storage/__init__.py +0 -0
- telegrinder/tools/state_storage/abc.py +5 -9
- telegrinder/tools/state_storage/memory.py +1 -1
- telegrinder/tools/strings.py +13 -0
- telegrinder/types/__init__.py +8 -0
- telegrinder/types/enums.py +31 -21
- telegrinder/types/input_file.py +51 -0
- telegrinder/types/methods.py +531 -109
- telegrinder/types/objects.py +934 -826
- telegrinder/verification_utils.py +0 -2
- {telegrinder-0.3.4.post1.dist-info → telegrinder-0.4.1.dist-info}/LICENSE +2 -2
- telegrinder-0.4.1.dist-info/METADATA +143 -0
- telegrinder-0.4.1.dist-info/RECORD +182 -0
- {telegrinder-0.3.4.post1.dist-info → telegrinder-0.4.1.dist-info}/WHEEL +1 -1
- telegrinder/bot/rules/adapter/__init__.py +0 -17
- telegrinder/bot/rules/adapter/abc.py +0 -31
- telegrinder/node/message.py +0 -14
- telegrinder/node/update.py +0 -15
- telegrinder/tools/formatting/links.py +0 -38
- telegrinder/tools/kb_set/__init__.py +0 -4
- telegrinder/tools/kb_set/base.py +0 -15
- telegrinder/tools/kb_set/yaml.py +0 -63
- telegrinder-0.3.4.post1.dist-info/METADATA +0 -110
- telegrinder-0.3.4.post1.dist-info/RECORD +0 -165
- /telegrinder/{bot/rules → tools}/adapter/errors.py +0 -0
|
@@ -6,15 +6,11 @@ import fntypes.option
|
|
|
6
6
|
from fntypes.co import Result, Some, Variative
|
|
7
7
|
|
|
8
8
|
from telegrinder.api.api import API, APIError
|
|
9
|
-
from telegrinder.bot.cute_types.base import BaseCute, compose_method_params
|
|
10
|
-
from telegrinder.bot.cute_types.utils import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
input_media,
|
|
15
|
-
)
|
|
16
|
-
from telegrinder.model import From, field, get_params
|
|
17
|
-
from telegrinder.msgspec_utils import Nothing, Option
|
|
9
|
+
from telegrinder.bot.cute_types.base import BaseCute, compose_method_params
|
|
10
|
+
from telegrinder.bot.cute_types.utils import compose_reactions, input_media
|
|
11
|
+
from telegrinder.model import UNSET, From, field, get_params
|
|
12
|
+
from telegrinder.msgspec_utils import Option
|
|
13
|
+
from telegrinder.tools.magic import shortcut
|
|
18
14
|
from telegrinder.types import *
|
|
19
15
|
|
|
20
16
|
if typing.TYPE_CHECKING:
|
|
@@ -22,15 +18,15 @@ if typing.TYPE_CHECKING:
|
|
|
22
18
|
|
|
23
19
|
from telegrinder.bot.cute_types.callback_query import CallbackQueryCute
|
|
24
20
|
|
|
25
|
-
MediaType
|
|
21
|
+
type MediaType = typing.Literal[
|
|
26
22
|
"animation",
|
|
27
23
|
"audio",
|
|
28
24
|
"document",
|
|
29
25
|
"photo",
|
|
30
26
|
"video",
|
|
31
27
|
]
|
|
32
|
-
InputMediaType
|
|
33
|
-
ReplyMarkup
|
|
28
|
+
type InputMediaType = str | InputMedia | InputFile
|
|
29
|
+
type ReplyMarkup = InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
|
|
34
30
|
|
|
35
31
|
|
|
36
32
|
async def execute_method_answer(
|
|
@@ -44,17 +40,6 @@ async def execute_method_answer(
|
|
|
44
40
|
default_params={"chat_id", "message_thread_id"},
|
|
45
41
|
validators={"message_thread_id": lambda x: x.is_topic_message.unwrap_or(False)},
|
|
46
42
|
)
|
|
47
|
-
reply_parameters = params.get("reply_parameters")
|
|
48
|
-
link_preview_options = params.get("link_preview_options")
|
|
49
|
-
|
|
50
|
-
if reply_parameters is not None and isinstance(reply_parameters, dict):
|
|
51
|
-
reply_parameters.setdefault("message_id", params.get("message_id", message.message_id))
|
|
52
|
-
reply_parameters.setdefault("chat_id", params.get("chat_id"))
|
|
53
|
-
params["reply_parameters"] = compose_reply_params(**reply_parameters)
|
|
54
|
-
|
|
55
|
-
if link_preview_options is not None and isinstance(link_preview_options, dict):
|
|
56
|
-
params["link_preview_options"] = compose_link_preview_options(**link_preview_options)
|
|
57
|
-
|
|
58
43
|
result = await getattr(message.ctx_api, method_name)(**params)
|
|
59
44
|
return result.map(
|
|
60
45
|
lambda x: (
|
|
@@ -74,7 +59,13 @@ async def execute_method_reply(
|
|
|
74
59
|
method_name: str,
|
|
75
60
|
params: dict[str, typing.Any],
|
|
76
61
|
) -> Result[typing.Any, APIError]:
|
|
77
|
-
params.setdefault(
|
|
62
|
+
params.setdefault(
|
|
63
|
+
"reply_parameters",
|
|
64
|
+
ReplyParameters(
|
|
65
|
+
params.get("message_id", message.message_id),
|
|
66
|
+
params.get("chat_id", message.chat_id),
|
|
67
|
+
),
|
|
68
|
+
)
|
|
78
69
|
return await execute_method_answer(message, method_name, params)
|
|
79
70
|
|
|
80
71
|
|
|
@@ -120,23 +111,25 @@ async def execute_method_edit(
|
|
|
120
111
|
|
|
121
112
|
def get_entity_value(
|
|
122
113
|
entity_value: typing.Literal["user", "url", "custom_emoji_id", "language"],
|
|
123
|
-
entities: fntypes.option.Option[list[MessageEntity]]
|
|
124
|
-
caption_entities: fntypes.option.Option[list[MessageEntity]]
|
|
114
|
+
entities: fntypes.option.Option[list[MessageEntity]],
|
|
115
|
+
caption_entities: fntypes.option.Option[list[MessageEntity]],
|
|
125
116
|
) -> fntypes.option.Option[typing.Any]:
|
|
126
117
|
ents = entities.unwrap_or(caption_entities.unwrap_or_none())
|
|
127
118
|
if not ents:
|
|
128
|
-
return Nothing
|
|
119
|
+
return fntypes.option.Nothing()
|
|
120
|
+
|
|
129
121
|
for entity in ents:
|
|
130
|
-
if (obj := getattr(entity, entity_value, Nothing)) is not Nothing:
|
|
122
|
+
if (obj := getattr(entity, entity_value, fntypes.option.Nothing())) is not fntypes.option.Nothing():
|
|
131
123
|
return obj if isinstance(obj, Some) else Some(obj)
|
|
132
|
-
|
|
124
|
+
|
|
125
|
+
return fntypes.option.Nothing()
|
|
133
126
|
|
|
134
127
|
|
|
135
128
|
class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
136
129
|
api: API
|
|
137
130
|
|
|
138
131
|
reply_to_message: Option[MessageCute] = field(
|
|
139
|
-
default=
|
|
132
|
+
default=UNSET,
|
|
140
133
|
converter=From["MessageCute | None"],
|
|
141
134
|
)
|
|
142
135
|
"""Optional. For replies in the same chat and message thread, the original
|
|
@@ -144,7 +137,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
144
137
|
reply_to_message fields even if it itself is a reply."""
|
|
145
138
|
|
|
146
139
|
pinned_message: Option[Variative[MessageCute, InaccessibleMessage]] = field(
|
|
147
|
-
default=
|
|
140
|
+
default=UNSET,
|
|
148
141
|
converter=From["MessageCute | InaccessibleMessage | None"],
|
|
149
142
|
)
|
|
150
143
|
"""Optional. Specified message was pinned. Note that the Message object in
|
|
@@ -154,50 +147,44 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
154
147
|
@property
|
|
155
148
|
def mentioned_user(self) -> fntypes.option.Option[User]:
|
|
156
149
|
"""Mentioned user without username."""
|
|
157
|
-
|
|
158
150
|
return get_entity_value("user", self.entities, self.caption_entities)
|
|
159
151
|
|
|
160
152
|
@property
|
|
161
153
|
def url(self) -> fntypes.option.Option[str]:
|
|
162
154
|
"""Clickable text URL."""
|
|
163
|
-
|
|
164
155
|
return get_entity_value("url", self.entities, self.caption_entities)
|
|
165
156
|
|
|
166
157
|
@property
|
|
167
158
|
def programming_language(self) -> fntypes.option.Option[str]:
|
|
168
159
|
"""The programming language of the entity text."""
|
|
169
|
-
|
|
170
160
|
return get_entity_value("language", self.entities, self.caption_entities)
|
|
171
161
|
|
|
172
162
|
@property
|
|
173
163
|
def custom_emoji_id(self) -> fntypes.option.Option[str]:
|
|
174
164
|
"""Unique identifier of the custom emoji."""
|
|
175
|
-
|
|
176
165
|
return get_entity_value("custom_emoji_id", self.entities, self.caption_entities)
|
|
177
166
|
|
|
178
167
|
@shortcut(
|
|
179
168
|
"send_message",
|
|
180
169
|
executor=execute_method_answer,
|
|
181
|
-
custom_params={"link_preview_options", "
|
|
170
|
+
custom_params={"link_preview_options", "message_thread_id", "chat_id", "text"},
|
|
182
171
|
)
|
|
183
172
|
async def answer(
|
|
184
173
|
self,
|
|
185
174
|
text: str | None = None,
|
|
186
|
-
|
|
187
|
-
|
|
175
|
+
*,
|
|
176
|
+
allow_paid_broadcast: bool | None = None,
|
|
188
177
|
business_connection_id: str | None = None,
|
|
178
|
+
chat_id: int | str | None = None,
|
|
179
|
+
disable_notification: bool | None = None,
|
|
180
|
+
entities: list[MessageEntity] | None = None,
|
|
181
|
+
link_preview_options: LinkPreviewOptions | None = None,
|
|
189
182
|
message_effect_id: str | None = None,
|
|
183
|
+
message_thread_id: int | None = None,
|
|
190
184
|
parse_mode: str | None = None,
|
|
191
|
-
entities: list[MessageEntity] | None = None,
|
|
192
|
-
disable_notification: bool | None = None,
|
|
193
185
|
protect_content: bool | None = None,
|
|
194
|
-
|
|
195
|
-
reply_parameters: ReplyParameters |
|
|
196
|
-
reply_markup: InlineKeyboardMarkup
|
|
197
|
-
| ReplyKeyboardMarkup
|
|
198
|
-
| ReplyKeyboardRemove
|
|
199
|
-
| ForceReply
|
|
200
|
-
| None = None,
|
|
186
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
187
|
+
reply_parameters: ReplyParameters | None = None,
|
|
201
188
|
**other: typing.Any,
|
|
202
189
|
) -> Result[MessageCute, APIError]:
|
|
203
190
|
"""Shortcut `API.send_message()`, see the [documentation](https://core.telegram.org/bots/api#sendmessage)
|
|
@@ -219,38 +206,37 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
219
206
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
220
207
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
221
208
|
|
|
209
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
210
|
+
|
|
222
211
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
223
212
|
|
|
224
213
|
:param reply_parameters: Description of the message to reply to.
|
|
225
214
|
|
|
226
215
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
227
|
-
|
|
228
216
|
...
|
|
229
217
|
|
|
230
218
|
@shortcut(
|
|
231
219
|
"send_message",
|
|
232
220
|
executor=execute_method_reply,
|
|
233
|
-
custom_params={"
|
|
221
|
+
custom_params={"message_thread_id", "chat_id", "message_id"},
|
|
234
222
|
)
|
|
235
223
|
async def reply(
|
|
236
224
|
self,
|
|
237
225
|
text: str,
|
|
226
|
+
*,
|
|
227
|
+
allow_paid_broadcast: bool | None = None,
|
|
228
|
+
business_connection_id: str | None = None,
|
|
238
229
|
chat_id: int | str | None = None,
|
|
230
|
+
disable_notification: bool | None = None,
|
|
231
|
+
entities: list[MessageEntity] | None = None,
|
|
232
|
+
link_preview_options: LinkPreviewOptions | None = None,
|
|
233
|
+
message_effect_id: str | None = None,
|
|
239
234
|
message_id: int | None = None,
|
|
240
235
|
message_thread_id: int | None = None,
|
|
241
|
-
business_connection_id: str | None = None,
|
|
242
|
-
message_effect_id: str | None = None,
|
|
243
236
|
parse_mode: str | None = None,
|
|
244
|
-
entities: list[MessageEntity] | None = None,
|
|
245
|
-
disable_notification: bool | None = None,
|
|
246
237
|
protect_content: bool | None = None,
|
|
247
|
-
|
|
248
|
-
reply_parameters: ReplyParameters |
|
|
249
|
-
reply_markup: InlineKeyboardMarkup
|
|
250
|
-
| ReplyKeyboardMarkup
|
|
251
|
-
| ReplyKeyboardRemove
|
|
252
|
-
| ForceReply
|
|
253
|
-
| None = None,
|
|
238
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
239
|
+
reply_parameters: ReplyParameters | None = None,
|
|
254
240
|
**other: typing.Any,
|
|
255
241
|
) -> Result[MessageCute, APIError]:
|
|
256
242
|
"""Shortcut `API.send_message()`, see the [documentation](https://core.telegram.org/bots/api#sendmessage)
|
|
@@ -272,17 +258,19 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
272
258
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
273
259
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
274
260
|
|
|
261
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
262
|
+
|
|
275
263
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
276
264
|
|
|
277
265
|
:param reply_parameters: Description of the message to reply to.
|
|
278
266
|
|
|
279
267
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
280
|
-
|
|
281
268
|
...
|
|
282
269
|
|
|
283
270
|
@shortcut("delete_message", custom_params={"message_thread_id", "chat_id", "message_id"})
|
|
284
271
|
async def delete(
|
|
285
272
|
self,
|
|
273
|
+
*,
|
|
286
274
|
chat_id: int | None = None,
|
|
287
275
|
message_id: int | None = None,
|
|
288
276
|
message_thread_id: int | None = None,
|
|
@@ -301,7 +289,6 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
301
289
|
of a group, it can delete any message there. - If the bot has can_delete_messages
|
|
302
290
|
permission in a supergroup or a channel, it can delete any message there.
|
|
303
291
|
Returns True on success."""
|
|
304
|
-
|
|
305
292
|
params = compose_method_params(
|
|
306
293
|
params=get_params(locals()),
|
|
307
294
|
update=self,
|
|
@@ -318,15 +305,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
318
305
|
async def edit(
|
|
319
306
|
self,
|
|
320
307
|
text: str,
|
|
308
|
+
*,
|
|
309
|
+
business_connection_id: str | None = None,
|
|
321
310
|
chat_id: int | str | None = None,
|
|
311
|
+
entities: list[MessageEntity] | None = None,
|
|
312
|
+
inline_message_id: str | None = None,
|
|
313
|
+
link_preview_options: LinkPreviewOptions | None = None,
|
|
322
314
|
message_id: int | None = None,
|
|
323
315
|
message_thread_id: int | None = None,
|
|
324
316
|
parse_mode: str | None = None,
|
|
325
|
-
entities: list[MessageEntity] | None = None,
|
|
326
|
-
link_preview_options: LinkPreviewOptions | dict[str, typing.Any] | None = None,
|
|
327
317
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
328
|
-
business_connection_id: str | None = None,
|
|
329
|
-
inline_message_id: str | None = None,
|
|
330
318
|
**other: typing.Any,
|
|
331
319
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
332
320
|
"""Shortcut `API.edit_message_text()`, see the [documentation](https://core.telegram.org/bots/api#editmessagetext)
|
|
@@ -352,31 +340,29 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
352
340
|
:param link_preview_options: Link preview generation options for the message.
|
|
353
341
|
|
|
354
342
|
:param reply_markup: A JSON-serialized object for an inline keyboard."""
|
|
355
|
-
|
|
356
343
|
...
|
|
357
344
|
|
|
358
345
|
@shortcut(
|
|
359
346
|
"copy_message",
|
|
360
|
-
custom_params={"
|
|
347
|
+
custom_params={"message_thread_id", "chat_id", "message_id", "from_chat_id"},
|
|
361
348
|
)
|
|
362
349
|
async def copy(
|
|
363
350
|
self,
|
|
364
351
|
chat_id: int | str | None = None,
|
|
352
|
+
*,
|
|
353
|
+
allow_paid_broadcast: bool | None = None,
|
|
354
|
+
caption: str | None = None,
|
|
355
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
356
|
+
disable_notification: bool | None = None,
|
|
365
357
|
from_chat_id: int | str | None = None,
|
|
366
358
|
message_id: int | None = None,
|
|
367
359
|
message_thread_id: int | None = None,
|
|
368
|
-
caption: str | None = None,
|
|
369
360
|
parse_mode: str | None = None,
|
|
370
|
-
caption_entities: list[MessageEntity] | None = None,
|
|
371
|
-
disable_notification: bool | None = None,
|
|
372
361
|
protect_content: bool | None = None,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
| ReplyKeyboardMarkup
|
|
376
|
-
| ReplyKeyboardRemove
|
|
377
|
-
| ForceReply
|
|
378
|
-
| None = None,
|
|
362
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
363
|
+
reply_parameters: ReplyParameters | None = None,
|
|
379
364
|
show_caption_above_media: bool | None = None,
|
|
365
|
+
video_start_timestamp: int | None = None,
|
|
380
366
|
**other: typing.Any,
|
|
381
367
|
) -> Result[MessageId, APIError]:
|
|
382
368
|
"""Shortcut `API.copy_message()`, see the [documentation](https://core.telegram.org/bots/api#copymessage)
|
|
@@ -387,7 +373,6 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
387
373
|
field correct_option_id is known to the bot. The method is analogous to
|
|
388
374
|
the method forwardMessage, but the copied message doesn't have a link to
|
|
389
375
|
the original message. Returns the MessageId of the sent message on success."""
|
|
390
|
-
|
|
391
376
|
params = compose_method_params(
|
|
392
377
|
params=get_params(locals()),
|
|
393
378
|
update=self,
|
|
@@ -402,7 +387,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
402
387
|
if isinstance(reply_parameters, dict):
|
|
403
388
|
reply_parameters.setdefault("message_id", params.get("message_id"))
|
|
404
389
|
reply_parameters.setdefault("chat_id", params.get("chat_id"))
|
|
405
|
-
params["reply_parameters"] =
|
|
390
|
+
params["reply_parameters"] = ReplyParameters(**reply_parameters)
|
|
406
391
|
return await self.ctx_api.copy_message(**params)
|
|
407
392
|
|
|
408
393
|
@shortcut(
|
|
@@ -411,22 +396,20 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
411
396
|
)
|
|
412
397
|
async def react(
|
|
413
398
|
self,
|
|
414
|
-
reaction: (
|
|
415
|
-
|
|
416
|
-
) = None,
|
|
399
|
+
reaction: (str | ReactionEmoji | ReactionType | list[str | ReactionEmoji | ReactionType] | None) = None,
|
|
400
|
+
*,
|
|
417
401
|
chat_id: int | str | None = None,
|
|
418
|
-
message_thread_id: int | None = None,
|
|
419
|
-
message_id: int | None = None,
|
|
420
402
|
is_big: bool | None = None,
|
|
403
|
+
message_id: int | None = None,
|
|
404
|
+
message_thread_id: int | None = None,
|
|
421
405
|
**other: typing.Any,
|
|
422
406
|
) -> Result[bool, APIError]:
|
|
423
407
|
"""Shortcut `API.set_message_reaction()`, see the [documentation](https://core.telegram.org/bots/api#setmessagereaction)
|
|
424
408
|
|
|
425
409
|
Use this method to change the chosen reactions on a message. Service messages
|
|
426
|
-
can't be reacted to. Automatically forwarded messages from
|
|
427
|
-
its discussion group have the same available reactions as messages
|
|
428
|
-
channel. Bots can't use paid reactions. Returns True on success."""
|
|
429
|
-
|
|
410
|
+
of some types can't be reacted to. Automatically forwarded messages from
|
|
411
|
+
a channel to its discussion group have the same available reactions as messages
|
|
412
|
+
in the channel. Bots can't use paid reactions. Returns True on success."""
|
|
430
413
|
params = compose_method_params(
|
|
431
414
|
params=get_params(locals()),
|
|
432
415
|
update=self,
|
|
@@ -443,11 +426,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
443
426
|
async def forward(
|
|
444
427
|
self,
|
|
445
428
|
chat_id: int | str,
|
|
446
|
-
|
|
429
|
+
*,
|
|
430
|
+
disable_notification: bool | None = None,
|
|
447
431
|
from_chat_id: int | str | None = None,
|
|
432
|
+
message_id: int | None = None,
|
|
448
433
|
message_thread_id: int | None = None,
|
|
449
|
-
disable_notification: bool | None = None,
|
|
450
434
|
protect_content: bool | None = None,
|
|
435
|
+
video_start_timestamp: int | None = None,
|
|
451
436
|
**other: typing.Any,
|
|
452
437
|
) -> Result[MessageCute, APIError]:
|
|
453
438
|
"""Shortcut `API.forward_message()`, see the [documentation](https://core.telegram.org/bots/api#forwardmessage)
|
|
@@ -461,10 +446,11 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
461
446
|
|
|
462
447
|
:param from_chat_id: Unique identifier for the chat where the original message was sent (or channelusername in the format @channelusername).
|
|
463
448
|
|
|
449
|
+
:param video_start_timestamp: New start timestamp for the forwarded video in the message.
|
|
450
|
+
|
|
464
451
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
465
452
|
:param protect_content: Protects the contents of the forwarded message from forwarding and saving.
|
|
466
453
|
:param message_id: Message identifier in the chat specified in from_chat_id."""
|
|
467
|
-
|
|
468
454
|
params = compose_method_params(
|
|
469
455
|
params=get_params(locals()),
|
|
470
456
|
update=self,
|
|
@@ -482,11 +468,12 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
482
468
|
@shortcut("pin_chat_message", custom_params={"message_thread_id", "chat_id", "message_id"})
|
|
483
469
|
async def pin(
|
|
484
470
|
self,
|
|
471
|
+
*,
|
|
472
|
+
business_connection_id: str | None = None,
|
|
485
473
|
chat_id: int | str | None = None,
|
|
474
|
+
disable_notification: bool | None = None,
|
|
486
475
|
message_id: int | None = None,
|
|
487
476
|
message_thread_id: int | None = None,
|
|
488
|
-
disable_notification: bool | None = None,
|
|
489
|
-
business_connection_id: str | None = None,
|
|
490
477
|
**other: typing.Any,
|
|
491
478
|
) -> Result[bool, "APIError"]:
|
|
492
479
|
"""Shortcut `API.pin_chat_message()`, see the [documentation](https://core.telegram.org/bots/api#pinchatmessage)
|
|
@@ -503,7 +490,6 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
503
490
|
:param message_id: Identifier of a message to pin.
|
|
504
491
|
|
|
505
492
|
:param disable_notification: Pass True if it is not necessary to send a notification to all chat membersabout the new pinned message. Notifications are always disabled in channelsand private chats."""
|
|
506
|
-
|
|
507
493
|
params = compose_method_params(
|
|
508
494
|
params=get_params(locals()),
|
|
509
495
|
update=self,
|
|
@@ -515,10 +501,11 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
515
501
|
@shortcut("unpin_chat_message", custom_params={"message_thread_id", "chat_id", "message_id"})
|
|
516
502
|
async def unpin(
|
|
517
503
|
self,
|
|
504
|
+
*,
|
|
505
|
+
business_connection_id: str | None = None,
|
|
518
506
|
chat_id: int | str | None = None,
|
|
519
507
|
message_id: int | None = None,
|
|
520
508
|
message_thread_id: int | None = None,
|
|
521
|
-
business_connection_id: str | None = None,
|
|
522
509
|
**other: typing.Any,
|
|
523
510
|
) -> Result[bool, "APIError"]:
|
|
524
511
|
"""Shortcut `API.unpin_chat_message()`, see the [documentation](https://core.telegram.org/bots/api#unpinchatmessage)
|
|
@@ -533,7 +520,6 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
533
520
|
:param chat_id: Unique identifier for the target chat or username of the target channel(in the format @channelusername).
|
|
534
521
|
|
|
535
522
|
:param message_id: Identifier of the message to unpin. Required if business_connection_idis specified. If not specified, the most recent pinned message (by sendingdate) will be unpinned."""
|
|
536
|
-
|
|
537
523
|
params = compose_method_params(
|
|
538
524
|
params=get_params(locals()),
|
|
539
525
|
update=self,
|
|
@@ -545,30 +531,28 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
545
531
|
@shortcut(
|
|
546
532
|
"send_audio",
|
|
547
533
|
executor=execute_method_answer,
|
|
548
|
-
custom_params={"
|
|
534
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
549
535
|
)
|
|
550
536
|
async def answer_audio(
|
|
551
537
|
self,
|
|
552
538
|
audio: InputFile | str,
|
|
553
|
-
|
|
554
|
-
|
|
539
|
+
*,
|
|
540
|
+
allow_paid_broadcast: bool | None = None,
|
|
555
541
|
business_connection_id: str | None = None,
|
|
556
|
-
message_effect_id: str | None = None,
|
|
557
542
|
caption: str | None = None,
|
|
558
|
-
parse_mode: str | None = None,
|
|
559
543
|
caption_entities: list[MessageEntity] | None = None,
|
|
544
|
+
chat_id: int | str | None = None,
|
|
545
|
+
disable_notification: bool | None = None,
|
|
560
546
|
duration: int | None = None,
|
|
547
|
+
message_effect_id: str | None = None,
|
|
548
|
+
message_thread_id: int | None = None,
|
|
549
|
+
parse_mode: str | None = None,
|
|
561
550
|
performer: str | None = None,
|
|
562
|
-
title: str | None = None,
|
|
563
|
-
thumbnail: InputFile | str | None = None,
|
|
564
|
-
disable_notification: bool | None = None,
|
|
565
551
|
protect_content: bool | None = None,
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
|
569
|
-
|
|
|
570
|
-
| ForceReply
|
|
571
|
-
| None = None,
|
|
552
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
553
|
+
reply_parameters: ReplyParameters | None = None,
|
|
554
|
+
thumbnail: InputFile | str | None = None,
|
|
555
|
+
title: str | None = None,
|
|
572
556
|
**other: typing.Any,
|
|
573
557
|
) -> Result[MessageCute, APIError]:
|
|
574
558
|
"""Shortcut `API.send_audio()`, see the [documentation](https://core.telegram.org/bots/api#sendaudio)
|
|
@@ -601,43 +585,42 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
601
585
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
602
586
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
603
587
|
|
|
588
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
589
|
+
|
|
604
590
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
605
591
|
|
|
606
592
|
:param reply_parameters: Description of the message to reply to.
|
|
607
593
|
|
|
608
594
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
609
|
-
|
|
610
595
|
...
|
|
611
596
|
|
|
612
597
|
@shortcut(
|
|
613
598
|
"send_animation",
|
|
614
599
|
executor=execute_method_answer,
|
|
615
|
-
custom_params={"
|
|
600
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
616
601
|
)
|
|
617
602
|
async def answer_animation(
|
|
618
603
|
self,
|
|
619
604
|
animation: InputFile | str,
|
|
620
|
-
|
|
621
|
-
|
|
605
|
+
*,
|
|
606
|
+
allow_paid_broadcast: bool | None = None,
|
|
622
607
|
business_connection_id: str | None = None,
|
|
623
|
-
message_effect_id: str | None = None,
|
|
624
608
|
caption: str | None = None,
|
|
625
|
-
parse_mode: str | None = None,
|
|
626
609
|
caption_entities: list[MessageEntity] | None = None,
|
|
627
|
-
|
|
610
|
+
chat_id: int | str | None = None,
|
|
611
|
+
disable_notification: bool | None = None,
|
|
628
612
|
duration: int | None = None,
|
|
629
|
-
width: int | None = None,
|
|
630
|
-
height: int | None = None,
|
|
631
|
-
thumbnail: InputFile | str | None = None,
|
|
632
613
|
has_spoiler: bool | None = None,
|
|
633
|
-
|
|
614
|
+
height: int | None = None,
|
|
615
|
+
message_effect_id: str | None = None,
|
|
616
|
+
message_thread_id: int | None = None,
|
|
617
|
+
parse_mode: str | None = None,
|
|
634
618
|
protect_content: bool | None = None,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
|
638
|
-
|
|
|
639
|
-
|
|
|
640
|
-
| None = None,
|
|
619
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
620
|
+
reply_parameters: ReplyParameters | None = None,
|
|
621
|
+
show_caption_above_media: bool | None = None,
|
|
622
|
+
thumbnail: InputFile | str | None = None,
|
|
623
|
+
width: int | None = None,
|
|
641
624
|
**other: typing.Any,
|
|
642
625
|
) -> Result[MessageCute, APIError]:
|
|
643
626
|
"""Shortcut `API.send_animation()`, see the [documentation](https://core.telegram.org/bots/api#sendanimation)
|
|
@@ -671,40 +654,39 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
671
654
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
672
655
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
673
656
|
|
|
657
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
658
|
+
|
|
674
659
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
675
660
|
|
|
676
661
|
:param reply_parameters: Description of the message to reply to.
|
|
677
662
|
|
|
678
663
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
679
|
-
|
|
680
664
|
...
|
|
681
665
|
|
|
682
666
|
@shortcut(
|
|
683
667
|
"send_document",
|
|
684
668
|
executor=execute_method_answer,
|
|
685
|
-
custom_params={"
|
|
669
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
686
670
|
)
|
|
687
671
|
async def answer_document(
|
|
688
672
|
self,
|
|
689
673
|
document: InputFile | str,
|
|
690
|
-
|
|
691
|
-
|
|
674
|
+
*,
|
|
675
|
+
allow_paid_broadcast: bool | None = None,
|
|
692
676
|
business_connection_id: str | None = None,
|
|
693
|
-
message_effect_id: str | None = None,
|
|
694
677
|
caption: str | None = None,
|
|
695
|
-
parse_mode: str | None = None,
|
|
696
678
|
caption_entities: list[MessageEntity] | None = None,
|
|
679
|
+
chat_id: int | str | None = None,
|
|
697
680
|
disable_content_type_detection: bool | None = None,
|
|
698
|
-
show_caption_above_media: bool | None = None,
|
|
699
|
-
thumbnail: InputFile | str | None = None,
|
|
700
681
|
disable_notification: bool | None = None,
|
|
682
|
+
message_effect_id: str | None = None,
|
|
683
|
+
message_thread_id: int | None = None,
|
|
684
|
+
parse_mode: str | None = None,
|
|
701
685
|
protect_content: bool | None = None,
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
|
705
|
-
|
|
|
706
|
-
| ForceReply
|
|
707
|
-
| None = None,
|
|
686
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
687
|
+
reply_parameters: ReplyParameters | None = None,
|
|
688
|
+
show_caption_above_media: bool | None = None,
|
|
689
|
+
thumbnail: InputFile | str | None = None,
|
|
708
690
|
**other: typing.Any,
|
|
709
691
|
) -> Result[MessageCute, APIError]:
|
|
710
692
|
"""Shortcut `API.send_document()`, see the [documentation](https://core.telegram.org/bots/api#senddocument)
|
|
@@ -731,39 +713,38 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
731
713
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
732
714
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
733
715
|
|
|
716
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
717
|
+
|
|
734
718
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
735
719
|
|
|
736
720
|
:param reply_parameters: Description of the message to reply to.
|
|
737
721
|
|
|
738
722
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
739
|
-
|
|
740
723
|
...
|
|
741
724
|
|
|
742
725
|
@shortcut(
|
|
743
726
|
"send_photo",
|
|
744
727
|
executor=execute_method_answer,
|
|
745
|
-
custom_params={"
|
|
728
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
746
729
|
)
|
|
747
730
|
async def answer_photo(
|
|
748
731
|
self,
|
|
749
732
|
photo: InputFile | str,
|
|
750
|
-
|
|
751
|
-
|
|
733
|
+
*,
|
|
734
|
+
allow_paid_broadcast: bool | None = None,
|
|
752
735
|
business_connection_id: str | None = None,
|
|
753
|
-
message_effect_id: str | None = None,
|
|
754
736
|
caption: str | None = None,
|
|
755
|
-
parse_mode: str | None = None,
|
|
756
737
|
caption_entities: list[MessageEntity] | None = None,
|
|
757
|
-
|
|
758
|
-
has_spoiler: bool | None = None,
|
|
738
|
+
chat_id: int | str | None = None,
|
|
759
739
|
disable_notification: bool | None = None,
|
|
740
|
+
has_spoiler: bool | None = None,
|
|
741
|
+
message_effect_id: str | None = None,
|
|
742
|
+
message_thread_id: int | None = None,
|
|
743
|
+
parse_mode: str | None = None,
|
|
760
744
|
protect_content: bool | None = None,
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
|
764
|
-
| ReplyKeyboardRemove
|
|
765
|
-
| ForceReply
|
|
766
|
-
| None = None,
|
|
745
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
746
|
+
reply_parameters: ReplyParameters | None = None,
|
|
747
|
+
show_caption_above_media: bool | None = None,
|
|
767
748
|
**other: typing.Any,
|
|
768
749
|
) -> Result[MessageCute, APIError]:
|
|
769
750
|
"""Shortcut `API.send_photo()`, see the [documentation](https://core.telegram.org/bots/api#sendphoto)
|
|
@@ -789,35 +770,34 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
789
770
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
790
771
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
791
772
|
|
|
773
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
774
|
+
|
|
792
775
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
793
776
|
|
|
794
777
|
:param reply_parameters: Description of the message to reply to.
|
|
795
778
|
|
|
796
779
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
797
|
-
|
|
798
780
|
...
|
|
799
781
|
|
|
800
782
|
@shortcut(
|
|
801
783
|
"send_sticker",
|
|
802
784
|
executor=execute_method_answer,
|
|
803
|
-
custom_params={"
|
|
785
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
804
786
|
)
|
|
805
787
|
async def answer_sticker(
|
|
806
788
|
self,
|
|
807
789
|
sticker: InputFile | str,
|
|
790
|
+
*,
|
|
791
|
+
allow_paid_broadcast: bool | None = None,
|
|
792
|
+
business_connection_id: str | None = None,
|
|
808
793
|
chat_id: int | str | None = None,
|
|
794
|
+
disable_notification: bool | None = None,
|
|
809
795
|
emoji: str | None = None,
|
|
810
|
-
message_thread_id: int | None = None,
|
|
811
796
|
message_effect_id: str | None = None,
|
|
812
|
-
|
|
813
|
-
disable_notification: bool | None = None,
|
|
797
|
+
message_thread_id: int | None = None,
|
|
814
798
|
protect_content: bool | None = None,
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
| ReplyKeyboardMarkup
|
|
818
|
-
| ReplyKeyboardRemove
|
|
819
|
-
| ForceReply
|
|
820
|
-
| None = None,
|
|
799
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
800
|
+
reply_parameters: ReplyParameters | None = None,
|
|
821
801
|
**other: typing.Any,
|
|
822
802
|
) -> Result[MessageCute, APIError]:
|
|
823
803
|
"""Shortcut `API.send_sticker()`, see the [documentation](https://core.telegram.org/bots/api#sendsticker)
|
|
@@ -837,44 +817,45 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
837
817
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
838
818
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
839
819
|
|
|
820
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
821
|
+
|
|
840
822
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
841
823
|
|
|
842
824
|
:param reply_parameters: Description of the message to reply to.
|
|
843
825
|
|
|
844
826
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
845
|
-
|
|
846
827
|
...
|
|
847
828
|
|
|
848
829
|
@shortcut(
|
|
849
830
|
"send_video",
|
|
850
831
|
executor=execute_method_answer,
|
|
851
|
-
custom_params={"
|
|
832
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
852
833
|
)
|
|
853
834
|
async def answer_video(
|
|
854
835
|
self,
|
|
855
836
|
video: InputFile | str,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
message_thread_id: int | None = None,
|
|
859
|
-
message_effect_id: str | None = None,
|
|
837
|
+
*,
|
|
838
|
+
allow_paid_broadcast: bool | None = None,
|
|
860
839
|
business_connection_id: str | None = None,
|
|
840
|
+
caption: str | None = None,
|
|
841
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
842
|
+
chat_id: int | str | None = None,
|
|
843
|
+
cover: InputFile | str | None = None,
|
|
861
844
|
disable_notification: bool | None = None,
|
|
862
|
-
protect_content: bool | None = None,
|
|
863
|
-
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
864
|
-
reply_markup: InlineKeyboardMarkup
|
|
865
|
-
| ReplyKeyboardMarkup
|
|
866
|
-
| ReplyKeyboardRemove
|
|
867
|
-
| ForceReply
|
|
868
|
-
| None = None,
|
|
869
845
|
duration: int | None = None,
|
|
870
|
-
|
|
846
|
+
emoji: str | None = None,
|
|
847
|
+
has_spoiler: bool | None = None,
|
|
871
848
|
height: int | None = None,
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
849
|
+
message_effect_id: str | None = None,
|
|
850
|
+
message_thread_id: int | None = None,
|
|
851
|
+
protect_content: bool | None = None,
|
|
852
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
853
|
+
reply_parameters: ReplyParameters | None = None,
|
|
875
854
|
show_caption_above_media: bool | None = None,
|
|
876
|
-
|
|
855
|
+
start_timestamp: int | None = None,
|
|
877
856
|
supports_streaming: bool | None = None,
|
|
857
|
+
thumbnail: InputFile | str | None = None,
|
|
858
|
+
width: int | None = None,
|
|
878
859
|
**other: typing.Any,
|
|
879
860
|
) -> Result[MessageCute, APIError]:
|
|
880
861
|
"""Shortcut `API.send_video()`, see the [documentation](https://core.telegram.org/bots/api#sendvideo)
|
|
@@ -897,6 +878,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
897
878
|
:param height: Video height.
|
|
898
879
|
|
|
899
880
|
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for thefile is supported server-side. The thumbnail should be in JPEG format andless than 200 kB in size. A thumbnail's width and height should not exceed320. Ignored if the file is not uploaded using multipart/form-data. Thumbnailscan't be reused and can be only 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: https://core.telegram.org/bots/api#sending-files.
|
|
881
|
+
:param cover: Cover for the video in the message. Pass a file_id to send a file that existson the Telegram servers (recommended), pass an HTTP URL for Telegram toget a file from the Internet, or pass `attach://<file_attach_name>` toupload a new one using multipart/form-data under <file_attach_name>name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files.
|
|
882
|
+
:param start_timestamp: Start timestamp for the video in the message.
|
|
883
|
+
|
|
900
884
|
:param caption: Video caption (may also be used when resending videos by file_id), 0-1024characters after entities parsing.
|
|
901
885
|
|
|
902
886
|
:param parse_mode: Mode for parsing entities in the video caption. See formatting optionsfor more details.
|
|
@@ -912,37 +896,36 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
912
896
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
913
897
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
914
898
|
|
|
899
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
900
|
+
|
|
915
901
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
916
902
|
|
|
917
903
|
:param reply_parameters: Description of the message to reply to.
|
|
918
904
|
|
|
919
905
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
920
|
-
|
|
921
906
|
...
|
|
922
907
|
|
|
923
908
|
@shortcut(
|
|
924
909
|
"send_video_note",
|
|
925
910
|
executor=execute_method_answer,
|
|
926
|
-
custom_params={"
|
|
911
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
927
912
|
)
|
|
928
913
|
async def answer_video_note(
|
|
929
914
|
self,
|
|
930
915
|
video_note: InputFile | str,
|
|
931
|
-
|
|
916
|
+
*,
|
|
917
|
+
allow_paid_broadcast: bool | None = None,
|
|
932
918
|
business_connection_id: str | None = None,
|
|
933
|
-
|
|
919
|
+
chat_id: int | str | None = None,
|
|
920
|
+
disable_notification: bool | None = None,
|
|
934
921
|
duration: int | None = None,
|
|
935
922
|
length: int | None = None,
|
|
923
|
+
message_effect_id: str | None = None,
|
|
936
924
|
message_thread_id: int | None = None,
|
|
937
|
-
thumbnail: InputFile | str | None = None,
|
|
938
|
-
disable_notification: bool | None = None,
|
|
939
925
|
protect_content: bool | None = None,
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
|
943
|
-
| ReplyKeyboardRemove
|
|
944
|
-
| ForceReply
|
|
945
|
-
| None = None,
|
|
926
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
927
|
+
reply_parameters: ReplyParameters | None = None,
|
|
928
|
+
thumbnail: InputFile | str | None = None,
|
|
946
929
|
**other: typing.Any,
|
|
947
930
|
) -> Result[MessageCute, APIError]:
|
|
948
931
|
"""Shortcut `API.send_video_note()`, see the [documentation](https://core.telegram.org/bots/api#sendvideonote)
|
|
@@ -966,38 +949,37 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
966
949
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
967
950
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
968
951
|
|
|
952
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
953
|
+
|
|
969
954
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
970
955
|
|
|
971
956
|
:param reply_parameters: Description of the message to reply to.
|
|
972
957
|
|
|
973
958
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
974
|
-
|
|
975
959
|
...
|
|
976
960
|
|
|
977
961
|
@shortcut(
|
|
978
962
|
"send_voice",
|
|
979
963
|
executor=execute_method_answer,
|
|
980
|
-
custom_params={"
|
|
964
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
981
965
|
)
|
|
982
966
|
async def answer_voice(
|
|
983
967
|
self,
|
|
984
968
|
voice: InputFile | str,
|
|
985
|
-
|
|
986
|
-
|
|
969
|
+
*,
|
|
970
|
+
allow_paid_broadcast: bool | None = None,
|
|
987
971
|
business_connection_id: str | None = None,
|
|
988
|
-
message_effect_id: str | None = None,
|
|
989
972
|
caption: str | None = None,
|
|
990
|
-
parse_mode: str | None = None,
|
|
991
973
|
caption_entities: list[MessageEntity] | None = None,
|
|
992
|
-
|
|
974
|
+
chat_id: int | str | None = None,
|
|
993
975
|
disable_notification: bool | None = None,
|
|
976
|
+
duration: int | None = None,
|
|
977
|
+
message_effect_id: str | None = None,
|
|
978
|
+
message_thread_id: int | None = None,
|
|
979
|
+
parse_mode: str | None = None,
|
|
994
980
|
protect_content: bool | None = None,
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
| ReplyKeyboardMarkup
|
|
998
|
-
| ReplyKeyboardRemove
|
|
999
|
-
| ForceReply
|
|
1000
|
-
| None = None,
|
|
981
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
982
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1001
983
|
**other: typing.Any,
|
|
1002
984
|
) -> Result[MessageCute, APIError]:
|
|
1003
985
|
"""Shortcut `API.send_voice()`, see the [documentation](https://core.telegram.org/bots/api#sendvoice)
|
|
@@ -1026,48 +1008,47 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1026
1008
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1027
1009
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1028
1010
|
|
|
1011
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1012
|
+
|
|
1029
1013
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1030
1014
|
|
|
1031
1015
|
:param reply_parameters: Description of the message to reply to.
|
|
1032
1016
|
|
|
1033
1017
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1034
|
-
|
|
1035
1018
|
...
|
|
1036
1019
|
|
|
1037
1020
|
@shortcut(
|
|
1038
1021
|
"send_poll",
|
|
1039
1022
|
executor=execute_method_answer,
|
|
1040
|
-
custom_params={"
|
|
1023
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1041
1024
|
)
|
|
1042
1025
|
async def answer_poll(
|
|
1043
1026
|
self,
|
|
1044
1027
|
question: str,
|
|
1028
|
+
*,
|
|
1045
1029
|
options: list[InputPollOption],
|
|
1046
|
-
|
|
1047
|
-
business_connection_id: str | None = None,
|
|
1048
|
-
message_thread_id: int | None = None,
|
|
1049
|
-
message_effect_id: str | None = None,
|
|
1050
|
-
question_parse_mode: str | None = None,
|
|
1051
|
-
question_entities: list[MessageEntity] | None = None,
|
|
1052
|
-
is_anonymous: bool | None = None,
|
|
1053
|
-
type: typing.Literal["quiz", "regular"] | None = None,
|
|
1030
|
+
allow_paid_broadcast: bool | None = None,
|
|
1054
1031
|
allows_multiple_answers: bool | None = None,
|
|
1055
|
-
|
|
1032
|
+
business_connection_id: str | None = None,
|
|
1033
|
+
chat_id: int | str | None = None,
|
|
1034
|
+
close_date: datetime | int | None = None,
|
|
1056
1035
|
correct_option_id: int | None = None,
|
|
1036
|
+
disable_notification: bool | None = None,
|
|
1057
1037
|
explanation: str | None = None,
|
|
1058
|
-
explanation_parse_mode: str | None = None,
|
|
1059
1038
|
explanation_entities: list[MessageEntity] | None = None,
|
|
1060
|
-
|
|
1061
|
-
|
|
1039
|
+
explanation_parse_mode: str | None = None,
|
|
1040
|
+
is_anonymous: bool | None = None,
|
|
1062
1041
|
is_closed: bool | None = None,
|
|
1063
|
-
|
|
1042
|
+
message_effect_id: str | None = None,
|
|
1043
|
+
message_thread_id: int | None = None,
|
|
1044
|
+
open_period: int | None = None,
|
|
1064
1045
|
protect_content: bool | None = None,
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
| ReplyKeyboardMarkup
|
|
1068
|
-
|
|
|
1069
|
-
|
|
|
1070
|
-
| None = None,
|
|
1046
|
+
question_entities: list[MessageEntity] | None = None,
|
|
1047
|
+
question_parse_mode: str | None = None,
|
|
1048
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1049
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1050
|
+
show_caption_above_media: bool | None = None,
|
|
1051
|
+
type: typing.Literal["quiz", "regular"] | None = None,
|
|
1071
1052
|
**other: typing.Any,
|
|
1072
1053
|
) -> Result[MessageCute, APIError]:
|
|
1073
1054
|
"""Shortcut `API.send_poll()`, see the [documentation](https://core.telegram.org/bots/api#sendpoll)
|
|
@@ -1110,41 +1091,40 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1110
1091
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1111
1092
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1112
1093
|
|
|
1094
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1095
|
+
|
|
1113
1096
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1114
1097
|
|
|
1115
1098
|
:param reply_parameters: Description of the message to reply to.
|
|
1116
1099
|
|
|
1117
1100
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1118
|
-
|
|
1119
1101
|
...
|
|
1120
1102
|
|
|
1121
1103
|
@shortcut(
|
|
1122
1104
|
"send_venue",
|
|
1123
1105
|
executor=execute_method_answer,
|
|
1124
|
-
custom_params={"
|
|
1106
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1125
1107
|
)
|
|
1126
1108
|
async def answer_venue(
|
|
1127
1109
|
self,
|
|
1110
|
+
*,
|
|
1111
|
+
address: str,
|
|
1128
1112
|
latitude: float,
|
|
1129
1113
|
longitude: float,
|
|
1130
1114
|
title: str,
|
|
1131
|
-
|
|
1132
|
-
chat_id: int | str | None = None,
|
|
1115
|
+
allow_paid_broadcast: bool | None = None,
|
|
1133
1116
|
business_connection_id: str | None = None,
|
|
1134
|
-
|
|
1135
|
-
|
|
1117
|
+
chat_id: int | str | None = None,
|
|
1118
|
+
disable_notification: bool | None = None,
|
|
1136
1119
|
foursquare_id: str | None = None,
|
|
1137
1120
|
foursquare_type: str | None = None,
|
|
1138
1121
|
google_place_id: str | None = None,
|
|
1139
1122
|
google_place_type: str | None = None,
|
|
1140
|
-
|
|
1123
|
+
message_effect_id: str | None = None,
|
|
1124
|
+
message_thread_id: int | None = None,
|
|
1141
1125
|
protect_content: bool | None = None,
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
| ReplyKeyboardMarkup
|
|
1145
|
-
| ReplyKeyboardRemove
|
|
1146
|
-
| ForceReply
|
|
1147
|
-
| None = None,
|
|
1126
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1127
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1148
1128
|
**other: typing.Any,
|
|
1149
1129
|
) -> Result[MessageCute, APIError]:
|
|
1150
1130
|
"""Shortcut `API.send_venue()`, see the [documentation](https://core.telegram.org/bots/api#sendvenue)
|
|
@@ -1176,34 +1156,33 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1176
1156
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1177
1157
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1178
1158
|
|
|
1159
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1160
|
+
|
|
1179
1161
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1180
1162
|
|
|
1181
1163
|
:param reply_parameters: Description of the message to reply to.
|
|
1182
1164
|
|
|
1183
1165
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1184
|
-
|
|
1185
1166
|
...
|
|
1186
1167
|
|
|
1187
1168
|
@shortcut(
|
|
1188
1169
|
"send_dice",
|
|
1189
1170
|
executor=execute_method_answer,
|
|
1190
|
-
custom_params={"
|
|
1171
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1191
1172
|
)
|
|
1192
1173
|
async def answer_dice(
|
|
1193
1174
|
self,
|
|
1194
1175
|
emoji: DiceEmoji | None = None,
|
|
1195
|
-
|
|
1176
|
+
*,
|
|
1177
|
+
allow_paid_broadcast: bool | None = None,
|
|
1196
1178
|
business_connection_id: str | None = None,
|
|
1197
|
-
|
|
1198
|
-
message_effect_id: str | None = None,
|
|
1179
|
+
chat_id: int | str | None = None,
|
|
1199
1180
|
disable_notification: bool | None = None,
|
|
1181
|
+
message_effect_id: str | None = None,
|
|
1182
|
+
message_thread_id: int | None = None,
|
|
1200
1183
|
protect_content: bool | None = None,
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
| ReplyKeyboardMarkup
|
|
1204
|
-
| ReplyKeyboardRemove
|
|
1205
|
-
| ForceReply
|
|
1206
|
-
| None = None,
|
|
1184
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1185
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1207
1186
|
**other: typing.Any,
|
|
1208
1187
|
) -> Result[MessageCute, APIError]:
|
|
1209
1188
|
"""Shortcut `API.send_dice()`, see the [documentation](https://core.telegram.org/bots/api#senddice)
|
|
@@ -1220,30 +1199,33 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1220
1199
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1221
1200
|
:param protect_content: Protects the contents of the sent message from forwarding.
|
|
1222
1201
|
|
|
1202
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1203
|
+
|
|
1223
1204
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1224
1205
|
|
|
1225
1206
|
:param reply_parameters: Description of the message to reply to.
|
|
1226
1207
|
|
|
1227
1208
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1228
|
-
|
|
1229
1209
|
...
|
|
1230
1210
|
|
|
1231
1211
|
@shortcut(
|
|
1232
1212
|
"send_game",
|
|
1233
1213
|
executor=execute_method_answer,
|
|
1234
|
-
custom_params={"
|
|
1214
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1235
1215
|
)
|
|
1236
1216
|
async def answer_game(
|
|
1237
1217
|
self,
|
|
1238
1218
|
game_short_name: str,
|
|
1239
|
-
|
|
1219
|
+
*,
|
|
1220
|
+
allow_paid_broadcast: bool | None = None,
|
|
1240
1221
|
business_connection_id: str | None = None,
|
|
1241
|
-
|
|
1242
|
-
message_effect_id: str | None = None,
|
|
1222
|
+
chat_id: int | str | None = None,
|
|
1243
1223
|
disable_notification: bool | None = None,
|
|
1224
|
+
message_effect_id: str | None = None,
|
|
1225
|
+
message_thread_id: int | None = None,
|
|
1244
1226
|
protect_content: bool | None = None,
|
|
1245
|
-
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1246
1227
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
1228
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1247
1229
|
**other: typing.Any,
|
|
1248
1230
|
) -> Result[MessageCute, APIError]:
|
|
1249
1231
|
"""Shortcut `API.send_game()`, see the [documentation](https://core.telegram.org/bots/api#sendgame)
|
|
@@ -1260,68 +1242,71 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1260
1242
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1261
1243
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1262
1244
|
|
|
1245
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1246
|
+
|
|
1263
1247
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1264
1248
|
|
|
1265
1249
|
:param reply_parameters: Description of the message to reply to.
|
|
1266
1250
|
|
|
1267
1251
|
:param reply_markup: A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title'button will be shown. If not empty, the first button must launch the game."""
|
|
1268
|
-
|
|
1269
1252
|
...
|
|
1270
1253
|
|
|
1271
1254
|
@shortcut(
|
|
1272
1255
|
"send_invoice",
|
|
1273
1256
|
executor=execute_method_answer,
|
|
1274
|
-
custom_params={"
|
|
1257
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1275
1258
|
)
|
|
1276
1259
|
async def answer_invoice(
|
|
1277
1260
|
self,
|
|
1278
|
-
|
|
1261
|
+
*,
|
|
1262
|
+
currency: Currency,
|
|
1279
1263
|
description: str,
|
|
1280
1264
|
payload: str,
|
|
1281
|
-
currency: str,
|
|
1282
1265
|
prices: list[LabeledPrice],
|
|
1283
|
-
|
|
1266
|
+
title: str,
|
|
1267
|
+
allow_paid_broadcast: bool | None = None,
|
|
1284
1268
|
business_connection_id: str | None = None,
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1269
|
+
chat_id: int | str | None = None,
|
|
1270
|
+
disable_notification: bool | None = None,
|
|
1271
|
+
is_flexible: bool | None = None,
|
|
1288
1272
|
max_tip_amount: int | None = None,
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
photo_url: str | None = None,
|
|
1293
|
-
photo_size: int | None = None,
|
|
1294
|
-
photo_width: int | None = None,
|
|
1295
|
-
photo_height: int | None = None,
|
|
1273
|
+
message_effect_id: str | None = None,
|
|
1274
|
+
message_thread_id: int | None = None,
|
|
1275
|
+
need_email: bool | None = None,
|
|
1296
1276
|
need_name: bool | None = None,
|
|
1297
1277
|
need_phone_number: bool | None = None,
|
|
1298
|
-
need_email: bool | None = None,
|
|
1299
1278
|
need_shipping_address: bool | None = None,
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1279
|
+
photo_height: int | None = None,
|
|
1280
|
+
photo_size: int | None = None,
|
|
1281
|
+
photo_url: str | None = None,
|
|
1282
|
+
photo_width: int | None = None,
|
|
1304
1283
|
protect_content: bool | None = None,
|
|
1305
|
-
|
|
1284
|
+
provider_data: str | None = None,
|
|
1285
|
+
provider_token: str | None = None,
|
|
1306
1286
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
1287
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1288
|
+
send_email_to_provider: bool | None = None,
|
|
1289
|
+
send_phone_number_to_provider: bool | None = None,
|
|
1290
|
+
start_parameter: str | None = None,
|
|
1291
|
+
suggested_tip_amounts: list[int] | None = None,
|
|
1307
1292
|
**other: typing.Any,
|
|
1308
1293
|
) -> Result[MessageCute, APIError]:
|
|
1309
1294
|
"""Shortcut `API.send_invoice()`, see the [documentation](https://core.telegram.org/bots/api#sendinvoice)
|
|
1310
1295
|
|
|
1311
1296
|
Use this method to send invoices. On success, the sent Message is returned."""
|
|
1312
|
-
|
|
1313
1297
|
...
|
|
1314
1298
|
|
|
1315
1299
|
@shortcut(
|
|
1316
1300
|
"send_chat_action",
|
|
1317
1301
|
executor=execute_method_answer,
|
|
1318
|
-
custom_params={"
|
|
1302
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1319
1303
|
)
|
|
1320
1304
|
async def answer_chat_action(
|
|
1321
1305
|
self,
|
|
1322
1306
|
action: ChatAction,
|
|
1323
|
-
|
|
1307
|
+
*,
|
|
1324
1308
|
business_connection_id: str | None = None,
|
|
1309
|
+
chat_id: int | str | None = None,
|
|
1325
1310
|
message_thread_id: int | None = None,
|
|
1326
1311
|
**other: typing.Any,
|
|
1327
1312
|
) -> Result[bool, APIError]:
|
|
@@ -1338,26 +1323,25 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1338
1323
|
|
|
1339
1324
|
:param message_thread_id: Unique identifier for the target message thread; for supergroups only.
|
|
1340
1325
|
:param action: Type of action to broadcast. Choose one, depending on what the user is aboutto receive: typing for text messages, upload_photo for photos, record_videoor upload_video for videos, record_voice or upload_voice for voice notes,upload_document for general files, choose_sticker for stickers, find_locationfor location data, record_video_note or upload_video_note for videonotes."""
|
|
1341
|
-
|
|
1342
1326
|
...
|
|
1343
1327
|
|
|
1344
1328
|
@shortcut(
|
|
1345
1329
|
"send_media_group",
|
|
1346
|
-
custom_params={"media", "
|
|
1330
|
+
custom_params={"media", "chat_id", "message_thread_id"},
|
|
1347
1331
|
)
|
|
1348
1332
|
async def answer_media_group(
|
|
1349
1333
|
self,
|
|
1350
|
-
media:
|
|
1351
|
-
|
|
1334
|
+
media: InputMedia | list[InputMedia],
|
|
1335
|
+
*,
|
|
1336
|
+
allow_paid_broadcast: bool | None = None,
|
|
1352
1337
|
business_connection_id: str | None = None,
|
|
1353
|
-
|
|
1354
|
-
message_effect_id: str | None = None,
|
|
1355
|
-
caption: str | list[str] | None = None,
|
|
1356
|
-
parse_mode: str | list[str] | None = None,
|
|
1357
|
-
caption_entities: list[MessageEntity] | list[list[MessageEntity]] | None = None,
|
|
1338
|
+
chat_id: int | str | None = None,
|
|
1358
1339
|
disable_notification: bool | None = None,
|
|
1340
|
+
media_type: MediaType | None = None,
|
|
1341
|
+
message_effect_id: str | None = None,
|
|
1342
|
+
message_thread_id: int | None = None,
|
|
1359
1343
|
protect_content: bool | None = None,
|
|
1360
|
-
reply_parameters: ReplyParameters |
|
|
1344
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1361
1345
|
**other: typing.Any,
|
|
1362
1346
|
) -> Result[list[MessageCute], APIError]:
|
|
1363
1347
|
"""Shortcut `API.send_media_group()`, see the [documentation](https://core.telegram.org/bots/api#sendmediagroup)
|
|
@@ -1375,58 +1359,38 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1375
1359
|
|
|
1376
1360
|
:param disable_notification: Sends messages silently. Users will receive a notification with no sound.
|
|
1377
1361
|
:param protect_content: Protects the contents of the sent messages from forwarding and saving.
|
|
1362
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1363
|
+
|
|
1378
1364
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1379
1365
|
|
|
1380
1366
|
:param reply_parameters: Description of the message to reply to."""
|
|
1381
|
-
|
|
1382
1367
|
media = [media] if not isinstance(media, list) else media
|
|
1383
1368
|
params = get_params(locals())
|
|
1384
|
-
caption_entities_lst = typing.cast(
|
|
1385
|
-
list[list[MessageEntity]],
|
|
1386
|
-
[caption_entities]
|
|
1387
|
-
if caption_entities and len(caption_entities) == 1 and not isinstance(caption_entities[0], list)
|
|
1388
|
-
else caption_entities,
|
|
1389
|
-
)
|
|
1390
|
-
|
|
1391
|
-
for i, m in enumerate(media[:]):
|
|
1392
|
-
if isinstance(m, tuple):
|
|
1393
|
-
media.insert(
|
|
1394
|
-
i,
|
|
1395
|
-
input_media( # type: ignore
|
|
1396
|
-
*media.pop(i), # type: ignore
|
|
1397
|
-
caption=caption if not isinstance(caption, list) else caption[i],
|
|
1398
|
-
caption_entities=caption_entities_lst[i] if caption_entities_lst else None,
|
|
1399
|
-
parse_mode=parse_mode if not isinstance(parse_mode, list) else parse_mode[i],
|
|
1400
|
-
),
|
|
1401
|
-
)
|
|
1402
|
-
|
|
1403
1369
|
return await execute_method_answer(self, "send_media_group", params)
|
|
1404
1370
|
|
|
1405
1371
|
@shortcut(
|
|
1406
1372
|
"send_location",
|
|
1407
1373
|
executor=execute_method_answer,
|
|
1408
|
-
custom_params={"
|
|
1374
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1409
1375
|
)
|
|
1410
1376
|
async def answer_location(
|
|
1411
1377
|
self,
|
|
1378
|
+
*,
|
|
1412
1379
|
latitude: float,
|
|
1413
1380
|
longitude: float,
|
|
1414
|
-
|
|
1415
|
-
message_thread_id: int | None = None,
|
|
1381
|
+
allow_paid_broadcast: bool | None = None,
|
|
1416
1382
|
business_connection_id: str | None = None,
|
|
1417
|
-
|
|
1418
|
-
|
|
1383
|
+
chat_id: int | str | None = None,
|
|
1384
|
+
disable_notification: bool | None = None,
|
|
1419
1385
|
heading: int | None = None,
|
|
1386
|
+
horizontal_accuracy: float | None = None,
|
|
1420
1387
|
live_period: int | None = None,
|
|
1421
|
-
|
|
1422
|
-
|
|
1388
|
+
message_effect_id: str | None = None,
|
|
1389
|
+
message_thread_id: int | None = None,
|
|
1423
1390
|
protect_content: bool | None = None,
|
|
1424
|
-
|
|
1425
|
-
reply_markup: InlineKeyboardMarkup
|
|
1426
|
-
|
|
|
1427
|
-
| ReplyKeyboardRemove
|
|
1428
|
-
| ForceReply
|
|
1429
|
-
| None = None,
|
|
1391
|
+
proximity_alert_radius: int | None = None,
|
|
1392
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1393
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1430
1394
|
**other: typing.Any,
|
|
1431
1395
|
) -> Result[MessageCute, APIError]:
|
|
1432
1396
|
"""Shortcut `API.send_location()`, see the [documentation](https://core.telegram.org/bots/api#sendlocation)
|
|
@@ -1451,37 +1415,36 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1451
1415
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1452
1416
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1453
1417
|
|
|
1418
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1419
|
+
|
|
1454
1420
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1455
1421
|
|
|
1456
1422
|
:param reply_parameters: Description of the message to reply to.
|
|
1457
1423
|
|
|
1458
1424
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1459
|
-
|
|
1460
1425
|
...
|
|
1461
1426
|
|
|
1462
1427
|
@shortcut(
|
|
1463
1428
|
"send_contact",
|
|
1464
1429
|
executor=execute_method_answer,
|
|
1465
|
-
custom_params={"
|
|
1430
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1466
1431
|
)
|
|
1467
1432
|
async def answer_contact(
|
|
1468
1433
|
self,
|
|
1469
|
-
|
|
1434
|
+
*,
|
|
1470
1435
|
first_name: str,
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
chat_id: int | str | None = None,
|
|
1436
|
+
phone_number: str,
|
|
1437
|
+
allow_paid_broadcast: bool | None = None,
|
|
1474
1438
|
business_connection_id: str | None = None,
|
|
1475
|
-
|
|
1476
|
-
message_effect_id: str | None = None,
|
|
1439
|
+
chat_id: int | str | None = None,
|
|
1477
1440
|
disable_notification: bool | None = None,
|
|
1441
|
+
last_name: str | None = None,
|
|
1442
|
+
message_effect_id: str | None = None,
|
|
1443
|
+
message_thread_id: int | None = None,
|
|
1478
1444
|
protect_content: bool | None = None,
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
|
1482
|
-
| ReplyKeyboardRemove
|
|
1483
|
-
| ForceReply
|
|
1484
|
-
| None = None,
|
|
1445
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1446
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1447
|
+
vcard: str | None = None,
|
|
1485
1448
|
**other: typing.Any,
|
|
1486
1449
|
) -> Result[MessageCute, APIError]:
|
|
1487
1450
|
"""Shortcut `API.send_contact()`, see the [documentation](https://core.telegram.org/bots/api#sendcontact)
|
|
@@ -1504,41 +1467,40 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1504
1467
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1505
1468
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1506
1469
|
|
|
1470
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1471
|
+
|
|
1507
1472
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1508
1473
|
|
|
1509
1474
|
:param reply_parameters: Description of the message to reply to.
|
|
1510
1475
|
|
|
1511
1476
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1512
|
-
|
|
1513
1477
|
...
|
|
1514
1478
|
|
|
1515
1479
|
@shortcut(
|
|
1516
1480
|
"send_audio",
|
|
1517
1481
|
executor=execute_method_reply,
|
|
1518
|
-
custom_params={"
|
|
1482
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1519
1483
|
)
|
|
1520
1484
|
async def reply_audio(
|
|
1521
1485
|
self,
|
|
1522
1486
|
audio: InputFile | str,
|
|
1523
|
-
|
|
1524
|
-
|
|
1487
|
+
*,
|
|
1488
|
+
allow_paid_broadcast: bool | None = None,
|
|
1525
1489
|
business_connection_id: str | None = None,
|
|
1526
|
-
message_effect_id: str | None = None,
|
|
1527
1490
|
caption: str | None = None,
|
|
1528
|
-
parse_mode: str | None = None,
|
|
1529
1491
|
caption_entities: list[MessageEntity] | None = None,
|
|
1492
|
+
chat_id: int | str | None = None,
|
|
1493
|
+
disable_notification: bool | None = None,
|
|
1530
1494
|
duration: int | None = None,
|
|
1495
|
+
message_effect_id: str | None = None,
|
|
1496
|
+
message_thread_id: int | None = None,
|
|
1497
|
+
parse_mode: str | None = None,
|
|
1531
1498
|
performer: str | None = None,
|
|
1532
|
-
title: str | None = None,
|
|
1533
|
-
thumbnail: InputFile | str | None = None,
|
|
1534
|
-
disable_notification: bool | None = None,
|
|
1535
1499
|
protect_content: bool | None = None,
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
|
1539
|
-
|
|
|
1540
|
-
| ForceReply
|
|
1541
|
-
| None = None,
|
|
1500
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1501
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1502
|
+
thumbnail: InputFile | str | None = None,
|
|
1503
|
+
title: str | None = None,
|
|
1542
1504
|
**other: typing.Any,
|
|
1543
1505
|
) -> Result[MessageCute, APIError]:
|
|
1544
1506
|
"""Shortcut `API.send_audio()`, see the [documentation](https://core.telegram.org/bots/api#sendaudio)
|
|
@@ -1571,43 +1533,42 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1571
1533
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1572
1534
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1573
1535
|
|
|
1536
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1537
|
+
|
|
1574
1538
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1575
1539
|
|
|
1576
1540
|
:param reply_parameters: Description of the message to reply to.
|
|
1577
1541
|
|
|
1578
1542
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1579
|
-
|
|
1580
1543
|
...
|
|
1581
1544
|
|
|
1582
1545
|
@shortcut(
|
|
1583
1546
|
"send_animation",
|
|
1584
1547
|
executor=execute_method_reply,
|
|
1585
|
-
custom_params={"
|
|
1548
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1586
1549
|
)
|
|
1587
1550
|
async def reply_animation(
|
|
1588
1551
|
self,
|
|
1589
1552
|
animation: InputFile | str,
|
|
1590
|
-
|
|
1591
|
-
|
|
1553
|
+
*,
|
|
1554
|
+
allow_paid_broadcast: bool | None = None,
|
|
1592
1555
|
business_connection_id: str | None = None,
|
|
1593
|
-
message_effect_id: str | None = None,
|
|
1594
1556
|
caption: str | None = None,
|
|
1595
|
-
parse_mode: str | None = None,
|
|
1596
1557
|
caption_entities: list[MessageEntity] | None = None,
|
|
1597
|
-
|
|
1558
|
+
chat_id: int | str | None = None,
|
|
1559
|
+
disable_notification: bool | None = None,
|
|
1598
1560
|
duration: int | None = None,
|
|
1599
|
-
width: int | None = None,
|
|
1600
|
-
height: int | None = None,
|
|
1601
|
-
thumbnail: InputFile | str | None = None,
|
|
1602
1561
|
has_spoiler: bool | None = None,
|
|
1603
|
-
|
|
1562
|
+
height: int | None = None,
|
|
1563
|
+
message_effect_id: str | None = None,
|
|
1564
|
+
message_thread_id: int | None = None,
|
|
1565
|
+
parse_mode: str | None = None,
|
|
1604
1566
|
protect_content: bool | None = None,
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
|
1608
|
-
|
|
|
1609
|
-
|
|
|
1610
|
-
| None = None,
|
|
1567
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1568
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1569
|
+
show_caption_above_media: bool | None = None,
|
|
1570
|
+
thumbnail: InputFile | str | None = None,
|
|
1571
|
+
width: int | None = None,
|
|
1611
1572
|
**other: typing.Any,
|
|
1612
1573
|
) -> Result[MessageCute, APIError]:
|
|
1613
1574
|
"""Shortcut `API.send_animation()`, see the [documentation](https://core.telegram.org/bots/api#sendanimation)
|
|
@@ -1641,40 +1602,39 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1641
1602
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1642
1603
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1643
1604
|
|
|
1605
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1606
|
+
|
|
1644
1607
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1645
1608
|
|
|
1646
1609
|
:param reply_parameters: Description of the message to reply to.
|
|
1647
1610
|
|
|
1648
1611
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1649
|
-
|
|
1650
1612
|
...
|
|
1651
1613
|
|
|
1652
1614
|
@shortcut(
|
|
1653
1615
|
"send_document",
|
|
1654
1616
|
executor=execute_method_reply,
|
|
1655
|
-
custom_params={"
|
|
1617
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1656
1618
|
)
|
|
1657
1619
|
async def reply_document(
|
|
1658
1620
|
self,
|
|
1659
1621
|
document: InputFile | str,
|
|
1660
|
-
|
|
1661
|
-
|
|
1622
|
+
*,
|
|
1623
|
+
allow_paid_broadcast: bool | None = None,
|
|
1662
1624
|
business_connection_id: str | None = None,
|
|
1663
|
-
message_effect_id: str | None = None,
|
|
1664
1625
|
caption: str | None = None,
|
|
1665
|
-
parse_mode: str | None = None,
|
|
1666
1626
|
caption_entities: list[MessageEntity] | None = None,
|
|
1627
|
+
chat_id: int | str | None = None,
|
|
1667
1628
|
disable_content_type_detection: bool | None = None,
|
|
1668
|
-
show_caption_above_media: bool | None = None,
|
|
1669
|
-
thumbnail: InputFile | str | None = None,
|
|
1670
1629
|
disable_notification: bool | None = None,
|
|
1630
|
+
message_effect_id: str | None = None,
|
|
1631
|
+
message_thread_id: int | None = None,
|
|
1632
|
+
parse_mode: str | None = None,
|
|
1671
1633
|
protect_content: bool | None = None,
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
|
1675
|
-
|
|
|
1676
|
-
| ForceReply
|
|
1677
|
-
| None = None,
|
|
1634
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1635
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1636
|
+
show_caption_above_media: bool | None = None,
|
|
1637
|
+
thumbnail: InputFile | str | None = None,
|
|
1678
1638
|
**other: typing.Any,
|
|
1679
1639
|
) -> Result[MessageCute, APIError]:
|
|
1680
1640
|
"""Shortcut `API.send_document()`, see the [documentation](https://core.telegram.org/bots/api#senddocument)
|
|
@@ -1701,39 +1661,38 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1701
1661
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1702
1662
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1703
1663
|
|
|
1664
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1665
|
+
|
|
1704
1666
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1705
1667
|
|
|
1706
1668
|
:param reply_parameters: Description of the message to reply to.
|
|
1707
1669
|
|
|
1708
1670
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1709
|
-
|
|
1710
1671
|
...
|
|
1711
1672
|
|
|
1712
1673
|
@shortcut(
|
|
1713
1674
|
"send_photo",
|
|
1714
1675
|
executor=execute_method_reply,
|
|
1715
|
-
custom_params={"
|
|
1676
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1716
1677
|
)
|
|
1717
1678
|
async def reply_photo(
|
|
1718
1679
|
self,
|
|
1719
1680
|
photo: InputFile | str,
|
|
1720
|
-
|
|
1721
|
-
|
|
1681
|
+
*,
|
|
1682
|
+
allow_paid_broadcast: bool | None = None,
|
|
1722
1683
|
business_connection_id: str | None = None,
|
|
1723
|
-
message_effect_id: str | None = None,
|
|
1724
1684
|
caption: str | None = None,
|
|
1725
|
-
parse_mode: str | None = None,
|
|
1726
1685
|
caption_entities: list[MessageEntity] | None = None,
|
|
1727
|
-
|
|
1728
|
-
has_spoiler: bool | None = None,
|
|
1686
|
+
chat_id: int | str | None = None,
|
|
1729
1687
|
disable_notification: bool | None = None,
|
|
1688
|
+
has_spoiler: bool | None = None,
|
|
1689
|
+
message_effect_id: str | None = None,
|
|
1690
|
+
message_thread_id: int | None = None,
|
|
1691
|
+
parse_mode: str | None = None,
|
|
1730
1692
|
protect_content: bool | None = None,
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
|
1734
|
-
| ReplyKeyboardRemove
|
|
1735
|
-
| ForceReply
|
|
1736
|
-
| None = None,
|
|
1693
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1694
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1695
|
+
show_caption_above_media: bool | None = None,
|
|
1737
1696
|
**other: typing.Any,
|
|
1738
1697
|
) -> Result[MessageCute, APIError]:
|
|
1739
1698
|
"""Shortcut `API.send_photo()`, see the [documentation](https://core.telegram.org/bots/api#sendphoto)
|
|
@@ -1759,35 +1718,34 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1759
1718
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1760
1719
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1761
1720
|
|
|
1721
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1722
|
+
|
|
1762
1723
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1763
1724
|
|
|
1764
1725
|
:param reply_parameters: Description of the message to reply to.
|
|
1765
1726
|
|
|
1766
1727
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1767
|
-
|
|
1768
1728
|
...
|
|
1769
1729
|
|
|
1770
1730
|
@shortcut(
|
|
1771
1731
|
"send_sticker",
|
|
1772
1732
|
executor=execute_method_reply,
|
|
1773
|
-
custom_params={"
|
|
1733
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1774
1734
|
)
|
|
1775
1735
|
async def reply_sticker(
|
|
1776
1736
|
self,
|
|
1777
1737
|
sticker: InputFile | str,
|
|
1738
|
+
*,
|
|
1739
|
+
allow_paid_broadcast: bool | None = None,
|
|
1740
|
+
business_connection_id: str | None = None,
|
|
1778
1741
|
chat_id: int | str | None = None,
|
|
1742
|
+
disable_notification: bool | None = None,
|
|
1779
1743
|
emoji: str | None = None,
|
|
1780
|
-
message_thread_id: int | None = None,
|
|
1781
1744
|
message_effect_id: str | None = None,
|
|
1782
|
-
|
|
1783
|
-
disable_notification: bool | None = None,
|
|
1745
|
+
message_thread_id: int | None = None,
|
|
1784
1746
|
protect_content: bool | None = None,
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
| ReplyKeyboardMarkup
|
|
1788
|
-
| ReplyKeyboardRemove
|
|
1789
|
-
| ForceReply
|
|
1790
|
-
| None = None,
|
|
1747
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1748
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1791
1749
|
**other: typing.Any,
|
|
1792
1750
|
) -> Result[MessageCute, APIError]:
|
|
1793
1751
|
"""Shortcut `API.send_sticker()`, see the [documentation](https://core.telegram.org/bots/api#sendsticker)
|
|
@@ -1807,45 +1765,45 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1807
1765
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1808
1766
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1809
1767
|
|
|
1768
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1769
|
+
|
|
1810
1770
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1811
1771
|
|
|
1812
1772
|
:param reply_parameters: Description of the message to reply to.
|
|
1813
1773
|
|
|
1814
1774
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1815
|
-
|
|
1816
1775
|
...
|
|
1817
1776
|
|
|
1818
1777
|
@shortcut(
|
|
1819
1778
|
"send_video",
|
|
1820
1779
|
executor=execute_method_reply,
|
|
1821
|
-
custom_params={"
|
|
1780
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1822
1781
|
)
|
|
1823
1782
|
async def reply_video(
|
|
1824
1783
|
self,
|
|
1825
|
-
sticker: InputFile | str,
|
|
1826
1784
|
video: InputFile | str,
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
message_thread_id: int | None = None,
|
|
1830
|
-
message_effect_id: str | None = None,
|
|
1785
|
+
*,
|
|
1786
|
+
allow_paid_broadcast: bool | None = None,
|
|
1831
1787
|
business_connection_id: str | None = None,
|
|
1788
|
+
caption: str | None = None,
|
|
1789
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
1790
|
+
chat_id: int | str | None = None,
|
|
1791
|
+
cover: InputFile | str | None = None,
|
|
1832
1792
|
disable_notification: bool | None = None,
|
|
1833
|
-
protect_content: bool | None = None,
|
|
1834
|
-
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1835
|
-
reply_markup: InlineKeyboardMarkup
|
|
1836
|
-
| ReplyKeyboardMarkup
|
|
1837
|
-
| ReplyKeyboardRemove
|
|
1838
|
-
| ForceReply
|
|
1839
|
-
| None = None,
|
|
1840
1793
|
duration: int | None = None,
|
|
1841
|
-
|
|
1794
|
+
emoji: str | None = None,
|
|
1795
|
+
has_spoiler: bool | None = None,
|
|
1842
1796
|
height: int | None = None,
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1797
|
+
message_effect_id: str | None = None,
|
|
1798
|
+
message_thread_id: int | None = None,
|
|
1799
|
+
protect_content: bool | None = None,
|
|
1800
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1801
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1846
1802
|
show_caption_above_media: bool | None = None,
|
|
1847
|
-
|
|
1803
|
+
start_timestamp: int | None = None,
|
|
1848
1804
|
supports_streaming: bool | None = None,
|
|
1805
|
+
thumbnail: InputFile | str | None = None,
|
|
1806
|
+
width: int | None = None,
|
|
1849
1807
|
**other: typing.Any,
|
|
1850
1808
|
) -> Result[MessageCute, APIError]:
|
|
1851
1809
|
"""Shortcut `API.send_video()`, see the [documentation](https://core.telegram.org/bots/api#sendvideo)
|
|
@@ -1868,6 +1826,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1868
1826
|
:param height: Video height.
|
|
1869
1827
|
|
|
1870
1828
|
:param thumbnail: Thumbnail of the file sent; can be ignored if thumbnail generation for thefile is supported server-side. The thumbnail should be in JPEG format andless than 200 kB in size. A thumbnail's width and height should not exceed320. Ignored if the file is not uploaded using multipart/form-data. Thumbnailscan't be reused and can be only 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: https://core.telegram.org/bots/api#sending-files.
|
|
1829
|
+
:param cover: Cover for the video in the message. Pass a file_id to send a file that existson the Telegram servers (recommended), pass an HTTP URL for Telegram toget a file from the Internet, or pass `attach://<file_attach_name>` toupload a new one using multipart/form-data under <file_attach_name>name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files.
|
|
1830
|
+
:param start_timestamp: Start timestamp for the video in the message.
|
|
1831
|
+
|
|
1871
1832
|
:param caption: Video caption (may also be used when resending videos by file_id), 0-1024characters after entities parsing.
|
|
1872
1833
|
|
|
1873
1834
|
:param parse_mode: Mode for parsing entities in the video caption. See formatting optionsfor more details.
|
|
@@ -1883,37 +1844,36 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1883
1844
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1884
1845
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1885
1846
|
|
|
1847
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1848
|
+
|
|
1886
1849
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1887
1850
|
|
|
1888
1851
|
:param reply_parameters: Description of the message to reply to.
|
|
1889
1852
|
|
|
1890
1853
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1891
|
-
|
|
1892
1854
|
...
|
|
1893
1855
|
|
|
1894
1856
|
@shortcut(
|
|
1895
1857
|
"send_video_note",
|
|
1896
1858
|
executor=execute_method_reply,
|
|
1897
|
-
custom_params={"
|
|
1859
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1898
1860
|
)
|
|
1899
1861
|
async def reply_video_note(
|
|
1900
1862
|
self,
|
|
1901
1863
|
video_note: InputFile | str,
|
|
1902
|
-
|
|
1864
|
+
*,
|
|
1865
|
+
allow_paid_broadcast: bool | None = None,
|
|
1903
1866
|
business_connection_id: str | None = None,
|
|
1904
|
-
|
|
1867
|
+
chat_id: int | str | None = None,
|
|
1868
|
+
disable_notification: bool | None = None,
|
|
1905
1869
|
duration: int | None = None,
|
|
1906
1870
|
length: int | None = None,
|
|
1871
|
+
message_effect_id: str | None = None,
|
|
1907
1872
|
message_thread_id: int | None = None,
|
|
1908
|
-
thumbnail: InputFile | str | None = None,
|
|
1909
|
-
disable_notification: bool | None = None,
|
|
1910
1873
|
protect_content: bool | None = None,
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
|
1914
|
-
| ReplyKeyboardRemove
|
|
1915
|
-
| ForceReply
|
|
1916
|
-
| None = None,
|
|
1874
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1875
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1876
|
+
thumbnail: InputFile | str | None = None,
|
|
1917
1877
|
**other: typing.Any,
|
|
1918
1878
|
) -> Result[MessageCute, APIError]:
|
|
1919
1879
|
"""Shortcut `API.send_video_note()`, see the [documentation](https://core.telegram.org/bots/api#sendvideonote)
|
|
@@ -1937,38 +1897,37 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1937
1897
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1938
1898
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1939
1899
|
|
|
1900
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1901
|
+
|
|
1940
1902
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
1941
1903
|
|
|
1942
1904
|
:param reply_parameters: Description of the message to reply to.
|
|
1943
1905
|
|
|
1944
1906
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
1945
|
-
|
|
1946
1907
|
...
|
|
1947
1908
|
|
|
1948
1909
|
@shortcut(
|
|
1949
1910
|
"send_voice",
|
|
1950
1911
|
executor=execute_method_reply,
|
|
1951
|
-
custom_params={"
|
|
1912
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
1952
1913
|
)
|
|
1953
1914
|
async def reply_voice(
|
|
1954
1915
|
self,
|
|
1955
1916
|
voice: InputFile | str,
|
|
1956
|
-
|
|
1957
|
-
|
|
1917
|
+
*,
|
|
1918
|
+
allow_paid_broadcast: bool | None = None,
|
|
1958
1919
|
business_connection_id: str | None = None,
|
|
1959
|
-
message_effect_id: str | None = None,
|
|
1960
1920
|
caption: str | None = None,
|
|
1961
|
-
parse_mode: str | None = None,
|
|
1962
1921
|
caption_entities: list[MessageEntity] | None = None,
|
|
1963
|
-
|
|
1922
|
+
chat_id: int | str | None = None,
|
|
1964
1923
|
disable_notification: bool | None = None,
|
|
1924
|
+
duration: int | None = None,
|
|
1925
|
+
message_effect_id: str | None = None,
|
|
1926
|
+
message_thread_id: int | None = None,
|
|
1927
|
+
parse_mode: str | None = None,
|
|
1965
1928
|
protect_content: bool | None = None,
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
| ReplyKeyboardMarkup
|
|
1969
|
-
| ReplyKeyboardRemove
|
|
1970
|
-
| ForceReply
|
|
1971
|
-
| None = None,
|
|
1929
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1930
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1972
1931
|
**other: typing.Any,
|
|
1973
1932
|
) -> Result[MessageCute, APIError]:
|
|
1974
1933
|
"""Shortcut `API.send_voice()`, see the [documentation](https://core.telegram.org/bots/api#sendvoice)
|
|
@@ -1997,48 +1956,47 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1997
1956
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
1998
1957
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1999
1958
|
|
|
1959
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
1960
|
+
|
|
2000
1961
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
2001
1962
|
|
|
2002
1963
|
:param reply_parameters: Description of the message to reply to.
|
|
2003
1964
|
|
|
2004
1965
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
2005
|
-
|
|
2006
1966
|
...
|
|
2007
1967
|
|
|
2008
1968
|
@shortcut(
|
|
2009
1969
|
"send_poll",
|
|
2010
1970
|
executor=execute_method_reply,
|
|
2011
|
-
custom_params={"
|
|
1971
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
2012
1972
|
)
|
|
2013
1973
|
async def reply_poll(
|
|
2014
1974
|
self,
|
|
2015
1975
|
question: str,
|
|
1976
|
+
*,
|
|
2016
1977
|
options: list[InputPollOption],
|
|
2017
|
-
|
|
2018
|
-
business_connection_id: str | None = None,
|
|
2019
|
-
message_thread_id: int | None = None,
|
|
2020
|
-
message_effect_id: str | None = None,
|
|
2021
|
-
question_parse_mode: str | None = None,
|
|
2022
|
-
question_entities: list[MessageEntity] | None = None,
|
|
2023
|
-
is_anonymous: bool | None = None,
|
|
2024
|
-
type: typing.Literal["quiz", "regular"] | None = None,
|
|
1978
|
+
allow_paid_broadcast: bool | None = None,
|
|
2025
1979
|
allows_multiple_answers: bool | None = None,
|
|
2026
|
-
|
|
1980
|
+
business_connection_id: str | None = None,
|
|
1981
|
+
chat_id: int | str | None = None,
|
|
1982
|
+
close_date: datetime | int | None = None,
|
|
2027
1983
|
correct_option_id: int | None = None,
|
|
1984
|
+
disable_notification: bool | None = None,
|
|
2028
1985
|
explanation: str | None = None,
|
|
2029
|
-
explanation_parse_mode: str | None = None,
|
|
2030
1986
|
explanation_entities: list[MessageEntity] | None = None,
|
|
2031
|
-
|
|
2032
|
-
|
|
1987
|
+
explanation_parse_mode: str | None = None,
|
|
1988
|
+
is_anonymous: bool | None = None,
|
|
2033
1989
|
is_closed: bool | None = None,
|
|
2034
|
-
|
|
1990
|
+
message_effect_id: str | None = None,
|
|
1991
|
+
message_thread_id: int | None = None,
|
|
1992
|
+
open_period: int | None = None,
|
|
2035
1993
|
protect_content: bool | None = None,
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
| ReplyKeyboardMarkup
|
|
2039
|
-
|
|
|
2040
|
-
|
|
|
2041
|
-
| None = None,
|
|
1994
|
+
question_entities: list[MessageEntity] | None = None,
|
|
1995
|
+
question_parse_mode: str | None = None,
|
|
1996
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
1997
|
+
reply_parameters: ReplyParameters | None = None,
|
|
1998
|
+
show_caption_above_media: bool | None = None,
|
|
1999
|
+
type: typing.Literal["quiz", "regular"] | None = None,
|
|
2042
2000
|
**other: typing.Any,
|
|
2043
2001
|
) -> Result[MessageCute, APIError]:
|
|
2044
2002
|
"""Shortcut `API.send_poll()`, see the [documentation](https://core.telegram.org/bots/api#sendpoll)
|
|
@@ -2081,41 +2039,40 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2081
2039
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
2082
2040
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
2083
2041
|
|
|
2042
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
2043
|
+
|
|
2084
2044
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
2085
2045
|
|
|
2086
2046
|
:param reply_parameters: Description of the message to reply to.
|
|
2087
2047
|
|
|
2088
2048
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
2089
|
-
|
|
2090
2049
|
...
|
|
2091
2050
|
|
|
2092
2051
|
@shortcut(
|
|
2093
2052
|
"send_venue",
|
|
2094
2053
|
executor=execute_method_reply,
|
|
2095
|
-
custom_params={"
|
|
2054
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
2096
2055
|
)
|
|
2097
2056
|
async def reply_venue(
|
|
2098
2057
|
self,
|
|
2058
|
+
*,
|
|
2059
|
+
address: str,
|
|
2099
2060
|
latitude: float,
|
|
2100
2061
|
longitude: float,
|
|
2101
2062
|
title: str,
|
|
2102
|
-
|
|
2103
|
-
chat_id: int | str | None = None,
|
|
2063
|
+
allow_paid_broadcast: bool | None = None,
|
|
2104
2064
|
business_connection_id: str | None = None,
|
|
2105
|
-
|
|
2106
|
-
|
|
2065
|
+
chat_id: int | str | None = None,
|
|
2066
|
+
disable_notification: bool | None = None,
|
|
2107
2067
|
foursquare_id: str | None = None,
|
|
2108
2068
|
foursquare_type: str | None = None,
|
|
2109
2069
|
google_place_id: str | None = None,
|
|
2110
2070
|
google_place_type: str | None = None,
|
|
2111
|
-
|
|
2071
|
+
message_effect_id: str | None = None,
|
|
2072
|
+
message_thread_id: int | None = None,
|
|
2112
2073
|
protect_content: bool | None = None,
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
| ReplyKeyboardMarkup
|
|
2116
|
-
| ReplyKeyboardRemove
|
|
2117
|
-
| ForceReply
|
|
2118
|
-
| None = None,
|
|
2074
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
2075
|
+
reply_parameters: ReplyParameters | None = None,
|
|
2119
2076
|
**other: typing.Any,
|
|
2120
2077
|
) -> Result[MessageCute, APIError]:
|
|
2121
2078
|
"""Shortcut `API.send_venue()`, see the [documentation](https://core.telegram.org/bots/api#sendvenue)
|
|
@@ -2147,34 +2104,33 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2147
2104
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
2148
2105
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
2149
2106
|
|
|
2107
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
2108
|
+
|
|
2150
2109
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
2151
2110
|
|
|
2152
2111
|
:param reply_parameters: Description of the message to reply to.
|
|
2153
2112
|
|
|
2154
2113
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
2155
|
-
|
|
2156
2114
|
...
|
|
2157
2115
|
|
|
2158
2116
|
@shortcut(
|
|
2159
2117
|
"send_dice",
|
|
2160
2118
|
executor=execute_method_reply,
|
|
2161
|
-
custom_params={"
|
|
2119
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
2162
2120
|
)
|
|
2163
2121
|
async def reply_dice(
|
|
2164
2122
|
self,
|
|
2165
2123
|
emoji: DiceEmoji | None = None,
|
|
2166
|
-
|
|
2124
|
+
*,
|
|
2125
|
+
allow_paid_broadcast: bool | None = None,
|
|
2167
2126
|
business_connection_id: str | None = None,
|
|
2168
|
-
|
|
2169
|
-
message_effect_id: str | None = None,
|
|
2127
|
+
chat_id: int | str | None = None,
|
|
2170
2128
|
disable_notification: bool | None = None,
|
|
2129
|
+
message_effect_id: str | None = None,
|
|
2130
|
+
message_thread_id: int | None = None,
|
|
2171
2131
|
protect_content: bool | None = None,
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
| ReplyKeyboardMarkup
|
|
2175
|
-
| ReplyKeyboardRemove
|
|
2176
|
-
| ForceReply
|
|
2177
|
-
| None = None,
|
|
2132
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
2133
|
+
reply_parameters: ReplyParameters | None = None,
|
|
2178
2134
|
**other: typing.Any,
|
|
2179
2135
|
) -> Result[MessageCute, APIError]:
|
|
2180
2136
|
"""Shortcut `API.send_dice()`, see the [documentation](https://core.telegram.org/bots/api#senddice)
|
|
@@ -2191,30 +2147,33 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2191
2147
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
2192
2148
|
:param protect_content: Protects the contents of the sent message from forwarding.
|
|
2193
2149
|
|
|
2150
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
2151
|
+
|
|
2194
2152
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
2195
2153
|
|
|
2196
2154
|
:param reply_parameters: Description of the message to reply to.
|
|
2197
2155
|
|
|
2198
2156
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
2199
|
-
|
|
2200
2157
|
...
|
|
2201
2158
|
|
|
2202
2159
|
@shortcut(
|
|
2203
2160
|
"send_game",
|
|
2204
2161
|
executor=execute_method_reply,
|
|
2205
|
-
custom_params={"
|
|
2162
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
2206
2163
|
)
|
|
2207
2164
|
async def reply_game(
|
|
2208
2165
|
self,
|
|
2209
2166
|
game_short_name: str,
|
|
2210
|
-
|
|
2167
|
+
*,
|
|
2168
|
+
allow_paid_broadcast: bool | None = None,
|
|
2211
2169
|
business_connection_id: str | None = None,
|
|
2212
|
-
|
|
2213
|
-
message_effect_id: str | None = None,
|
|
2170
|
+
chat_id: int | str | None = None,
|
|
2214
2171
|
disable_notification: bool | None = None,
|
|
2172
|
+
message_effect_id: str | None = None,
|
|
2173
|
+
message_thread_id: int | None = None,
|
|
2215
2174
|
protect_content: bool | None = None,
|
|
2216
|
-
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2217
2175
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2176
|
+
reply_parameters: ReplyParameters | None = None,
|
|
2218
2177
|
**other: typing.Any,
|
|
2219
2178
|
) -> Result[MessageCute, APIError]:
|
|
2220
2179
|
"""Shortcut `API.send_game()`, see the [documentation](https://core.telegram.org/bots/api#sendgame)
|
|
@@ -2231,83 +2190,80 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2231
2190
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
2232
2191
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
2233
2192
|
|
|
2193
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
2194
|
+
|
|
2234
2195
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
2235
2196
|
|
|
2236
2197
|
:param reply_parameters: Description of the message to reply to.
|
|
2237
2198
|
|
|
2238
2199
|
:param reply_markup: A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title'button will be shown. If not empty, the first button must launch the game."""
|
|
2239
|
-
|
|
2240
2200
|
...
|
|
2241
2201
|
|
|
2242
2202
|
@shortcut(
|
|
2243
2203
|
"send_invoice",
|
|
2244
2204
|
executor=execute_method_reply,
|
|
2245
|
-
custom_params={"
|
|
2205
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
2246
2206
|
)
|
|
2247
2207
|
async def reply_invoice(
|
|
2248
2208
|
self,
|
|
2249
|
-
|
|
2209
|
+
*,
|
|
2210
|
+
currency: Currency,
|
|
2250
2211
|
description: str,
|
|
2251
2212
|
payload: str,
|
|
2252
|
-
currency: str,
|
|
2253
2213
|
prices: list[LabeledPrice],
|
|
2254
|
-
|
|
2214
|
+
title: str,
|
|
2215
|
+
allow_paid_broadcast: bool | None = None,
|
|
2255
2216
|
business_connection_id: str | None = None,
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2217
|
+
chat_id: int | str | None = None,
|
|
2218
|
+
disable_notification: bool | None = None,
|
|
2219
|
+
is_flexible: bool | None = None,
|
|
2259
2220
|
max_tip_amount: int | None = None,
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
photo_url: str | None = None,
|
|
2264
|
-
photo_size: int | None = None,
|
|
2265
|
-
photo_width: int | None = None,
|
|
2266
|
-
photo_height: int | None = None,
|
|
2221
|
+
message_effect_id: str | None = None,
|
|
2222
|
+
message_thread_id: int | None = None,
|
|
2223
|
+
need_email: bool | None = None,
|
|
2267
2224
|
need_name: bool | None = None,
|
|
2268
2225
|
need_phone_number: bool | None = None,
|
|
2269
|
-
need_email: bool | None = None,
|
|
2270
2226
|
need_shipping_address: bool | None = None,
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2227
|
+
photo_height: int | None = None,
|
|
2228
|
+
photo_size: int | None = None,
|
|
2229
|
+
photo_url: str | None = None,
|
|
2230
|
+
photo_width: int | None = None,
|
|
2275
2231
|
protect_content: bool | None = None,
|
|
2276
|
-
|
|
2232
|
+
provider_data: str | None = None,
|
|
2233
|
+
provider_token: str | None = None,
|
|
2277
2234
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2235
|
+
reply_parameters: ReplyParameters | None = None,
|
|
2236
|
+
send_email_to_provider: bool | None = None,
|
|
2237
|
+
send_phone_number_to_provider: bool | None = None,
|
|
2238
|
+
start_parameter: str | None = None,
|
|
2239
|
+
suggested_tip_amounts: list[int] | None = None,
|
|
2278
2240
|
**other: typing.Any,
|
|
2279
2241
|
) -> Result[MessageCute, APIError]:
|
|
2280
2242
|
"""Shortcut `API.send_invoice()`, see the [documentation](https://core.telegram.org/bots/api#sendinvoice)
|
|
2281
2243
|
|
|
2282
2244
|
Use this method to send invoices. On success, the sent Message is returned."""
|
|
2283
|
-
|
|
2284
2245
|
...
|
|
2285
2246
|
|
|
2286
2247
|
@shortcut(
|
|
2287
2248
|
"send_media_group",
|
|
2288
2249
|
custom_params={
|
|
2289
2250
|
"media",
|
|
2290
|
-
"reply_parameters",
|
|
2291
2251
|
"chat_id",
|
|
2292
2252
|
"message_thread_id",
|
|
2293
|
-
"caption",
|
|
2294
|
-
"caption_entities",
|
|
2295
|
-
"parse_mode",
|
|
2296
2253
|
},
|
|
2297
2254
|
)
|
|
2298
2255
|
async def reply_media_group(
|
|
2299
2256
|
self,
|
|
2300
|
-
media:
|
|
2301
|
-
|
|
2257
|
+
media: InputMedia | list[InputMedia],
|
|
2258
|
+
*,
|
|
2259
|
+
allow_paid_broadcast: bool | None = None,
|
|
2302
2260
|
business_connection_id: str | None = None,
|
|
2303
|
-
|
|
2304
|
-
message_effect_id: str | None = None,
|
|
2305
|
-
caption: str | list[str] | None = None,
|
|
2306
|
-
parse_mode: str | list[str] | None = None,
|
|
2307
|
-
caption_entities: list[MessageEntity] | None = None,
|
|
2261
|
+
chat_id: int | str | None = None,
|
|
2308
2262
|
disable_notification: bool | None = None,
|
|
2263
|
+
message_effect_id: str | None = None,
|
|
2264
|
+
message_thread_id: int | None = None,
|
|
2309
2265
|
protect_content: bool | None = None,
|
|
2310
|
-
reply_parameters: ReplyParameters |
|
|
2266
|
+
reply_parameters: ReplyParameters | None = None,
|
|
2311
2267
|
**other: typing.Any,
|
|
2312
2268
|
) -> Result[list[MessageCute], APIError]:
|
|
2313
2269
|
"""Shortcut `API.send_media_group()`, see the [documentation](https://core.telegram.org/bots/api#sendmediagroup)
|
|
@@ -2325,39 +2281,38 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2325
2281
|
|
|
2326
2282
|
:param disable_notification: Sends messages silently. Users will receive a notification with no sound.
|
|
2327
2283
|
:param protect_content: Protects the contents of the sent messages from forwarding and saving.
|
|
2284
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
2285
|
+
|
|
2328
2286
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
2329
2287
|
|
|
2330
2288
|
:param reply_parameters: Description of the message to reply to."""
|
|
2331
|
-
|
|
2332
2289
|
params = get_params(locals())
|
|
2333
|
-
params.setdefault("reply_parameters",
|
|
2290
|
+
params.setdefault("reply_parameters", ReplyParameters(self.message_id))
|
|
2334
2291
|
return await self.answer_media_group(**params)
|
|
2335
2292
|
|
|
2336
2293
|
@shortcut(
|
|
2337
2294
|
"send_location",
|
|
2338
2295
|
executor=execute_method_reply,
|
|
2339
|
-
custom_params={"
|
|
2296
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
2340
2297
|
)
|
|
2341
2298
|
async def reply_location(
|
|
2342
2299
|
self,
|
|
2300
|
+
*,
|
|
2343
2301
|
latitude: float,
|
|
2344
2302
|
longitude: float,
|
|
2345
|
-
|
|
2346
|
-
message_thread_id: int | None = None,
|
|
2303
|
+
allow_paid_broadcast: bool | None = None,
|
|
2347
2304
|
business_connection_id: str | None = None,
|
|
2348
|
-
|
|
2349
|
-
|
|
2305
|
+
chat_id: int | str | None = None,
|
|
2306
|
+
disable_notification: bool | None = None,
|
|
2350
2307
|
heading: int | None = None,
|
|
2308
|
+
horizontal_accuracy: float | None = None,
|
|
2351
2309
|
live_period: int | None = None,
|
|
2352
|
-
|
|
2353
|
-
|
|
2310
|
+
message_effect_id: str | None = None,
|
|
2311
|
+
message_thread_id: int | None = None,
|
|
2354
2312
|
protect_content: bool | None = None,
|
|
2355
|
-
|
|
2356
|
-
reply_markup: InlineKeyboardMarkup
|
|
2357
|
-
|
|
|
2358
|
-
| ReplyKeyboardRemove
|
|
2359
|
-
| ForceReply
|
|
2360
|
-
| None = None,
|
|
2313
|
+
proximity_alert_radius: int | None = None,
|
|
2314
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
2315
|
+
reply_parameters: ReplyParameters | None = None,
|
|
2361
2316
|
**other: typing.Any,
|
|
2362
2317
|
) -> Result[MessageCute, APIError]:
|
|
2363
2318
|
"""Shortcut `API.send_location()`, see the [documentation](https://core.telegram.org/bots/api#sendlocation)
|
|
@@ -2382,37 +2337,36 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2382
2337
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
2383
2338
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
2384
2339
|
|
|
2340
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
2341
|
+
|
|
2385
2342
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
2386
2343
|
|
|
2387
2344
|
:param reply_parameters: Description of the message to reply to.
|
|
2388
2345
|
|
|
2389
2346
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
2390
|
-
|
|
2391
2347
|
...
|
|
2392
2348
|
|
|
2393
2349
|
@shortcut(
|
|
2394
2350
|
"send_contact",
|
|
2395
2351
|
executor=execute_method_reply,
|
|
2396
|
-
custom_params={"
|
|
2352
|
+
custom_params={"message_thread_id", "chat_id"},
|
|
2397
2353
|
)
|
|
2398
2354
|
async def reply_contact(
|
|
2399
2355
|
self,
|
|
2400
|
-
|
|
2356
|
+
*,
|
|
2401
2357
|
first_name: str,
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
chat_id: int | str | None = None,
|
|
2358
|
+
phone_number: str,
|
|
2359
|
+
allow_paid_broadcast: bool | None = None,
|
|
2405
2360
|
business_connection_id: str | None = None,
|
|
2406
|
-
|
|
2407
|
-
message_effect_id: str | None = None,
|
|
2361
|
+
chat_id: int | str | None = None,
|
|
2408
2362
|
disable_notification: bool | None = None,
|
|
2363
|
+
last_name: str | None = None,
|
|
2364
|
+
message_effect_id: str | None = None,
|
|
2365
|
+
message_thread_id: int | None = None,
|
|
2409
2366
|
protect_content: bool | None = None,
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
|
2413
|
-
| ReplyKeyboardRemove
|
|
2414
|
-
| ForceReply
|
|
2415
|
-
| None = None,
|
|
2367
|
+
reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | None = None,
|
|
2368
|
+
reply_parameters: ReplyParameters | None = None,
|
|
2369
|
+
vcard: str | None = None,
|
|
2416
2370
|
**other: typing.Any,
|
|
2417
2371
|
) -> Result[MessageCute, APIError]:
|
|
2418
2372
|
"""Shortcut `API.send_contact()`, see the [documentation](https://core.telegram.org/bots/api#sendcontact)
|
|
@@ -2435,12 +2389,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2435
2389
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound.
|
|
2436
2390
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
2437
2391
|
|
|
2392
|
+
:param allow_paid_broadcast: Pass True to allow up to 1000 messages per second, ignoring broadcastinglimits for a fee of 0.1 Telegram Stars per message. The relevant Stars willbe withdrawn from the bot's balance.
|
|
2393
|
+
|
|
2438
2394
|
:param message_effect_id: Unique identifier of the message effect to be added to the message; for privatechats only.
|
|
2439
2395
|
|
|
2440
2396
|
:param reply_parameters: Description of the message to reply to.
|
|
2441
2397
|
|
|
2442
2398
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inlinekeyboard, custom reply keyboard, instructions to remove a reply keyboardor to force a reply from the user."""
|
|
2443
|
-
|
|
2444
2399
|
...
|
|
2445
2400
|
|
|
2446
2401
|
@shortcut(
|
|
@@ -2450,18 +2405,18 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2450
2405
|
)
|
|
2451
2406
|
async def edit_live_location(
|
|
2452
2407
|
self,
|
|
2453
|
-
|
|
2408
|
+
*,
|
|
2454
2409
|
longitude: float,
|
|
2410
|
+
business_connection_id: str | None = None,
|
|
2455
2411
|
chat_id: int | str | None = None,
|
|
2456
|
-
|
|
2457
|
-
|
|
2412
|
+
heading: int | None = None,
|
|
2413
|
+
horizontal_accuracy: float | None = None,
|
|
2458
2414
|
inline_message_id: str | None = None,
|
|
2459
2415
|
live_period: int | None = None,
|
|
2460
|
-
|
|
2461
|
-
|
|
2416
|
+
message_id: int | None = None,
|
|
2417
|
+
message_thread_id: int | None = None,
|
|
2462
2418
|
proximity_alert_radius: int | None = None,
|
|
2463
2419
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2464
|
-
business_connection_id: str | None = None,
|
|
2465
2420
|
**other: typing.Any,
|
|
2466
2421
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2467
2422
|
"""Shortcut `API.edit_message_live_location()`, see the [documentation](https://core.telegram.org/bots/api#editmessagelivelocation)
|
|
@@ -2489,7 +2444,6 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2489
2444
|
:param proximity_alert_radius: The maximum distance for proximity alerts about approaching another chatmember, in meters. Must be between 1 and 100000 if specified.
|
|
2490
2445
|
|
|
2491
2446
|
:param reply_markup: A JSON-serialized object for a new inline keyboard."""
|
|
2492
|
-
|
|
2493
2447
|
...
|
|
2494
2448
|
|
|
2495
2449
|
@shortcut(
|
|
@@ -2500,15 +2454,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2500
2454
|
async def edit_caption(
|
|
2501
2455
|
self,
|
|
2502
2456
|
caption: str | None = None,
|
|
2457
|
+
*,
|
|
2458
|
+
business_connection_id: str | None = None,
|
|
2459
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
2503
2460
|
chat_id: int | str | None = None,
|
|
2461
|
+
inline_message_id: str | None = None,
|
|
2504
2462
|
message_id: int | None = None,
|
|
2505
2463
|
message_thread_id: int | None = None,
|
|
2506
2464
|
parse_mode: str | None = None,
|
|
2507
|
-
caption_entities: list[MessageEntity] | None = None,
|
|
2508
|
-
show_caption_above_media: bool | None = None,
|
|
2509
2465
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2510
|
-
|
|
2511
|
-
inline_message_id: str | None = None,
|
|
2466
|
+
show_caption_above_media: bool | None = None,
|
|
2512
2467
|
**other: typing.Any,
|
|
2513
2468
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2514
2469
|
"""Shortcut `API.edit_message_caption()`, see the [documentation](https://core.telegram.org/bots/api#editmessagecaption)
|
|
@@ -2533,7 +2488,6 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2533
2488
|
:param show_caption_above_media: Pass True, if the caption must be shown above the message media. Supportedonly for animation, photo and video messages.
|
|
2534
2489
|
|
|
2535
2490
|
:param reply_markup: A JSON-serialized object for an inline keyboard."""
|
|
2536
|
-
|
|
2537
2491
|
...
|
|
2538
2492
|
|
|
2539
2493
|
@shortcut(
|
|
@@ -2552,29 +2506,30 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2552
2506
|
async def edit_media(
|
|
2553
2507
|
self,
|
|
2554
2508
|
media: InputFile | InputMedia | str,
|
|
2555
|
-
|
|
2509
|
+
*,
|
|
2510
|
+
business_connection_id: str | None = None,
|
|
2556
2511
|
caption: str | None = None,
|
|
2557
|
-
parse_mode: str | None = None,
|
|
2558
2512
|
caption_entities: list[MessageEntity] | None = None,
|
|
2559
2513
|
chat_id: int | str | None = None,
|
|
2514
|
+
inline_message_id: str | None = None,
|
|
2560
2515
|
message_id: int | None = None,
|
|
2561
2516
|
message_thread_id: int | None = None,
|
|
2517
|
+
parse_mode: str | None = None,
|
|
2562
2518
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2563
|
-
|
|
2564
|
-
inline_message_id: str | None = None,
|
|
2519
|
+
type: MediaType | None = None,
|
|
2565
2520
|
**other: typing.Any,
|
|
2566
2521
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2567
2522
|
"""Shortcut `API.edit_message_media()`, see the [documentation](https://core.telegram.org/bots/api#editmessagemedia)
|
|
2568
2523
|
|
|
2569
|
-
Use this method to edit animation, audio, document, photo, or video messages
|
|
2570
|
-
If a message is part of a message album, then
|
|
2571
|
-
|
|
2572
|
-
a video otherwise. When an inline message is edited,
|
|
2573
|
-
use a previously uploaded file via its file_id
|
|
2574
|
-
if the edited message is not an inline message,
|
|
2575
|
-
otherwise True is returned. Note that business
|
|
2576
|
-
by the bot and do not contain an inline keyboard
|
|
2577
|
-
48 hours from the time they were sent.
|
|
2524
|
+
Use this method to edit animation, audio, document, photo, or video messages,
|
|
2525
|
+
or to add media to text messages. If a message is part of a message album, then
|
|
2526
|
+
it can be edited only to an audio for audio albums, only to a document for document
|
|
2527
|
+
albums and to a photo or a video otherwise. When an inline message is edited,
|
|
2528
|
+
a new file can't be uploaded; use a previously uploaded file via its file_id
|
|
2529
|
+
or specify a URL. On success, if the edited message is not an inline message,
|
|
2530
|
+
the edited Message is returned, otherwise True is returned. Note that business
|
|
2531
|
+
messages that were not sent by the bot and do not contain an inline keyboard
|
|
2532
|
+
can only be edited within 48 hours from the time they were sent.
|
|
2578
2533
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the messageto be edited was sent.
|
|
2579
2534
|
|
|
2580
2535
|
:param chat_id: Required if inline_message_id is not specified. Unique identifier forthe target chat or username of the target channel (in the format @channelusername).
|
|
@@ -2585,11 +2540,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2585
2540
|
:param media: A JSON-serialized object for a new media content of the message.
|
|
2586
2541
|
|
|
2587
2542
|
:param reply_markup: A JSON-serialized object for a new inline keyboard."""
|
|
2588
|
-
|
|
2589
2543
|
params = get_params(locals())
|
|
2590
|
-
|
|
2591
2544
|
if not isinstance(media, InputMedia):
|
|
2592
|
-
assert type, "
|
|
2545
|
+
assert type, "Parameter 'type' is required, because 'media' is a file id or an 'InputFile' object."
|
|
2593
2546
|
params["media"] = input_media(
|
|
2594
2547
|
params.pop("type"),
|
|
2595
2548
|
media,
|
|
@@ -2607,12 +2560,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2607
2560
|
)
|
|
2608
2561
|
async def edit_reply_markup(
|
|
2609
2562
|
self,
|
|
2563
|
+
*,
|
|
2564
|
+
business_connection_id: str | None = None,
|
|
2610
2565
|
chat_id: int | str | None = None,
|
|
2566
|
+
inline_message_id: str | None = None,
|
|
2611
2567
|
message_id: int | None = None,
|
|
2612
2568
|
message_thread_id: int | None = None,
|
|
2613
2569
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2614
|
-
business_connection_id: str | None = None,
|
|
2615
|
-
inline_message_id: str | None = None,
|
|
2616
2570
|
**other: typing.Any,
|
|
2617
2571
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2618
2572
|
"""Shortcut `API.edit_message_reply_markup()`, see the [documentation](https://core.telegram.org/bots/api#editmessagereplymarkup)
|
|
@@ -2630,7 +2584,6 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2630
2584
|
:param inline_message_id: Required if chat_id and message_id are not specified. Identifier of theinline message.
|
|
2631
2585
|
|
|
2632
2586
|
:param reply_markup: A JSON-serialized object for an inline keyboard."""
|
|
2633
|
-
|
|
2634
2587
|
...
|
|
2635
2588
|
|
|
2636
2589
|
|