telegrinder 0.1.dev159__py3-none-any.whl → 0.1.dev161__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 +4 -2
- telegrinder/api/__init__.py +0 -0
- telegrinder/api/abc.py +5 -0
- telegrinder/api/api.py +4 -4
- telegrinder/api/error.py +0 -0
- telegrinder/api/response.py +0 -0
- telegrinder/bot/__init__.py +0 -0
- telegrinder/bot/bot.py +0 -0
- telegrinder/bot/cute_types/__init__.py +0 -0
- telegrinder/bot/cute_types/base.py +0 -0
- telegrinder/bot/cute_types/callback_query.py +81 -85
- telegrinder/bot/cute_types/inline_query.py +36 -9
- telegrinder/bot/cute_types/message.py +524 -568
- telegrinder/bot/cute_types/update.py +0 -0
- telegrinder/bot/cute_types/utils.py +201 -453
- telegrinder/bot/dispatch/__init__.py +0 -0
- telegrinder/bot/dispatch/abc.py +0 -0
- telegrinder/bot/dispatch/composition.py +0 -0
- telegrinder/bot/dispatch/context.py +0 -0
- telegrinder/bot/dispatch/dispatch.py +0 -0
- telegrinder/bot/dispatch/handler/__init__.py +0 -0
- telegrinder/bot/dispatch/handler/abc.py +0 -0
- telegrinder/bot/dispatch/handler/func.py +1 -1
- telegrinder/bot/dispatch/handler/message_reply.py +0 -0
- telegrinder/bot/dispatch/middleware/__init__.py +0 -0
- telegrinder/bot/dispatch/middleware/abc.py +0 -0
- telegrinder/bot/dispatch/process.py +0 -0
- telegrinder/bot/dispatch/return_manager/__init__.py +0 -0
- telegrinder/bot/dispatch/return_manager/abc.py +0 -0
- telegrinder/bot/dispatch/return_manager/callback_query.py +0 -0
- telegrinder/bot/dispatch/return_manager/inline_query.py +0 -0
- telegrinder/bot/dispatch/return_manager/message.py +0 -0
- telegrinder/bot/dispatch/view/__init__.py +0 -0
- telegrinder/bot/dispatch/view/abc.py +20 -16
- telegrinder/bot/dispatch/view/box.py +0 -0
- telegrinder/bot/dispatch/view/callback_query.py +0 -0
- telegrinder/bot/dispatch/view/inline_query.py +0 -0
- telegrinder/bot/dispatch/view/message.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/__init__.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/machine.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/middleware.py +0 -0
- telegrinder/bot/dispatch/waiter_machine/short_state.py +0 -0
- telegrinder/bot/polling/__init__.py +0 -0
- telegrinder/bot/polling/abc.py +0 -0
- telegrinder/bot/polling/polling.py +7 -11
- telegrinder/bot/rules/__init__.py +0 -0
- telegrinder/bot/rules/abc.py +1 -1
- telegrinder/bot/rules/adapter/__init__.py +0 -0
- telegrinder/bot/rules/adapter/abc.py +0 -0
- telegrinder/bot/rules/adapter/errors.py +0 -0
- telegrinder/bot/rules/adapter/event.py +0 -0
- telegrinder/bot/rules/adapter/raw_update.py +0 -0
- telegrinder/bot/rules/callback_data.py +3 -11
- telegrinder/bot/rules/command.py +0 -0
- telegrinder/bot/rules/enum_text.py +0 -0
- telegrinder/bot/rules/func.py +0 -0
- telegrinder/bot/rules/fuzzy.py +0 -0
- telegrinder/bot/rules/inline.py +2 -1
- telegrinder/bot/rules/integer.py +0 -0
- telegrinder/bot/rules/is_from.py +0 -0
- telegrinder/bot/rules/markup.py +3 -1
- telegrinder/bot/rules/mention.py +0 -0
- telegrinder/bot/rules/message_entities.py +3 -1
- telegrinder/bot/rules/regex.py +1 -1
- telegrinder/bot/rules/rule_enum.py +0 -0
- telegrinder/bot/rules/start.py +0 -0
- telegrinder/bot/rules/text.py +0 -0
- telegrinder/bot/scenario/__init__.py +2 -2
- telegrinder/bot/scenario/abc.py +0 -0
- telegrinder/bot/scenario/checkbox.py +9 -13
- telegrinder/bot/scenario/choice.py +2 -2
- telegrinder/client/__init__.py +0 -0
- telegrinder/client/abc.py +0 -0
- telegrinder/client/aiohttp.py +0 -0
- telegrinder/model.py +35 -36
- telegrinder/modules.py +21 -11
- telegrinder/msgspec_json.py +0 -0
- telegrinder/msgspec_utils.py +2 -2
- telegrinder/node/__init__.py +0 -0
- telegrinder/node/attachment.py +0 -0
- telegrinder/node/base.py +0 -0
- telegrinder/node/composer.py +0 -0
- telegrinder/node/container.py +0 -0
- telegrinder/node/message.py +0 -0
- telegrinder/node/rule.py +0 -0
- telegrinder/node/source.py +0 -0
- telegrinder/node/text.py +0 -0
- telegrinder/node/tools/__init__.py +0 -0
- telegrinder/node/tools/generator.py +0 -0
- telegrinder/node/update.py +0 -0
- telegrinder/rules.py +0 -0
- telegrinder/tools/__init__.py +2 -3
- telegrinder/tools/buttons.py +0 -0
- telegrinder/tools/error_handler/__init__.py +2 -0
- telegrinder/tools/error_handler/abc.py +5 -1
- telegrinder/tools/error_handler/error.py +10 -0
- telegrinder/tools/error_handler/error_handler.py +100 -81
- telegrinder/tools/formatting/__init__.py +0 -0
- telegrinder/tools/formatting/html.py +0 -0
- telegrinder/tools/formatting/links.py +0 -0
- telegrinder/tools/formatting/spec_html_formats.py +0 -0
- telegrinder/tools/global_context/__init__.py +0 -0
- telegrinder/tools/global_context/abc.py +0 -0
- telegrinder/tools/global_context/global_context.py +65 -67
- telegrinder/tools/global_context/telegrinder_ctx.py +0 -0
- telegrinder/tools/i18n/__init__.py +0 -0
- telegrinder/tools/i18n/base.py +0 -0
- telegrinder/tools/i18n/middleware/__init__.py +0 -0
- telegrinder/tools/i18n/middleware/base.py +0 -0
- telegrinder/tools/i18n/simple.py +0 -0
- telegrinder/tools/kb_set/__init__.py +0 -0
- telegrinder/tools/kb_set/base.py +0 -0
- telegrinder/tools/kb_set/yaml.py +3 -3
- telegrinder/tools/keyboard.py +17 -26
- telegrinder/tools/loop_wrapper/__init__.py +0 -0
- telegrinder/tools/loop_wrapper/abc.py +0 -0
- telegrinder/tools/loop_wrapper/loop_wrapper.py +0 -0
- telegrinder/tools/magic.py +1 -1
- telegrinder/tools/parse_mode.py +0 -0
- telegrinder/types/__init__.py +0 -0
- telegrinder/types/enums.py +2 -0
- telegrinder/types/methods.py +477 -526
- telegrinder/types/objects.py +209 -97
- {telegrinder-0.1.dev159.dist-info → telegrinder-0.1.dev161.dist-info}/LICENSE +0 -0
- {telegrinder-0.1.dev159.dist-info → telegrinder-0.1.dev161.dist-info}/METADATA +9 -8
- {telegrinder-0.1.dev159.dist-info → telegrinder-0.1.dev161.dist-info}/RECORD +38 -37
- {telegrinder-0.1.dev159.dist-info → telegrinder-0.1.dev161.dist-info}/WHEEL +1 -1
|
@@ -77,14 +77,21 @@ async def execute_method_answer(
|
|
|
77
77
|
params["reply_parameters"] = compose_reply_params(**reply_parameters)
|
|
78
78
|
|
|
79
79
|
if link_preview_options is not None and isinstance(link_preview_options, dict):
|
|
80
|
-
params["link_preview_options"] = compose_link_preview_options(
|
|
81
|
-
|
|
80
|
+
params["link_preview_options"] = compose_link_preview_options(
|
|
81
|
+
**link_preview_options
|
|
82
|
+
)
|
|
83
|
+
|
|
82
84
|
result = await getattr(message.ctx_api, method_name)(**params)
|
|
83
85
|
return result.map(
|
|
84
|
-
lambda x:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
lambda x: (
|
|
87
|
+
x
|
|
88
|
+
if isinstance(x, bool)
|
|
89
|
+
else (
|
|
90
|
+
MessageCute.from_update(x, bound_api=message.api)
|
|
91
|
+
if not isinstance(x, list)
|
|
92
|
+
else [MessageCute.from_update(m, bound_api=message.api) for m in x]
|
|
93
|
+
)
|
|
94
|
+
)
|
|
88
95
|
)
|
|
89
96
|
|
|
90
97
|
|
|
@@ -93,7 +100,7 @@ async def execute_method_reply(
|
|
|
93
100
|
method_name: str,
|
|
94
101
|
params: dict[str, typing.Any],
|
|
95
102
|
) -> Result[typing.Any, APIError]:
|
|
96
|
-
params.setdefault("
|
|
103
|
+
params.setdefault("reply_parameters", {})
|
|
97
104
|
return await execute_method_answer(message, method_name, params)
|
|
98
105
|
|
|
99
106
|
|
|
@@ -105,12 +112,19 @@ async def execute_method_edit(
|
|
|
105
112
|
params = compose_method_params(
|
|
106
113
|
params=params,
|
|
107
114
|
update=update,
|
|
108
|
-
default_params={
|
|
115
|
+
default_params={
|
|
116
|
+
"chat_id",
|
|
117
|
+
"message_id",
|
|
118
|
+
"message_thread_id",
|
|
119
|
+
"inline_message_id",
|
|
120
|
+
},
|
|
109
121
|
validators={
|
|
110
122
|
"inline_message_id": lambda x: not x.message_id,
|
|
111
|
-
"message_thread_id": lambda x:
|
|
112
|
-
|
|
113
|
-
x
|
|
123
|
+
"message_thread_id": lambda x: (
|
|
124
|
+
x.is_topic_message.unwrap_or(False)
|
|
125
|
+
if isinstance(x, MessageCute)
|
|
126
|
+
else bool(x.message)
|
|
127
|
+
and getattr(x.message.unwrap().v, "is_topic_message", False)
|
|
114
128
|
),
|
|
115
129
|
},
|
|
116
130
|
)
|
|
@@ -120,9 +134,11 @@ async def execute_method_edit(
|
|
|
120
134
|
result = await getattr(update.ctx_api, method_name)(**params)
|
|
121
135
|
return result.map(
|
|
122
136
|
lambda v: Variative[MessageCute, bool](
|
|
123
|
-
v.only()
|
|
137
|
+
v.only()
|
|
138
|
+
.map(
|
|
124
139
|
lambda x: MessageCute.from_update(x, bound_api=update.api),
|
|
125
|
-
)
|
|
140
|
+
)
|
|
141
|
+
.unwrap_or(typing.cast(bool, v.v))
|
|
126
142
|
)
|
|
127
143
|
)
|
|
128
144
|
|
|
@@ -175,20 +191,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
175
191
|
)
|
|
176
192
|
async def answer(
|
|
177
193
|
self,
|
|
178
|
-
text: str |
|
|
179
|
-
chat_id: int | str |
|
|
180
|
-
message_thread_id: int |
|
|
181
|
-
parse_mode: str |
|
|
182
|
-
entities: list[MessageEntity] |
|
|
183
|
-
disable_notification: bool |
|
|
184
|
-
protect_content: bool |
|
|
185
|
-
link_preview_options:
|
|
186
|
-
|
|
|
187
|
-
|
|
|
188
|
-
reply_parameters: Option[ReplyParameters | dict[str, typing.Any]]
|
|
189
|
-
| ReplyParameters
|
|
190
|
-
| dict[str, typing.Any] = Nothing,
|
|
191
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
194
|
+
text: str | None = None,
|
|
195
|
+
chat_id: int | str | None = None,
|
|
196
|
+
message_thread_id: int | None = None,
|
|
197
|
+
parse_mode: str | None = None,
|
|
198
|
+
entities: list[MessageEntity] | None = None,
|
|
199
|
+
disable_notification: bool | None = None,
|
|
200
|
+
protect_content: bool | None = None,
|
|
201
|
+
link_preview_options: LinkPreviewOptions | dict[str, typing.Any] | None = None,
|
|
202
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
203
|
+
reply_markup: ReplyMarkup | None = None,
|
|
192
204
|
**other: typing.Any,
|
|
193
205
|
) -> Result[MessageCute, APIError]:
|
|
194
206
|
"""Shortcut `API.send_message()`, see the [documentation](https://core.telegram.org/bots/api#sendmessage)
|
|
@@ -230,21 +242,17 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
230
242
|
)
|
|
231
243
|
async def reply(
|
|
232
244
|
self,
|
|
233
|
-
text: str |
|
|
234
|
-
chat_id: int | str |
|
|
235
|
-
message_id: int |
|
|
236
|
-
message_thread_id: int |
|
|
237
|
-
parse_mode: str |
|
|
238
|
-
entities: list[MessageEntity] |
|
|
239
|
-
disable_notification: bool |
|
|
240
|
-
protect_content: bool |
|
|
241
|
-
link_preview_options:
|
|
242
|
-
|
|
|
243
|
-
|
|
|
244
|
-
reply_parameters: Option[ReplyParameters | dict[str, typing.Any]]
|
|
245
|
-
| ReplyParameters
|
|
246
|
-
| dict[str, typing.Any] = Nothing,
|
|
247
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
245
|
+
text: str | None = None,
|
|
246
|
+
chat_id: int | str | None = None,
|
|
247
|
+
message_id: int | None = None,
|
|
248
|
+
message_thread_id: int | None = None,
|
|
249
|
+
parse_mode: str | None = None,
|
|
250
|
+
entities: list[MessageEntity] | None = None,
|
|
251
|
+
disable_notification: bool | None = None,
|
|
252
|
+
protect_content: bool | None = None,
|
|
253
|
+
link_preview_options: LinkPreviewOptions | dict[str, typing.Any] | None = None,
|
|
254
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
255
|
+
reply_markup: ReplyMarkup | None = None,
|
|
248
256
|
**other: typing.Any,
|
|
249
257
|
) -> Result[MessageCute, APIError]:
|
|
250
258
|
"""Shortcut `API.send_message()`, see the [documentation](https://core.telegram.org/bots/api#sendmessage)
|
|
@@ -282,9 +290,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
282
290
|
@shortcut("delete_message", custom_params={"message_thread_id"})
|
|
283
291
|
async def delete(
|
|
284
292
|
self,
|
|
285
|
-
chat_id: int |
|
|
286
|
-
message_id: int |
|
|
287
|
-
message_thread_id: int |
|
|
293
|
+
chat_id: int | None = None,
|
|
294
|
+
message_id: int | None = None,
|
|
295
|
+
message_thread_id: int | None = None,
|
|
288
296
|
**other: typing.Any,
|
|
289
297
|
) -> Result[bool, APIError]:
|
|
290
298
|
"""Shortcut `API.delete_message()`, see the [documentation](https://core.telegram.org/bots/api#deletemessage)
|
|
@@ -313,7 +321,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
313
321
|
params=get_params(locals()),
|
|
314
322
|
update=self,
|
|
315
323
|
default_params={"chat_id", "message_id", "message_thread_id"},
|
|
316
|
-
validators={
|
|
324
|
+
validators={
|
|
325
|
+
"message_thread_id": lambda x: x.is_topic_message.unwrap_or(False)
|
|
326
|
+
},
|
|
317
327
|
)
|
|
318
328
|
return await self.ctx_api.delete_message(**params)
|
|
319
329
|
|
|
@@ -324,16 +334,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
324
334
|
)
|
|
325
335
|
async def edit(
|
|
326
336
|
self,
|
|
327
|
-
text: str |
|
|
328
|
-
chat_id: int |
|
|
329
|
-
message_id: int |
|
|
330
|
-
message_thread_id: int |
|
|
331
|
-
parse_mode: str |
|
|
332
|
-
entities: list[MessageEntity] |
|
|
333
|
-
link_preview_options:
|
|
334
|
-
|
|
|
335
|
-
| dict[str, typing.Any] = Nothing,
|
|
336
|
-
reply_markup: InlineKeyboardMarkup | Option[InlineKeyboardMarkup] = Nothing,
|
|
337
|
+
text: str | None = None,
|
|
338
|
+
chat_id: int | None = None,
|
|
339
|
+
message_id: int | None = None,
|
|
340
|
+
message_thread_id: int | None = None,
|
|
341
|
+
parse_mode: str | None = None,
|
|
342
|
+
entities: list[MessageEntity] | None = None,
|
|
343
|
+
link_preview_options: LinkPreviewOptions | dict[str, typing.Any] | None = None,
|
|
344
|
+
reply_markup: InlineKeyboardMarkup | None = None,
|
|
337
345
|
**other: typing.Any,
|
|
338
346
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
339
347
|
"""Shortcut `API.edit_message_text()`, see the [documentation](https://core.telegram.org/bots/api#editmessagetext)
|
|
@@ -371,19 +379,17 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
371
379
|
)
|
|
372
380
|
async def copy(
|
|
373
381
|
self,
|
|
374
|
-
chat_id: int | str |
|
|
375
|
-
from_chat_id: int | str |
|
|
376
|
-
message_id: int |
|
|
377
|
-
message_thread_id:
|
|
378
|
-
caption:
|
|
379
|
-
parse_mode:
|
|
380
|
-
caption_entities:
|
|
381
|
-
disable_notification:
|
|
382
|
-
protect_content:
|
|
383
|
-
reply_parameters:
|
|
384
|
-
|
|
|
385
|
-
| dict[str, typing.Any] = Nothing,
|
|
386
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
382
|
+
chat_id: int | str | None = None,
|
|
383
|
+
from_chat_id: int | str | None = None,
|
|
384
|
+
message_id: int | None = None,
|
|
385
|
+
message_thread_id: int | None = None,
|
|
386
|
+
caption: str | None = None,
|
|
387
|
+
parse_mode: str | None = None,
|
|
388
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
389
|
+
disable_notification: bool | None = None,
|
|
390
|
+
protect_content: bool | None = None,
|
|
391
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
392
|
+
reply_markup: ReplyMarkup | None = None,
|
|
387
393
|
**other: typing.Any,
|
|
388
394
|
) -> Result[MessageId, APIError]:
|
|
389
395
|
"""Shortcut `API.copy_message()`, see the [documentation](https://core.telegram.org/bots/api#copymessage)
|
|
@@ -435,7 +441,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
435
441
|
("from_chat_id", "chat_id"),
|
|
436
442
|
"message_thread_id",
|
|
437
443
|
},
|
|
438
|
-
validators={
|
|
444
|
+
validators={
|
|
445
|
+
"message_thread_id": lambda x: x.is_topic_message.unwrap_or(False)
|
|
446
|
+
},
|
|
439
447
|
)
|
|
440
448
|
if isinstance(reply_parameters, dict):
|
|
441
449
|
reply_parameters.setdefault("message_id", params.get("message_id"))
|
|
@@ -449,20 +457,17 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
449
457
|
)
|
|
450
458
|
async def react(
|
|
451
459
|
self,
|
|
452
|
-
reaction:
|
|
453
|
-
| ReactionEmoji
|
|
454
|
-
| ReactionType
|
|
455
|
-
| list[str | ReactionEmoji | ReactionType]
|
|
456
|
-
| Option[
|
|
460
|
+
reaction: (
|
|
457
461
|
str
|
|
458
462
|
| ReactionEmoji
|
|
459
463
|
| ReactionType
|
|
460
464
|
| list[str | ReactionEmoji | ReactionType]
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
465
|
+
| None
|
|
466
|
+
) = None,
|
|
467
|
+
chat_id: int | str | None = None,
|
|
468
|
+
message_thread_id: int | None = None,
|
|
469
|
+
message_id: int | None = None,
|
|
470
|
+
is_big: bool | None = None,
|
|
466
471
|
**other: typing.Any,
|
|
467
472
|
) -> Result[bool, APIError]:
|
|
468
473
|
"""Shortcut `API.set_message_reaction()`, see the [documentation](https://core.telegram.org/bots/api#setmessagereaction)
|
|
@@ -493,23 +498,25 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
493
498
|
params=get_params(locals()),
|
|
494
499
|
update=self,
|
|
495
500
|
default_params={"chat_id", "message_id", "message_thread_id"},
|
|
496
|
-
validators={
|
|
501
|
+
validators={
|
|
502
|
+
"message_thread_id": lambda x: x.is_topic_message.unwrap_or(False)
|
|
503
|
+
},
|
|
497
504
|
)
|
|
498
505
|
if reaction:
|
|
499
506
|
params["reaction"] = compose_reactions(
|
|
500
507
|
reaction.unwrap() if isinstance(reaction, Some) else reaction,
|
|
501
508
|
)
|
|
502
509
|
return await self.ctx_api.set_message_reaction(**params)
|
|
503
|
-
|
|
510
|
+
|
|
504
511
|
@shortcut("forward_message", custom_params={"message_thread_id"})
|
|
505
512
|
async def forward(
|
|
506
513
|
self,
|
|
507
514
|
chat_id: int | str,
|
|
508
|
-
message_id: int |
|
|
509
|
-
from_chat_id: int | str |
|
|
510
|
-
message_thread_id: int |
|
|
511
|
-
disable_notification: bool |
|
|
512
|
-
protect_content: bool |
|
|
515
|
+
message_id: int | None = None,
|
|
516
|
+
from_chat_id: int | str | None = None,
|
|
517
|
+
message_thread_id: int | None = None,
|
|
518
|
+
disable_notification: bool | None = None,
|
|
519
|
+
protect_content: bool | None = None,
|
|
513
520
|
**other: typing.Any,
|
|
514
521
|
) -> Result[MessageCute, APIError]:
|
|
515
522
|
"""Shortcut `API.forward_message()`, see the [documentation](https://core.telegram.org/bots/api#forwardmessage)
|
|
@@ -536,20 +543,26 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
536
543
|
params = compose_method_params(
|
|
537
544
|
params=get_params(locals()),
|
|
538
545
|
update=self,
|
|
539
|
-
default_params={
|
|
540
|
-
|
|
546
|
+
default_params={
|
|
547
|
+
("from_chat_id", "chat_id"),
|
|
548
|
+
"message_id",
|
|
549
|
+
"message_thread_id",
|
|
550
|
+
},
|
|
551
|
+
validators={
|
|
552
|
+
"message_thread_id": lambda x: x.is_topic_message.unwrap_or(False)
|
|
553
|
+
},
|
|
541
554
|
)
|
|
542
555
|
return (await self.ctx_api.forward_message(**params)).map(
|
|
543
556
|
lambda message: MessageCute.from_update(message, bound_api=self.api),
|
|
544
557
|
)
|
|
545
|
-
|
|
558
|
+
|
|
546
559
|
@shortcut("pin_chat_message", custom_params={"message_thread_id"})
|
|
547
560
|
async def pin(
|
|
548
561
|
self,
|
|
549
|
-
chat_id:
|
|
550
|
-
message_id:
|
|
551
|
-
message_thread_id:
|
|
552
|
-
disable_notification: bool |
|
|
562
|
+
chat_id: int | str | None = None,
|
|
563
|
+
message_id: int | None = None,
|
|
564
|
+
message_thread_id: int | None = None,
|
|
565
|
+
disable_notification: bool | None = None,
|
|
553
566
|
**other: typing.Any,
|
|
554
567
|
) -> Result[bool, "APIError"]:
|
|
555
568
|
"""Shortcut `API.pin_chat_message()`, see the [documentation](https://core.telegram.org/bots/api#pinchatmessage)
|
|
@@ -577,16 +590,18 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
577
590
|
params=get_params(locals()),
|
|
578
591
|
update=self,
|
|
579
592
|
default_params={"chat_id", "message_id", "message_thread_id"},
|
|
580
|
-
validators={
|
|
593
|
+
validators={
|
|
594
|
+
"message_thread_id": lambda x: x.is_topic_message.unwrap_or(False)
|
|
595
|
+
},
|
|
581
596
|
)
|
|
582
597
|
return await self.ctx_api.pin_chat_message(**params)
|
|
583
598
|
|
|
584
599
|
@shortcut("unpin_chat_message", custom_params={"message_thread_id"})
|
|
585
600
|
async def unpin(
|
|
586
601
|
self,
|
|
587
|
-
chat_id:
|
|
588
|
-
message_id:
|
|
589
|
-
message_thread_id:
|
|
602
|
+
chat_id: int | str | None = None,
|
|
603
|
+
message_id: int | None = None,
|
|
604
|
+
message_thread_id: int | None = None,
|
|
590
605
|
**other: typing.Any,
|
|
591
606
|
) -> Result[bool, "APIError"]:
|
|
592
607
|
"""Shortcut `API.unpin_chat_message()`, see the [documentation](https://core.telegram.org/bots/api#unpinchatmessage)
|
|
@@ -608,7 +623,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
608
623
|
params=get_params(locals()),
|
|
609
624
|
update=self,
|
|
610
625
|
default_params={"chat_id", "message_id", "message_thread_id"},
|
|
611
|
-
validators={
|
|
626
|
+
validators={
|
|
627
|
+
"message_thread_id": lambda x: x.is_topic_message.unwrap_or(False)
|
|
628
|
+
},
|
|
612
629
|
)
|
|
613
630
|
return await self.ctx_api.pin_chat_message(**params)
|
|
614
631
|
|
|
@@ -619,22 +636,20 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
619
636
|
)
|
|
620
637
|
async def answer_audio(
|
|
621
638
|
self,
|
|
622
|
-
audio:
|
|
623
|
-
chat_id: int | str |
|
|
624
|
-
message_thread_id: int |
|
|
625
|
-
caption: str |
|
|
626
|
-
parse_mode: str |
|
|
627
|
-
caption_entities: list[MessageEntity] |
|
|
628
|
-
duration: int |
|
|
629
|
-
performer: str |
|
|
630
|
-
title: str |
|
|
631
|
-
thumbnail:
|
|
632
|
-
disable_notification:
|
|
633
|
-
protect_content: bool |
|
|
634
|
-
reply_parameters:
|
|
635
|
-
|
|
|
636
|
-
| dict[str, typing.Any] = Nothing,
|
|
637
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
639
|
+
audio: InputFile | str,
|
|
640
|
+
chat_id: int | str | None = None,
|
|
641
|
+
message_thread_id: int | None = None,
|
|
642
|
+
caption: str | None = None,
|
|
643
|
+
parse_mode: str | None = None,
|
|
644
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
645
|
+
duration: int | None = None,
|
|
646
|
+
performer: str | None = None,
|
|
647
|
+
title: str | None = None,
|
|
648
|
+
thumbnail: InputFile | str | None = None,
|
|
649
|
+
disable_notification: bool | None = None,
|
|
650
|
+
protect_content: bool | None = None,
|
|
651
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
652
|
+
reply_markup: ReplyMarkup | None = None,
|
|
638
653
|
**other: typing.Any,
|
|
639
654
|
) -> Result[MessageCute, APIError]:
|
|
640
655
|
"""Shortcut `API.send_audio()`, see the [documentation](https://core.telegram.org/bots/api#sendaudio)
|
|
@@ -697,23 +712,21 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
697
712
|
)
|
|
698
713
|
async def answer_animation(
|
|
699
714
|
self,
|
|
700
|
-
animation:
|
|
701
|
-
chat_id: int | str |
|
|
702
|
-
message_thread_id: int |
|
|
703
|
-
caption: str |
|
|
704
|
-
parse_mode: str |
|
|
705
|
-
caption_entities: list[MessageEntity] |
|
|
706
|
-
duration: int |
|
|
707
|
-
width: int |
|
|
708
|
-
height: int |
|
|
709
|
-
thumbnail:
|
|
710
|
-
has_spoiler: bool |
|
|
711
|
-
disable_notification:
|
|
712
|
-
protect_content: bool |
|
|
713
|
-
reply_parameters:
|
|
714
|
-
|
|
|
715
|
-
| dict[str, typing.Any] = Nothing,
|
|
716
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
715
|
+
animation: InputFile | str,
|
|
716
|
+
chat_id: int | str | None = None,
|
|
717
|
+
message_thread_id: int | None = None,
|
|
718
|
+
caption: str | None = None,
|
|
719
|
+
parse_mode: str | None = None,
|
|
720
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
721
|
+
duration: int | None = None,
|
|
722
|
+
width: int | None = None,
|
|
723
|
+
height: int | None = None,
|
|
724
|
+
thumbnail: InputFile | str | None = None,
|
|
725
|
+
has_spoiler: bool | None = None,
|
|
726
|
+
disable_notification: bool | None = None,
|
|
727
|
+
protect_content: bool | None = None,
|
|
728
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
729
|
+
reply_markup: ReplyMarkup | None = None,
|
|
717
730
|
**other: typing.Any,
|
|
718
731
|
) -> Result[MessageCute, APIError]:
|
|
719
732
|
"""Shortcut `API.send_animation()`, see the [documentation](https://core.telegram.org/bots/api#sendanimation)
|
|
@@ -777,20 +790,18 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
777
790
|
)
|
|
778
791
|
async def answer_document(
|
|
779
792
|
self,
|
|
780
|
-
document:
|
|
781
|
-
chat_id: int | str |
|
|
782
|
-
message_thread_id: int |
|
|
783
|
-
caption: str |
|
|
784
|
-
parse_mode: str |
|
|
785
|
-
caption_entities: list[MessageEntity] |
|
|
786
|
-
disable_content_type_detection:
|
|
787
|
-
thumbnail:
|
|
788
|
-
disable_notification:
|
|
789
|
-
protect_content: bool |
|
|
790
|
-
reply_parameters:
|
|
791
|
-
|
|
|
792
|
-
| dict[str, typing.Any] = Nothing,
|
|
793
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
793
|
+
document: InputFile | str,
|
|
794
|
+
chat_id: int | str | None = None,
|
|
795
|
+
message_thread_id: int | None = None,
|
|
796
|
+
caption: str | None = None,
|
|
797
|
+
parse_mode: str | None = None,
|
|
798
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
799
|
+
disable_content_type_detection: bool | None = None,
|
|
800
|
+
thumbnail: InputFile | str | None = None,
|
|
801
|
+
disable_notification: bool | None = None,
|
|
802
|
+
protect_content: bool | None = None,
|
|
803
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
804
|
+
reply_markup: ReplyMarkup | None = None,
|
|
794
805
|
**other: typing.Any,
|
|
795
806
|
) -> Result[MessageCute, APIError]:
|
|
796
807
|
"""Shortcut `API.send_document()`, see the [documentation](https://core.telegram.org/bots/api#senddocument)
|
|
@@ -849,19 +860,17 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
849
860
|
)
|
|
850
861
|
async def answer_photo(
|
|
851
862
|
self,
|
|
852
|
-
photo:
|
|
853
|
-
chat_id: int | str |
|
|
854
|
-
message_thread_id: int |
|
|
855
|
-
caption: str |
|
|
856
|
-
parse_mode: str |
|
|
857
|
-
caption_entities: list[MessageEntity] |
|
|
858
|
-
has_spoiler: bool |
|
|
859
|
-
disable_notification:
|
|
860
|
-
protect_content: bool |
|
|
861
|
-
reply_parameters:
|
|
862
|
-
|
|
|
863
|
-
| dict[str, typing.Any] = Nothing,
|
|
864
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
863
|
+
photo: InputFile | str,
|
|
864
|
+
chat_id: int | str | None = None,
|
|
865
|
+
message_thread_id: int | None = None,
|
|
866
|
+
caption: str | None = None,
|
|
867
|
+
parse_mode: str | None = None,
|
|
868
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
869
|
+
has_spoiler: bool | None = None,
|
|
870
|
+
disable_notification: bool | None = None,
|
|
871
|
+
protect_content: bool | None = None,
|
|
872
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
873
|
+
reply_markup: ReplyMarkup | None = None,
|
|
865
874
|
**other: typing.Any,
|
|
866
875
|
) -> Result[MessageCute, APIError]:
|
|
867
876
|
"""Shortcut `API.send_photo()`, see the [documentation](https://core.telegram.org/bots/api#sendphoto)
|
|
@@ -911,16 +920,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
911
920
|
)
|
|
912
921
|
async def answer_sticker(
|
|
913
922
|
self,
|
|
914
|
-
sticker:
|
|
915
|
-
chat_id: int | str |
|
|
916
|
-
emoji: str |
|
|
917
|
-
message_thread_id: int |
|
|
918
|
-
disable_notification:
|
|
919
|
-
protect_content: bool |
|
|
920
|
-
reply_parameters:
|
|
921
|
-
|
|
|
922
|
-
| dict[str, typing.Any] = Nothing,
|
|
923
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
923
|
+
sticker: InputFile | str,
|
|
924
|
+
chat_id: int | str | None = None,
|
|
925
|
+
emoji: str | None = None,
|
|
926
|
+
message_thread_id: int | None = None,
|
|
927
|
+
disable_notification: bool | None = None,
|
|
928
|
+
protect_content: bool | None = None,
|
|
929
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
930
|
+
reply_markup: ReplyMarkup | None = None,
|
|
924
931
|
**other: typing.Any,
|
|
925
932
|
) -> Result[MessageCute, APIError]:
|
|
926
933
|
"""Shortcut `API.send_sticker()`, see the [documentation](https://core.telegram.org/bots/api#sendsticker)
|
|
@@ -962,24 +969,22 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
962
969
|
)
|
|
963
970
|
async def answer_video(
|
|
964
971
|
self,
|
|
965
|
-
video:
|
|
966
|
-
chat_id: int | str |
|
|
967
|
-
message_thread_id: int |
|
|
968
|
-
caption: str |
|
|
969
|
-
parse_mode: str |
|
|
970
|
-
caption_entities: list[MessageEntity] |
|
|
971
|
-
duration: int |
|
|
972
|
-
width: int |
|
|
973
|
-
height: int |
|
|
974
|
-
thumbnail:
|
|
975
|
-
has_spoiler: bool |
|
|
976
|
-
supports_streaming: bool |
|
|
977
|
-
disable_notification:
|
|
978
|
-
protect_content: bool |
|
|
979
|
-
reply_parameters:
|
|
980
|
-
|
|
|
981
|
-
| dict[str, typing.Any] = Nothing,
|
|
982
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
972
|
+
video: InputFile | str,
|
|
973
|
+
chat_id: int | str | None = None,
|
|
974
|
+
message_thread_id: int | None = None,
|
|
975
|
+
caption: str | None = None,
|
|
976
|
+
parse_mode: str | None = None,
|
|
977
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
978
|
+
duration: int | None = None,
|
|
979
|
+
width: int | None = None,
|
|
980
|
+
height: int | None = None,
|
|
981
|
+
thumbnail: InputFile | str | None = None,
|
|
982
|
+
has_spoiler: bool | None = None,
|
|
983
|
+
supports_streaming: bool | None = None,
|
|
984
|
+
disable_notification: bool | None = None,
|
|
985
|
+
protect_content: bool | None = None,
|
|
986
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
987
|
+
reply_markup: ReplyMarkup | None = None,
|
|
983
988
|
**other: typing.Any,
|
|
984
989
|
) -> Result[MessageCute, APIError]:
|
|
985
990
|
"""Shortcut `API.send_video()`, see the [documentation](https://core.telegram.org/bots/api#sendvideo)
|
|
@@ -1046,18 +1051,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1046
1051
|
)
|
|
1047
1052
|
async def answer_video_note(
|
|
1048
1053
|
self,
|
|
1049
|
-
video_note:
|
|
1050
|
-
chat_id: int | str |
|
|
1051
|
-
duration: int |
|
|
1052
|
-
length: int |
|
|
1053
|
-
message_thread_id: int |
|
|
1054
|
-
thumbnail:
|
|
1055
|
-
disable_notification:
|
|
1056
|
-
protect_content: bool |
|
|
1057
|
-
reply_parameters:
|
|
1058
|
-
|
|
|
1059
|
-
| dict[str, typing.Any] = Nothing,
|
|
1060
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
1054
|
+
video_note: InputFile | str,
|
|
1055
|
+
chat_id: int | str | None = None,
|
|
1056
|
+
duration: int | None = None,
|
|
1057
|
+
length: int | None = None,
|
|
1058
|
+
message_thread_id: int | None = None,
|
|
1059
|
+
thumbnail: InputFile | str | None = None,
|
|
1060
|
+
disable_notification: bool | None = None,
|
|
1061
|
+
protect_content: bool | None = None,
|
|
1062
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1063
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1061
1064
|
**other: typing.Any,
|
|
1062
1065
|
) -> Result[MessageCute, APIError]:
|
|
1063
1066
|
"""Shortcut `API.send_video_note()`, see the [documentation](https://core.telegram.org/bots/api#sendvideonote)
|
|
@@ -1108,19 +1111,17 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1108
1111
|
)
|
|
1109
1112
|
async def answer_voice(
|
|
1110
1113
|
self,
|
|
1111
|
-
voice:
|
|
1112
|
-
chat_id: int | str |
|
|
1113
|
-
message_thread_id: int |
|
|
1114
|
-
caption: str |
|
|
1115
|
-
parse_mode: str |
|
|
1116
|
-
caption_entities: list[MessageEntity] |
|
|
1117
|
-
duration: int |
|
|
1118
|
-
disable_notification:
|
|
1119
|
-
protect_content: bool |
|
|
1120
|
-
reply_parameters:
|
|
1121
|
-
|
|
|
1122
|
-
| dict[str, typing.Any] = Nothing,
|
|
1123
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
1114
|
+
voice: InputFile | str,
|
|
1115
|
+
chat_id: int | str | None = None,
|
|
1116
|
+
message_thread_id: int | None = None,
|
|
1117
|
+
caption: str | None = None,
|
|
1118
|
+
parse_mode: str | None = None,
|
|
1119
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
1120
|
+
duration: int | None = None,
|
|
1121
|
+
disable_notification: bool | None = None,
|
|
1122
|
+
protect_content: bool | None = None,
|
|
1123
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1124
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1124
1125
|
**other: typing.Any,
|
|
1125
1126
|
) -> Result[MessageCute, APIError]:
|
|
1126
1127
|
"""Shortcut `API.send_voice()`, see the [documentation](https://core.telegram.org/bots/api#sendvoice)
|
|
@@ -1173,26 +1174,22 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1173
1174
|
self,
|
|
1174
1175
|
question: str,
|
|
1175
1176
|
options: list[str],
|
|
1176
|
-
chat_id: int | str |
|
|
1177
|
-
message_thread_id:
|
|
1178
|
-
is_anonymous:
|
|
1179
|
-
type:
|
|
1180
|
-
|
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
reply_parameters: Option[ReplyParameters | dict[str, typing.Any]]
|
|
1193
|
-
| ReplyParameters
|
|
1194
|
-
| dict[str, typing.Any] = Nothing,
|
|
1195
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
1177
|
+
chat_id: int | str | None = None,
|
|
1178
|
+
message_thread_id: int | None = None,
|
|
1179
|
+
is_anonymous: bool | None = None,
|
|
1180
|
+
type: typing.Literal["quiz", "regular"] | None = None,
|
|
1181
|
+
allows_multiple_answers: bool | None = None,
|
|
1182
|
+
correct_option_id: int | None = None,
|
|
1183
|
+
explanation: str | None = None,
|
|
1184
|
+
explanation_parse_mode: str | None = None,
|
|
1185
|
+
explanation_entities: list[MessageEntity] | None = None,
|
|
1186
|
+
open_period: int | None = None,
|
|
1187
|
+
close_date: datetime | int | None = None,
|
|
1188
|
+
is_closed: bool | None = None,
|
|
1189
|
+
disable_notification: bool | None = None,
|
|
1190
|
+
protect_content: bool | None = None,
|
|
1191
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1192
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1196
1193
|
**other: typing.Any,
|
|
1197
1194
|
) -> Result[MessageCute, APIError]:
|
|
1198
1195
|
"""Shortcut `API.send_poll()`, see the [documentation](https://core.telegram.org/bots/api#sendpoll)
|
|
@@ -1263,18 +1260,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1263
1260
|
longitude: float,
|
|
1264
1261
|
title: str,
|
|
1265
1262
|
address: str,
|
|
1266
|
-
chat_id: int | str |
|
|
1267
|
-
message_thread_id:
|
|
1268
|
-
foursquare_id:
|
|
1269
|
-
foursquare_type:
|
|
1270
|
-
google_place_id:
|
|
1271
|
-
google_place_type:
|
|
1272
|
-
disable_notification:
|
|
1273
|
-
protect_content:
|
|
1274
|
-
reply_parameters:
|
|
1275
|
-
|
|
|
1276
|
-
| dict[str, typing.Any] = Nothing,
|
|
1277
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
1263
|
+
chat_id: int | str | None = None,
|
|
1264
|
+
message_thread_id: int | None = None,
|
|
1265
|
+
foursquare_id: str | None = None,
|
|
1266
|
+
foursquare_type: str | None = None,
|
|
1267
|
+
google_place_id: str | None = None,
|
|
1268
|
+
google_place_type: str | None = None,
|
|
1269
|
+
disable_notification: bool | None = None,
|
|
1270
|
+
protect_content: bool | None = None,
|
|
1271
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1272
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1278
1273
|
**other: typing.Any,
|
|
1279
1274
|
) -> Result[MessageCute, APIError]:
|
|
1280
1275
|
"""Shortcut `API.send_venue()`, see the [documentation](https://core.telegram.org/bots/api#sendvenue)
|
|
@@ -1324,15 +1319,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1324
1319
|
)
|
|
1325
1320
|
async def answer_dice(
|
|
1326
1321
|
self,
|
|
1327
|
-
emoji:
|
|
1328
|
-
chat_id: int | str |
|
|
1329
|
-
message_thread_id:
|
|
1330
|
-
disable_notification:
|
|
1331
|
-
protect_content:
|
|
1332
|
-
reply_parameters:
|
|
1333
|
-
|
|
|
1334
|
-
| dict[str, typing.Any] = Nothing,
|
|
1335
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
1322
|
+
emoji: DiceEmoji | None = None,
|
|
1323
|
+
chat_id: int | str | None = None,
|
|
1324
|
+
message_thread_id: int | None = None,
|
|
1325
|
+
disable_notification: bool | None = None,
|
|
1326
|
+
protect_content: bool | None = None,
|
|
1327
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1328
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1336
1329
|
**other: typing.Any,
|
|
1337
1330
|
) -> Result[MessageCute, APIError]:
|
|
1338
1331
|
"""Shortcut `API.send_dice()`, see the [documentation](https://core.telegram.org/bots/api#senddice)
|
|
@@ -1369,15 +1362,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1369
1362
|
)
|
|
1370
1363
|
async def answer_game(
|
|
1371
1364
|
self,
|
|
1372
|
-
chat_id: int | str |
|
|
1373
|
-
message_thread_id:
|
|
1374
|
-
game_short_name:
|
|
1375
|
-
disable_notification:
|
|
1376
|
-
protect_content:
|
|
1377
|
-
reply_parameters:
|
|
1378
|
-
|
|
|
1379
|
-
| dict[str, typing.Any] = Nothing,
|
|
1380
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
1365
|
+
chat_id: int | str | None = None,
|
|
1366
|
+
message_thread_id: int | None = None,
|
|
1367
|
+
game_short_name: str | None = None,
|
|
1368
|
+
disable_notification: bool | None = None,
|
|
1369
|
+
protect_content: bool | None = None,
|
|
1370
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1371
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1381
1372
|
**other: typing.Any,
|
|
1382
1373
|
) -> Result[MessageCute, APIError]:
|
|
1383
1374
|
"""Shortcut `API.send_game()`, see the [documentation](https://core.telegram.org/bots/api#sendgame)
|
|
@@ -1416,29 +1407,27 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1416
1407
|
provider_token: str,
|
|
1417
1408
|
currency: str,
|
|
1418
1409
|
prices: list[LabeledPrice],
|
|
1419
|
-
chat_id:
|
|
1420
|
-
message_thread_id:
|
|
1421
|
-
max_tip_amount:
|
|
1422
|
-
suggested_tip_amounts:
|
|
1423
|
-
start_parameter:
|
|
1424
|
-
provider_data:
|
|
1425
|
-
photo_url:
|
|
1426
|
-
photo_size:
|
|
1427
|
-
photo_width:
|
|
1428
|
-
photo_height:
|
|
1429
|
-
need_name:
|
|
1430
|
-
need_phone_number:
|
|
1431
|
-
need_email:
|
|
1432
|
-
need_shipping_address:
|
|
1433
|
-
send_phone_number_to_provider:
|
|
1434
|
-
send_email_to_provider:
|
|
1435
|
-
is_flexible:
|
|
1436
|
-
disable_notification:
|
|
1437
|
-
protect_content:
|
|
1438
|
-
reply_parameters:
|
|
1439
|
-
|
|
|
1440
|
-
| dict[str, typing.Any] = Nothing,
|
|
1441
|
-
reply_markup: Option[InlineKeyboardMarkup] | InlineKeyboardMarkup = Nothing,
|
|
1410
|
+
chat_id: int | str | None = None,
|
|
1411
|
+
message_thread_id: int | None = None,
|
|
1412
|
+
max_tip_amount: int | None = None,
|
|
1413
|
+
suggested_tip_amounts: list[int] | None = None,
|
|
1414
|
+
start_parameter: str | None = None,
|
|
1415
|
+
provider_data: str | None = None,
|
|
1416
|
+
photo_url: str | None = None,
|
|
1417
|
+
photo_size: int | None = None,
|
|
1418
|
+
photo_width: int | None = None,
|
|
1419
|
+
photo_height: int | None = None,
|
|
1420
|
+
need_name: bool | None = None,
|
|
1421
|
+
need_phone_number: bool | None = None,
|
|
1422
|
+
need_email: bool | None = None,
|
|
1423
|
+
need_shipping_address: bool | None = None,
|
|
1424
|
+
send_phone_number_to_provider: bool | None = None,
|
|
1425
|
+
send_email_to_provider: bool | None = None,
|
|
1426
|
+
is_flexible: bool | None = None,
|
|
1427
|
+
disable_notification: bool | None = None,
|
|
1428
|
+
protect_content: bool | None = None,
|
|
1429
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1430
|
+
reply_markup: InlineKeyboardMarkup | None = None,
|
|
1442
1431
|
**other: typing.Any,
|
|
1443
1432
|
) -> Result[MessageCute, APIError]:
|
|
1444
1433
|
"""Shortcut `API.send_invoice()`, see the [documentation](https://core.telegram.org/bots/api#sendinvoice)
|
|
@@ -1529,8 +1518,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1529
1518
|
async def answer_chat_action(
|
|
1530
1519
|
self,
|
|
1531
1520
|
action: ChatAction,
|
|
1532
|
-
chat_id:
|
|
1533
|
-
message_thread_id:
|
|
1521
|
+
chat_id: int | str | None = None,
|
|
1522
|
+
message_thread_id: int | None = None,
|
|
1534
1523
|
**other: typing.Any,
|
|
1535
1524
|
) -> Result[bool, APIError]:
|
|
1536
1525
|
"""Shortcut `API.send_chat_action()`, see the [documentation](https://core.telegram.org/bots/api#sendchataction)
|
|
@@ -1562,16 +1551,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1562
1551
|
async def answer_media_group(
|
|
1563
1552
|
self,
|
|
1564
1553
|
media: list[InputMedia | tuple[MediaType, InputFile | str]],
|
|
1565
|
-
chat_id:
|
|
1566
|
-
message_thread_id:
|
|
1567
|
-
caption: str |
|
|
1568
|
-
parse_mode: str |
|
|
1569
|
-
caption_entities: list[MessageEntity] |
|
|
1570
|
-
disable_notification:
|
|
1571
|
-
protect_content:
|
|
1572
|
-
reply_parameters:
|
|
1573
|
-
| ReplyParameters
|
|
1574
|
-
| dict[str, typing.Any] = Nothing,
|
|
1554
|
+
chat_id: int | str | None = None,
|
|
1555
|
+
message_thread_id: int | None = None,
|
|
1556
|
+
caption: str | None = None,
|
|
1557
|
+
parse_mode: str | None = None,
|
|
1558
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
1559
|
+
disable_notification: bool | None = None,
|
|
1560
|
+
protect_content: bool | None = None,
|
|
1561
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1575
1562
|
**other: typing.Any,
|
|
1576
1563
|
) -> Result[list[MessageCute], APIError]:
|
|
1577
1564
|
"""Shortcut `API.send_media_group()`, see the [documentation](https://core.telegram.org/bots/api#sendmediagroup)
|
|
@@ -1602,7 +1589,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1602
1589
|
:param protect_content: Protects the contents of the sent messages from forwarding and saving. \
|
|
1603
1590
|
|
|
1604
1591
|
:param reply_parameters: Description of the message to reply to."""
|
|
1605
|
-
|
|
1592
|
+
|
|
1606
1593
|
params = get_params(locals())
|
|
1607
1594
|
|
|
1608
1595
|
for i, m in enumerate(media[:]):
|
|
@@ -1616,7 +1603,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1616
1603
|
parse_mode=parse_mode,
|
|
1617
1604
|
),
|
|
1618
1605
|
)
|
|
1619
|
-
|
|
1606
|
+
|
|
1620
1607
|
return await execute_method_answer(self, "send_media_group", params)
|
|
1621
1608
|
|
|
1622
1609
|
@shortcut(
|
|
@@ -1628,18 +1615,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1628
1615
|
self,
|
|
1629
1616
|
latitude: float,
|
|
1630
1617
|
longitude: float,
|
|
1631
|
-
chat_id:
|
|
1632
|
-
message_thread_id:
|
|
1633
|
-
horizontal_accuracy:
|
|
1634
|
-
heading:
|
|
1635
|
-
live_period:
|
|
1636
|
-
proximity_alert_radius:
|
|
1637
|
-
disable_notification:
|
|
1638
|
-
protect_content:
|
|
1639
|
-
reply_parameters:
|
|
1640
|
-
|
|
|
1641
|
-
| dict[str, typing.Any] = Nothing,
|
|
1642
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
1618
|
+
chat_id: int | str | None = None,
|
|
1619
|
+
message_thread_id: int | None = None,
|
|
1620
|
+
horizontal_accuracy: float | None = None,
|
|
1621
|
+
heading: int | None = None,
|
|
1622
|
+
live_period: int | None = None,
|
|
1623
|
+
proximity_alert_radius: int | None = None,
|
|
1624
|
+
disable_notification: bool | None = None,
|
|
1625
|
+
protect_content: bool | None = None,
|
|
1626
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1627
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1643
1628
|
**other: typing.Any,
|
|
1644
1629
|
) -> Result[MessageCute, APIError]:
|
|
1645
1630
|
"""Shortcut `API.send_location()`, see the [documentation](https://core.telegram.org/bots/api#sendlocation)
|
|
@@ -1688,16 +1673,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1688
1673
|
self,
|
|
1689
1674
|
phone_number: str,
|
|
1690
1675
|
first_name: str,
|
|
1691
|
-
last_name:
|
|
1692
|
-
vcard:
|
|
1693
|
-
chat_id:
|
|
1694
|
-
message_thread_id:
|
|
1695
|
-
disable_notification:
|
|
1696
|
-
protect_content:
|
|
1697
|
-
reply_parameters:
|
|
1698
|
-
|
|
|
1699
|
-
| dict[str, typing.Any] = Nothing,
|
|
1700
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
1676
|
+
last_name: str | None = None,
|
|
1677
|
+
vcard: str | None = None,
|
|
1678
|
+
chat_id: int | str | None = None,
|
|
1679
|
+
message_thread_id: int | None = None,
|
|
1680
|
+
disable_notification: bool | None = None,
|
|
1681
|
+
protect_content: bool | None = None,
|
|
1682
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1683
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1701
1684
|
**other: typing.Any,
|
|
1702
1685
|
) -> Result[MessageCute, APIError]:
|
|
1703
1686
|
"""Shortcut `API.send_contact()`, see the [documentation](https://core.telegram.org/bots/api#sendcontact)
|
|
@@ -1737,22 +1720,20 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1737
1720
|
)
|
|
1738
1721
|
async def reply_audio(
|
|
1739
1722
|
self,
|
|
1740
|
-
audio:
|
|
1741
|
-
chat_id: int | str |
|
|
1742
|
-
message_thread_id: int |
|
|
1743
|
-
caption: str |
|
|
1744
|
-
parse_mode: str |
|
|
1745
|
-
caption_entities: list[MessageEntity] |
|
|
1746
|
-
duration: int |
|
|
1747
|
-
performer: str |
|
|
1748
|
-
title: str |
|
|
1749
|
-
thumbnail:
|
|
1750
|
-
disable_notification:
|
|
1751
|
-
protect_content: bool |
|
|
1752
|
-
reply_parameters:
|
|
1753
|
-
|
|
|
1754
|
-
| dict[str, typing.Any] = Nothing,
|
|
1755
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
1723
|
+
audio: InputFile | str,
|
|
1724
|
+
chat_id: int | str | None = None,
|
|
1725
|
+
message_thread_id: int | None = None,
|
|
1726
|
+
caption: str | None = None,
|
|
1727
|
+
parse_mode: str | None = None,
|
|
1728
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
1729
|
+
duration: int | None = None,
|
|
1730
|
+
performer: str | None = None,
|
|
1731
|
+
title: str | None = None,
|
|
1732
|
+
thumbnail: InputFile | str | None = None,
|
|
1733
|
+
disable_notification: bool | None = None,
|
|
1734
|
+
protect_content: bool | None = None,
|
|
1735
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1736
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1756
1737
|
**other: typing.Any,
|
|
1757
1738
|
) -> Result[MessageCute, APIError]:
|
|
1758
1739
|
"""Shortcut `API.send_audio()`, see the [documentation](https://core.telegram.org/bots/api#sendaudio)
|
|
@@ -1815,23 +1796,21 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1815
1796
|
)
|
|
1816
1797
|
async def reply_animation(
|
|
1817
1798
|
self,
|
|
1818
|
-
animation:
|
|
1819
|
-
chat_id: int | str |
|
|
1820
|
-
message_thread_id: int |
|
|
1821
|
-
caption: str |
|
|
1822
|
-
parse_mode: str |
|
|
1823
|
-
caption_entities: list[MessageEntity] |
|
|
1824
|
-
duration: int |
|
|
1825
|
-
width: int |
|
|
1826
|
-
height: int |
|
|
1827
|
-
thumbnail:
|
|
1828
|
-
has_spoiler: bool |
|
|
1829
|
-
disable_notification:
|
|
1830
|
-
protect_content: bool |
|
|
1831
|
-
reply_parameters:
|
|
1832
|
-
|
|
|
1833
|
-
| dict[str, typing.Any] = Nothing,
|
|
1834
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
1799
|
+
animation: InputFile | str,
|
|
1800
|
+
chat_id: int | str | None = None,
|
|
1801
|
+
message_thread_id: int | None = None,
|
|
1802
|
+
caption: str | None = None,
|
|
1803
|
+
parse_mode: str | None = None,
|
|
1804
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
1805
|
+
duration: int | None = None,
|
|
1806
|
+
width: int | None = None,
|
|
1807
|
+
height: int | None = None,
|
|
1808
|
+
thumbnail: InputFile | str | None = None,
|
|
1809
|
+
has_spoiler: bool | None = None,
|
|
1810
|
+
disable_notification: bool | None = None,
|
|
1811
|
+
protect_content: bool | None = None,
|
|
1812
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1813
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1835
1814
|
**other: typing.Any,
|
|
1836
1815
|
) -> Result[MessageCute, APIError]:
|
|
1837
1816
|
"""Shortcut `API.send_animation()`, see the [documentation](https://core.telegram.org/bots/api#sendanimation)
|
|
@@ -1895,20 +1874,18 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1895
1874
|
)
|
|
1896
1875
|
async def reply_document(
|
|
1897
1876
|
self,
|
|
1898
|
-
document:
|
|
1899
|
-
chat_id: int | str |
|
|
1900
|
-
message_thread_id: int |
|
|
1901
|
-
caption: str |
|
|
1902
|
-
parse_mode: str |
|
|
1903
|
-
caption_entities: list[MessageEntity] |
|
|
1904
|
-
disable_content_type_detection:
|
|
1905
|
-
thumbnail:
|
|
1906
|
-
disable_notification:
|
|
1907
|
-
protect_content: bool |
|
|
1908
|
-
reply_parameters:
|
|
1909
|
-
|
|
|
1910
|
-
| dict[str, typing.Any] = Nothing,
|
|
1911
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
1877
|
+
document: InputFile | str,
|
|
1878
|
+
chat_id: int | str | None = None,
|
|
1879
|
+
message_thread_id: int | None = None,
|
|
1880
|
+
caption: str | None = None,
|
|
1881
|
+
parse_mode: str | None = None,
|
|
1882
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
1883
|
+
disable_content_type_detection: bool | None = None,
|
|
1884
|
+
thumbnail: InputFile | str | None = None,
|
|
1885
|
+
disable_notification: bool | None = None,
|
|
1886
|
+
protect_content: bool | None = None,
|
|
1887
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1888
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1912
1889
|
**other: typing.Any,
|
|
1913
1890
|
) -> Result[MessageCute, APIError]:
|
|
1914
1891
|
"""Shortcut `API.send_document()`, see the [documentation](https://core.telegram.org/bots/api#senddocument)
|
|
@@ -1967,19 +1944,17 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1967
1944
|
)
|
|
1968
1945
|
async def reply_photo(
|
|
1969
1946
|
self,
|
|
1970
|
-
photo:
|
|
1971
|
-
chat_id: int | str |
|
|
1972
|
-
message_thread_id: int |
|
|
1973
|
-
caption: str |
|
|
1974
|
-
parse_mode: str |
|
|
1975
|
-
caption_entities: list[MessageEntity] |
|
|
1976
|
-
has_spoiler: bool |
|
|
1977
|
-
disable_notification:
|
|
1978
|
-
protect_content: bool |
|
|
1979
|
-
reply_parameters:
|
|
1980
|
-
|
|
|
1981
|
-
| dict[str, typing.Any] = Nothing,
|
|
1982
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
1947
|
+
photo: InputFile | str,
|
|
1948
|
+
chat_id: int | str | None = None,
|
|
1949
|
+
message_thread_id: int | None = None,
|
|
1950
|
+
caption: str | None = None,
|
|
1951
|
+
parse_mode: str | None = None,
|
|
1952
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
1953
|
+
has_spoiler: bool | None = None,
|
|
1954
|
+
disable_notification: bool | None = None,
|
|
1955
|
+
protect_content: bool | None = None,
|
|
1956
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
1957
|
+
reply_markup: ReplyMarkup | None = None,
|
|
1983
1958
|
**other: typing.Any,
|
|
1984
1959
|
) -> Result[MessageCute, APIError]:
|
|
1985
1960
|
"""Shortcut `API.send_photo()`, see the [documentation](https://core.telegram.org/bots/api#sendphoto)
|
|
@@ -2029,16 +2004,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2029
2004
|
)
|
|
2030
2005
|
async def reply_sticker(
|
|
2031
2006
|
self,
|
|
2032
|
-
sticker:
|
|
2033
|
-
chat_id: int | str |
|
|
2034
|
-
emoji: str |
|
|
2035
|
-
message_thread_id: int |
|
|
2036
|
-
disable_notification:
|
|
2037
|
-
protect_content: bool |
|
|
2038
|
-
reply_parameters:
|
|
2039
|
-
|
|
|
2040
|
-
| dict[str, typing.Any] = Nothing,
|
|
2041
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
2007
|
+
sticker: InputFile | str,
|
|
2008
|
+
chat_id: int | str | None = None,
|
|
2009
|
+
emoji: str | None = None,
|
|
2010
|
+
message_thread_id: int | None = None,
|
|
2011
|
+
disable_notification: bool | None = None,
|
|
2012
|
+
protect_content: bool | None = None,
|
|
2013
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2014
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2042
2015
|
**other: typing.Any,
|
|
2043
2016
|
) -> Result[MessageCute, APIError]:
|
|
2044
2017
|
"""Shortcut `API.send_sticker()`, see the [documentation](https://core.telegram.org/bots/api#sendsticker)
|
|
@@ -2080,24 +2053,22 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2080
2053
|
)
|
|
2081
2054
|
async def reply_video(
|
|
2082
2055
|
self,
|
|
2083
|
-
video:
|
|
2084
|
-
chat_id: int | str |
|
|
2085
|
-
message_thread_id: int |
|
|
2086
|
-
caption: str |
|
|
2087
|
-
parse_mode: str |
|
|
2088
|
-
caption_entities: list[MessageEntity] |
|
|
2089
|
-
duration: int |
|
|
2090
|
-
width: int |
|
|
2091
|
-
height: int |
|
|
2092
|
-
thumbnail:
|
|
2093
|
-
has_spoiler: bool |
|
|
2094
|
-
supports_streaming: bool |
|
|
2095
|
-
disable_notification:
|
|
2096
|
-
protect_content: bool |
|
|
2097
|
-
reply_parameters:
|
|
2098
|
-
|
|
|
2099
|
-
| dict[str, typing.Any] = Nothing,
|
|
2100
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
2056
|
+
video: InputFile | str,
|
|
2057
|
+
chat_id: int | str | None = None,
|
|
2058
|
+
message_thread_id: int | None = None,
|
|
2059
|
+
caption: str | None = None,
|
|
2060
|
+
parse_mode: str | None = None,
|
|
2061
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
2062
|
+
duration: int | None = None,
|
|
2063
|
+
width: int | None = None,
|
|
2064
|
+
height: int | None = None,
|
|
2065
|
+
thumbnail: InputFile | str | None = None,
|
|
2066
|
+
has_spoiler: bool | None = None,
|
|
2067
|
+
supports_streaming: bool | None = None,
|
|
2068
|
+
disable_notification: bool | None = None,
|
|
2069
|
+
protect_content: bool | None = None,
|
|
2070
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2071
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2101
2072
|
**other: typing.Any,
|
|
2102
2073
|
) -> Result[MessageCute, APIError]:
|
|
2103
2074
|
"""Shortcut `API.send_video()`, see the [documentation](https://core.telegram.org/bots/api#sendvideo)
|
|
@@ -2164,18 +2135,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2164
2135
|
)
|
|
2165
2136
|
async def reply_video_note(
|
|
2166
2137
|
self,
|
|
2167
|
-
video_note:
|
|
2168
|
-
chat_id: int | str |
|
|
2169
|
-
duration: int |
|
|
2170
|
-
length: int |
|
|
2171
|
-
message_thread_id: int |
|
|
2172
|
-
thumbnail:
|
|
2173
|
-
disable_notification:
|
|
2174
|
-
protect_content: bool |
|
|
2175
|
-
reply_parameters:
|
|
2176
|
-
|
|
|
2177
|
-
| dict[str, typing.Any] = Nothing,
|
|
2178
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
2138
|
+
video_note: InputFile | str,
|
|
2139
|
+
chat_id: int | str | None = None,
|
|
2140
|
+
duration: int | None = None,
|
|
2141
|
+
length: int | None = None,
|
|
2142
|
+
message_thread_id: int | None = None,
|
|
2143
|
+
thumbnail: InputFile | str | None = None,
|
|
2144
|
+
disable_notification: bool | None = None,
|
|
2145
|
+
protect_content: bool | None = None,
|
|
2146
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2147
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2179
2148
|
**other: typing.Any,
|
|
2180
2149
|
) -> Result[MessageCute, APIError]:
|
|
2181
2150
|
"""Shortcut `API.send_video_note()`, see the [documentation](https://core.telegram.org/bots/api#sendvideonote)
|
|
@@ -2226,19 +2195,17 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2226
2195
|
)
|
|
2227
2196
|
async def reply_voice(
|
|
2228
2197
|
self,
|
|
2229
|
-
voice:
|
|
2230
|
-
chat_id: int | str |
|
|
2231
|
-
message_thread_id: int |
|
|
2232
|
-
caption: str |
|
|
2233
|
-
parse_mode: str |
|
|
2234
|
-
caption_entities: list[MessageEntity] |
|
|
2235
|
-
duration: int |
|
|
2236
|
-
disable_notification:
|
|
2237
|
-
protect_content: bool |
|
|
2238
|
-
reply_parameters:
|
|
2239
|
-
|
|
|
2240
|
-
| dict[str, typing.Any] = Nothing,
|
|
2241
|
-
reply_markup: ReplyMarkup | Option[ReplyMarkup] = Nothing,
|
|
2198
|
+
voice: InputFile | str,
|
|
2199
|
+
chat_id: int | str | None = None,
|
|
2200
|
+
message_thread_id: int | None = None,
|
|
2201
|
+
caption: str | None = None,
|
|
2202
|
+
parse_mode: str | None = None,
|
|
2203
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
2204
|
+
duration: int | None = None,
|
|
2205
|
+
disable_notification: bool | None = None,
|
|
2206
|
+
protect_content: bool | None = None,
|
|
2207
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2208
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2242
2209
|
**other: typing.Any,
|
|
2243
2210
|
) -> Result[MessageCute, APIError]:
|
|
2244
2211
|
"""Shortcut `API.send_voice()`, see the [documentation](https://core.telegram.org/bots/api#sendvoice)
|
|
@@ -2291,26 +2258,22 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2291
2258
|
self,
|
|
2292
2259
|
question: str,
|
|
2293
2260
|
options: list[str],
|
|
2294
|
-
chat_id: int | str |
|
|
2295
|
-
message_thread_id:
|
|
2296
|
-
is_anonymous:
|
|
2297
|
-
type:
|
|
2298
|
-
|
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
reply_parameters: Option[ReplyParameters | dict[str, typing.Any]]
|
|
2311
|
-
| ReplyParameters
|
|
2312
|
-
| dict[str, typing.Any] = Nothing,
|
|
2313
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
2261
|
+
chat_id: int | str | None = None,
|
|
2262
|
+
message_thread_id: int | None = None,
|
|
2263
|
+
is_anonymous: bool | None = None,
|
|
2264
|
+
type: typing.Literal["quiz", "regular"] | None = None,
|
|
2265
|
+
allows_multiple_answers: bool | None = None,
|
|
2266
|
+
correct_option_id: int | None = None,
|
|
2267
|
+
explanation: str | None = None,
|
|
2268
|
+
explanation_parse_mode: str | None = None,
|
|
2269
|
+
explanation_entities: list[MessageEntity] | None = None,
|
|
2270
|
+
open_period: int | None = None,
|
|
2271
|
+
close_date: datetime | int | None = None,
|
|
2272
|
+
is_closed: bool | None = None,
|
|
2273
|
+
disable_notification: bool | None = None,
|
|
2274
|
+
protect_content: bool | None = None,
|
|
2275
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2276
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2314
2277
|
**other: typing.Any,
|
|
2315
2278
|
) -> Result[MessageCute, APIError]:
|
|
2316
2279
|
"""Shortcut `API.send_poll()`, see the [documentation](https://core.telegram.org/bots/api#sendpoll)
|
|
@@ -2381,18 +2344,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2381
2344
|
longitude: float,
|
|
2382
2345
|
title: str,
|
|
2383
2346
|
address: str,
|
|
2384
|
-
chat_id: int | str |
|
|
2385
|
-
message_thread_id:
|
|
2386
|
-
foursquare_id:
|
|
2387
|
-
foursquare_type:
|
|
2388
|
-
google_place_id:
|
|
2389
|
-
google_place_type:
|
|
2390
|
-
disable_notification:
|
|
2391
|
-
protect_content:
|
|
2392
|
-
reply_parameters:
|
|
2393
|
-
|
|
|
2394
|
-
| dict[str, typing.Any] = Nothing,
|
|
2395
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
2347
|
+
chat_id: int | str | None = None,
|
|
2348
|
+
message_thread_id: int | None = None,
|
|
2349
|
+
foursquare_id: str | None = None,
|
|
2350
|
+
foursquare_type: str | None = None,
|
|
2351
|
+
google_place_id: str | None = None,
|
|
2352
|
+
google_place_type: str | None = None,
|
|
2353
|
+
disable_notification: bool | None = None,
|
|
2354
|
+
protect_content: bool | None = None,
|
|
2355
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2356
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2396
2357
|
**other: typing.Any,
|
|
2397
2358
|
) -> Result[MessageCute, APIError]:
|
|
2398
2359
|
"""Shortcut `API.send_venue()`, see the [documentation](https://core.telegram.org/bots/api#sendvenue)
|
|
@@ -2442,15 +2403,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2442
2403
|
)
|
|
2443
2404
|
async def reply_dice(
|
|
2444
2405
|
self,
|
|
2445
|
-
chat_id: int | str |
|
|
2446
|
-
message_thread_id:
|
|
2447
|
-
emoji:
|
|
2448
|
-
disable_notification:
|
|
2449
|
-
protect_content:
|
|
2450
|
-
reply_parameters:
|
|
2451
|
-
|
|
|
2452
|
-
| dict[str, typing.Any] = Nothing,
|
|
2453
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
2406
|
+
chat_id: int | str | None = None,
|
|
2407
|
+
message_thread_id: int | None = None,
|
|
2408
|
+
emoji: DiceEmoji | None = None,
|
|
2409
|
+
disable_notification: bool | None = None,
|
|
2410
|
+
protect_content: bool | None = None,
|
|
2411
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2412
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2454
2413
|
**other: typing.Any,
|
|
2455
2414
|
) -> Result[MessageCute, APIError]:
|
|
2456
2415
|
"""Shortcut `API.send_dice()`, see the [documentation](https://core.telegram.org/bots/api#senddice)
|
|
@@ -2487,15 +2446,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2487
2446
|
)
|
|
2488
2447
|
async def reply_game(
|
|
2489
2448
|
self,
|
|
2490
|
-
chat_id: int | str |
|
|
2491
|
-
message_thread_id:
|
|
2492
|
-
game_short_name:
|
|
2493
|
-
disable_notification:
|
|
2494
|
-
protect_content:
|
|
2495
|
-
reply_parameters:
|
|
2496
|
-
|
|
|
2497
|
-
| dict[str, typing.Any] = Nothing,
|
|
2498
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
2449
|
+
chat_id: int | str | None = None,
|
|
2450
|
+
message_thread_id: int | None = None,
|
|
2451
|
+
game_short_name: str | None = None,
|
|
2452
|
+
disable_notification: bool | None = None,
|
|
2453
|
+
protect_content: bool | None = None,
|
|
2454
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2455
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2499
2456
|
**other: typing.Any,
|
|
2500
2457
|
) -> Result[MessageCute, APIError]:
|
|
2501
2458
|
"""Shortcut `API.send_game()`, see the [documentation](https://core.telegram.org/bots/api#sendgame)
|
|
@@ -2534,29 +2491,27 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2534
2491
|
provider_token: str,
|
|
2535
2492
|
currency: str,
|
|
2536
2493
|
prices: list[LabeledPrice],
|
|
2537
|
-
chat_id:
|
|
2538
|
-
message_thread_id:
|
|
2539
|
-
max_tip_amount:
|
|
2540
|
-
suggested_tip_amounts:
|
|
2541
|
-
start_parameter:
|
|
2542
|
-
provider_data:
|
|
2543
|
-
photo_url:
|
|
2544
|
-
photo_size:
|
|
2545
|
-
photo_width:
|
|
2546
|
-
photo_height:
|
|
2547
|
-
need_name:
|
|
2548
|
-
need_phone_number:
|
|
2549
|
-
need_email:
|
|
2550
|
-
need_shipping_address:
|
|
2551
|
-
send_phone_number_to_provider:
|
|
2552
|
-
send_email_to_provider:
|
|
2553
|
-
is_flexible:
|
|
2554
|
-
disable_notification:
|
|
2555
|
-
protect_content:
|
|
2556
|
-
reply_parameters:
|
|
2557
|
-
|
|
|
2558
|
-
| dict[str, typing.Any] = Nothing,
|
|
2559
|
-
reply_markup: Option[InlineKeyboardMarkup] | InlineKeyboardMarkup = Nothing,
|
|
2494
|
+
chat_id: int | str | None = None,
|
|
2495
|
+
message_thread_id: int | None = None,
|
|
2496
|
+
max_tip_amount: int | None = None,
|
|
2497
|
+
suggested_tip_amounts: list[int] | None = None,
|
|
2498
|
+
start_parameter: str | None = None,
|
|
2499
|
+
provider_data: str | None = None,
|
|
2500
|
+
photo_url: str | None = None,
|
|
2501
|
+
photo_size: int | None = None,
|
|
2502
|
+
photo_width: int | None = None,
|
|
2503
|
+
photo_height: int | None = None,
|
|
2504
|
+
need_name: bool | None = None,
|
|
2505
|
+
need_phone_number: bool | None = None,
|
|
2506
|
+
need_email: bool | None = None,
|
|
2507
|
+
need_shipping_address: bool | None = None,
|
|
2508
|
+
send_phone_number_to_provider: bool | None = None,
|
|
2509
|
+
send_email_to_provider: bool | None = None,
|
|
2510
|
+
is_flexible: bool | None = None,
|
|
2511
|
+
disable_notification: bool | None = None,
|
|
2512
|
+
protect_content: bool | None = None,
|
|
2513
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2514
|
+
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2560
2515
|
**other: typing.Any,
|
|
2561
2516
|
) -> Result[MessageCute, APIError]:
|
|
2562
2517
|
"""Shortcut `API.send_invoice()`, see the [documentation](https://core.telegram.org/bots/api#sendinvoice)
|
|
@@ -2653,16 +2608,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2653
2608
|
async def reply_media_group(
|
|
2654
2609
|
self,
|
|
2655
2610
|
media: list[InputMedia | tuple[MediaType, InputFile | str]],
|
|
2656
|
-
chat_id:
|
|
2657
|
-
message_thread_id:
|
|
2658
|
-
caption: str |
|
|
2659
|
-
parse_mode: str |
|
|
2660
|
-
caption_entities: list[MessageEntity] |
|
|
2661
|
-
disable_notification:
|
|
2662
|
-
protect_content:
|
|
2663
|
-
reply_parameters:
|
|
2664
|
-
| ReplyParameters
|
|
2665
|
-
| dict[str, typing.Any] = Nothing,
|
|
2611
|
+
chat_id: int | str | None = None,
|
|
2612
|
+
message_thread_id: int | None = None,
|
|
2613
|
+
caption: str | None = None,
|
|
2614
|
+
parse_mode: str | None = None,
|
|
2615
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
2616
|
+
disable_notification: bool | None = None,
|
|
2617
|
+
protect_content: bool | None = None,
|
|
2618
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2666
2619
|
**other: typing.Any,
|
|
2667
2620
|
) -> Result[list[MessageCute], APIError]:
|
|
2668
2621
|
"""Shortcut `API.send_media_group()`, see the [documentation](https://core.telegram.org/bots/api#sendmediagroup)
|
|
@@ -2707,18 +2660,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2707
2660
|
self,
|
|
2708
2661
|
latitude: float,
|
|
2709
2662
|
longitude: float,
|
|
2710
|
-
chat_id:
|
|
2711
|
-
message_thread_id:
|
|
2712
|
-
horizontal_accuracy:
|
|
2713
|
-
heading:
|
|
2714
|
-
live_period:
|
|
2715
|
-
proximity_alert_radius:
|
|
2716
|
-
disable_notification:
|
|
2717
|
-
protect_content:
|
|
2718
|
-
reply_parameters:
|
|
2719
|
-
|
|
|
2720
|
-
| dict[str, typing.Any] = Nothing,
|
|
2721
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
2663
|
+
chat_id: int | str | None = None,
|
|
2664
|
+
message_thread_id: int | None = None,
|
|
2665
|
+
horizontal_accuracy: float | None = None,
|
|
2666
|
+
heading: int | None = None,
|
|
2667
|
+
live_period: int | None = None,
|
|
2668
|
+
proximity_alert_radius: int | None = None,
|
|
2669
|
+
disable_notification: bool | None = None,
|
|
2670
|
+
protect_content: bool | None = None,
|
|
2671
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2672
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2722
2673
|
**other: typing.Any,
|
|
2723
2674
|
) -> Result[MessageCute, APIError]:
|
|
2724
2675
|
"""Shortcut `API.send_location()`, see the [documentation](https://core.telegram.org/bots/api#sendlocation)
|
|
@@ -2767,16 +2718,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2767
2718
|
self,
|
|
2768
2719
|
phone_number: str,
|
|
2769
2720
|
first_name: str,
|
|
2770
|
-
last_name:
|
|
2771
|
-
vcard:
|
|
2772
|
-
chat_id:
|
|
2773
|
-
message_thread_id:
|
|
2774
|
-
disable_notification:
|
|
2775
|
-
protect_content:
|
|
2776
|
-
reply_parameters:
|
|
2777
|
-
|
|
|
2778
|
-
| dict[str, typing.Any] = Nothing,
|
|
2779
|
-
reply_markup: Option[ReplyMarkup] | ReplyMarkup = Nothing,
|
|
2721
|
+
last_name: str | None = None,
|
|
2722
|
+
vcard: str | None = None,
|
|
2723
|
+
chat_id: int | str | None = None,
|
|
2724
|
+
message_thread_id: int | None = None,
|
|
2725
|
+
disable_notification: bool | None = None,
|
|
2726
|
+
protect_content: bool | None = None,
|
|
2727
|
+
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
2728
|
+
reply_markup: ReplyMarkup | None = None,
|
|
2780
2729
|
**other: typing.Any,
|
|
2781
2730
|
) -> Result[MessageCute, APIError]:
|
|
2782
2731
|
"""Shortcut `API.send_contact()`, see the [documentation](https://core.telegram.org/bots/api#sendcontact)
|
|
@@ -2818,13 +2767,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2818
2767
|
self,
|
|
2819
2768
|
latitude: float,
|
|
2820
2769
|
longitude: float,
|
|
2821
|
-
chat_id:
|
|
2822
|
-
message_id:
|
|
2823
|
-
message_thread_id:
|
|
2824
|
-
horizontal_accuracy:
|
|
2825
|
-
heading:
|
|
2826
|
-
proximity_alert_radius:
|
|
2827
|
-
reply_markup:
|
|
2770
|
+
chat_id: int | str | None = None,
|
|
2771
|
+
message_id: int | None = None,
|
|
2772
|
+
message_thread_id: int | None = None,
|
|
2773
|
+
horizontal_accuracy: float | None = None,
|
|
2774
|
+
heading: int | None = None,
|
|
2775
|
+
proximity_alert_radius: int | None = None,
|
|
2776
|
+
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2828
2777
|
**other: typing.Any,
|
|
2829
2778
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2830
2779
|
"""Shortcut `API.edit_message_live_location()`, see the [documentation](https://core.telegram.org/bots/api#editmessagelivelocation)
|
|
@@ -2866,13 +2815,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2866
2815
|
)
|
|
2867
2816
|
async def edit_caption(
|
|
2868
2817
|
self,
|
|
2869
|
-
caption:
|
|
2870
|
-
chat_id:
|
|
2871
|
-
message_id:
|
|
2872
|
-
message_thread_id: int |
|
|
2873
|
-
parse_mode:
|
|
2874
|
-
caption_entities:
|
|
2875
|
-
reply_markup:
|
|
2818
|
+
caption: str,
|
|
2819
|
+
chat_id: int | str | None = None,
|
|
2820
|
+
message_id: int | None = None,
|
|
2821
|
+
message_thread_id: int | None = None,
|
|
2822
|
+
parse_mode: str | None = None,
|
|
2823
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
2824
|
+
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2876
2825
|
**other: typing.Any,
|
|
2877
2826
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2878
2827
|
"""Shortcut `API.edit_message_caption()`, see the [documentation](https://core.telegram.org/bots/api#editmessagecaption)
|
|
@@ -2904,19 +2853,26 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2904
2853
|
|
|
2905
2854
|
@shortcut(
|
|
2906
2855
|
"edit_message_media",
|
|
2907
|
-
custom_params={
|
|
2856
|
+
custom_params={
|
|
2857
|
+
"media",
|
|
2858
|
+
"type",
|
|
2859
|
+
"message_thread_id",
|
|
2860
|
+
"caption",
|
|
2861
|
+
"parse_mode",
|
|
2862
|
+
"caption_entities",
|
|
2863
|
+
},
|
|
2908
2864
|
)
|
|
2909
2865
|
async def edit_media(
|
|
2910
2866
|
self,
|
|
2911
|
-
media:
|
|
2912
|
-
type: MediaType |
|
|
2913
|
-
caption:
|
|
2914
|
-
parse_mode:
|
|
2915
|
-
caption_entities:
|
|
2916
|
-
chat_id:
|
|
2917
|
-
message_id:
|
|
2918
|
-
message_thread_id:
|
|
2919
|
-
reply_markup:
|
|
2867
|
+
media: InputFile | InputMedia | str,
|
|
2868
|
+
type: MediaType | None = None,
|
|
2869
|
+
caption: str | None = None,
|
|
2870
|
+
parse_mode: str | None = None,
|
|
2871
|
+
caption_entities: list[MessageEntity] | None = None,
|
|
2872
|
+
chat_id: int | str | None = None,
|
|
2873
|
+
message_id: int | None = None,
|
|
2874
|
+
message_thread_id: int | None = None,
|
|
2875
|
+
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2920
2876
|
**other: typing.Any,
|
|
2921
2877
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2922
2878
|
"""Shortcut `API.edit_message_media()`, see the [documentation](https://core.telegram.org/bots/api#editmessagemedia)
|
|
@@ -2966,7 +2922,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2966
2922
|
caption_entities=caption_entities,
|
|
2967
2923
|
parse_mode=parse_mode,
|
|
2968
2924
|
)
|
|
2969
|
-
|
|
2925
|
+
|
|
2970
2926
|
return await execute_method_edit(self, "edit_message_media", params)
|
|
2971
2927
|
|
|
2972
2928
|
@shortcut(
|
|
@@ -2976,10 +2932,10 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2976
2932
|
)
|
|
2977
2933
|
async def edit_reply_markup(
|
|
2978
2934
|
self,
|
|
2979
|
-
chat_id:
|
|
2980
|
-
message_id:
|
|
2981
|
-
message_thread_id:
|
|
2982
|
-
reply_markup:
|
|
2935
|
+
chat_id: int | str | None = None,
|
|
2936
|
+
message_id: int | None = None,
|
|
2937
|
+
message_thread_id: int | None = None,
|
|
2938
|
+
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2983
2939
|
**other: typing.Any,
|
|
2984
2940
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2985
2941
|
"""Shortcut `API.edit_message_reply_markup()`, see the [documentation](https://core.telegram.org/bots/api#editmessagereplymarkup)
|