telegrinder 0.1.dev168__py3-none-any.whl → 0.1.dev170__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of telegrinder might be problematic. Click here for more details.
- telegrinder/__init__.py +9 -3
- telegrinder/bot/__init__.py +7 -5
- telegrinder/bot/cute_types/base.py +12 -14
- telegrinder/bot/cute_types/callback_query.py +54 -43
- telegrinder/bot/cute_types/chat_join_request.py +8 -7
- telegrinder/bot/cute_types/chat_member_updated.py +23 -17
- telegrinder/bot/cute_types/inline_query.py +1 -1
- telegrinder/bot/cute_types/message.py +331 -183
- telegrinder/bot/cute_types/update.py +4 -8
- telegrinder/bot/cute_types/utils.py +1 -5
- telegrinder/bot/dispatch/__init__.py +2 -3
- telegrinder/bot/dispatch/abc.py +4 -0
- telegrinder/bot/dispatch/context.py +9 -4
- telegrinder/bot/dispatch/dispatch.py +35 -33
- telegrinder/bot/dispatch/handler/func.py +34 -13
- telegrinder/bot/dispatch/handler/message_reply.py +6 -3
- telegrinder/bot/dispatch/middleware/abc.py +4 -4
- telegrinder/bot/dispatch/process.py +40 -13
- telegrinder/bot/dispatch/return_manager/abc.py +12 -12
- telegrinder/bot/dispatch/return_manager/callback_query.py +1 -3
- telegrinder/bot/dispatch/return_manager/inline_query.py +1 -3
- telegrinder/bot/dispatch/view/abc.py +37 -45
- telegrinder/bot/dispatch/view/box.py +66 -50
- telegrinder/bot/dispatch/view/message.py +1 -5
- telegrinder/bot/dispatch/view/raw.py +6 -6
- telegrinder/bot/dispatch/waiter_machine/__init__.py +2 -1
- telegrinder/bot/dispatch/waiter_machine/machine.py +77 -35
- telegrinder/bot/dispatch/waiter_machine/middleware.py +31 -7
- telegrinder/bot/dispatch/waiter_machine/short_state.py +17 -8
- telegrinder/bot/polling/polling.py +4 -4
- telegrinder/bot/rules/__init__.py +9 -6
- telegrinder/bot/rules/abc.py +99 -22
- telegrinder/bot/rules/adapter/__init__.py +4 -1
- telegrinder/bot/rules/adapter/abc.py +11 -6
- telegrinder/bot/rules/adapter/errors.py +1 -2
- telegrinder/bot/rules/adapter/event.py +14 -9
- telegrinder/bot/rules/adapter/node.py +42 -0
- telegrinder/bot/rules/callback_data.py +4 -4
- telegrinder/bot/rules/chat_join.py +3 -2
- telegrinder/bot/rules/command.py +26 -14
- telegrinder/bot/rules/enum_text.py +5 -5
- telegrinder/bot/rules/func.py +6 -6
- telegrinder/bot/rules/fuzzy.py +5 -7
- telegrinder/bot/rules/inline.py +4 -5
- telegrinder/bot/rules/integer.py +10 -8
- telegrinder/bot/rules/is_from.py +63 -91
- telegrinder/bot/rules/markup.py +5 -5
- telegrinder/bot/rules/mention.py +4 -4
- telegrinder/bot/rules/message.py +1 -1
- telegrinder/bot/rules/node.py +27 -0
- telegrinder/bot/rules/regex.py +5 -5
- telegrinder/bot/rules/rule_enum.py +4 -4
- telegrinder/bot/rules/start.py +5 -5
- telegrinder/bot/rules/text.py +9 -13
- telegrinder/bot/rules/update.py +4 -4
- telegrinder/bot/scenario/__init__.py +3 -3
- telegrinder/bot/scenario/choice.py +2 -3
- telegrinder/model.py +51 -16
- telegrinder/modules.py +14 -6
- telegrinder/msgspec_utils.py +67 -23
- telegrinder/node/__init__.py +26 -8
- telegrinder/node/attachment.py +13 -9
- telegrinder/node/base.py +27 -14
- telegrinder/node/callback_query.py +18 -0
- telegrinder/node/command.py +29 -0
- telegrinder/node/composer.py +119 -30
- telegrinder/node/me.py +14 -0
- telegrinder/node/message.py +2 -4
- telegrinder/node/polymorphic.py +44 -0
- telegrinder/node/rule.py +26 -22
- telegrinder/node/scope.py +36 -0
- telegrinder/node/source.py +37 -10
- telegrinder/node/text.py +11 -5
- telegrinder/node/tools/__init__.py +2 -2
- telegrinder/node/tools/generator.py +6 -6
- telegrinder/tools/__init__.py +8 -13
- telegrinder/tools/buttons.py +23 -17
- telegrinder/tools/error_handler/error_handler.py +11 -14
- telegrinder/tools/formatting/__init__.py +0 -6
- telegrinder/tools/formatting/html.py +10 -12
- telegrinder/tools/formatting/links.py +0 -5
- telegrinder/tools/formatting/spec_html_formats.py +0 -11
- telegrinder/tools/global_context/abc.py +1 -3
- telegrinder/tools/global_context/global_context.py +6 -16
- telegrinder/tools/i18n/simple.py +1 -3
- telegrinder/tools/kb_set/yaml.py +1 -2
- telegrinder/tools/keyboard.py +7 -8
- telegrinder/tools/limited_dict.py +1 -1
- telegrinder/tools/loop_wrapper/loop_wrapper.py +6 -5
- telegrinder/tools/magic.py +27 -5
- telegrinder/types/__init__.py +20 -0
- telegrinder/types/enums.py +37 -31
- telegrinder/types/methods.py +608 -327
- telegrinder/types/objects.py +1139 -716
- {telegrinder-0.1.dev168.dist-info → telegrinder-0.1.dev170.dist-info}/LICENSE +1 -1
- {telegrinder-0.1.dev168.dist-info → telegrinder-0.1.dev170.dist-info}/METADATA +6 -5
- telegrinder-0.1.dev170.dist-info/RECORD +143 -0
- telegrinder/bot/dispatch/composition.py +0 -88
- telegrinder-0.1.dev168.dist-info/RECORD +0 -137
- {telegrinder-0.1.dev168.dist-info → telegrinder-0.1.dev170.dist-info}/WHEEL +0 -0
|
@@ -39,7 +39,8 @@ from .utils import (
|
|
|
39
39
|
if typing.TYPE_CHECKING:
|
|
40
40
|
from datetime import datetime
|
|
41
41
|
|
|
42
|
-
from .callback_query import CallbackQueryCute
|
|
42
|
+
from telegrinder.bot.cute_types.callback_query import CallbackQueryCute
|
|
43
|
+
|
|
43
44
|
|
|
44
45
|
MediaType: typing.TypeAlias = typing.Literal[
|
|
45
46
|
"animation",
|
|
@@ -48,12 +49,7 @@ MediaType: typing.TypeAlias = typing.Literal[
|
|
|
48
49
|
"photo",
|
|
49
50
|
"video",
|
|
50
51
|
]
|
|
51
|
-
ReplyMarkup: typing.TypeAlias =
|
|
52
|
-
InlineKeyboardMarkup,
|
|
53
|
-
ReplyKeyboardMarkup,
|
|
54
|
-
ReplyKeyboardRemove,
|
|
55
|
-
ForceReply,
|
|
56
|
-
]
|
|
52
|
+
ReplyMarkup: typing.TypeAlias = InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply
|
|
57
53
|
|
|
58
54
|
|
|
59
55
|
async def execute_method_answer(
|
|
@@ -84,9 +80,9 @@ async def execute_method_answer(
|
|
|
84
80
|
x
|
|
85
81
|
if isinstance(x, bool)
|
|
86
82
|
else (
|
|
87
|
-
|
|
83
|
+
message.from_update(x, bound_api=message.api)
|
|
88
84
|
if not isinstance(x, list)
|
|
89
|
-
else [
|
|
85
|
+
else [message.from_update(m, bound_api=message.api) for m in x]
|
|
90
86
|
)
|
|
91
87
|
)
|
|
92
88
|
)
|
|
@@ -124,12 +120,14 @@ async def execute_method_edit(
|
|
|
124
120
|
),
|
|
125
121
|
},
|
|
126
122
|
)
|
|
123
|
+
|
|
127
124
|
if "inline_message_id" in params:
|
|
128
125
|
params.pop("message_id", None)
|
|
129
126
|
params.pop("chat_id", None)
|
|
127
|
+
|
|
130
128
|
result = await getattr(update.ctx_api, method_name)(**params)
|
|
131
129
|
return result.map(
|
|
132
|
-
lambda v: Variative[MessageCute, bool](
|
|
130
|
+
lambda v: Variative["MessageCute", bool](
|
|
133
131
|
v.only()
|
|
134
132
|
.map(
|
|
135
133
|
lambda x: MessageCute.from_update(x, bound_api=update.api),
|
|
@@ -183,7 +181,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
183
181
|
@shortcut(
|
|
184
182
|
"send_message",
|
|
185
183
|
executor=execute_method_answer,
|
|
186
|
-
custom_params={"link_preview_options", "reply_parameters", "message_thread_id"},
|
|
184
|
+
custom_params={"link_preview_options", "reply_parameters", "message_thread_id", "chat_id", "text"},
|
|
187
185
|
)
|
|
188
186
|
async def answer(
|
|
189
187
|
self,
|
|
@@ -191,6 +189,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
191
189
|
chat_id: int | str | None = None,
|
|
192
190
|
message_thread_id: int | None = None,
|
|
193
191
|
business_connection_id: str | None = None,
|
|
192
|
+
message_effect_id: str | None = None,
|
|
194
193
|
parse_mode: str | None = None,
|
|
195
194
|
entities: list[MessageEntity] | None = None,
|
|
196
195
|
disable_notification: bool | None = None,
|
|
@@ -221,6 +220,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
221
220
|
:param entities: A JSON-serialized list of special entities that appear in message text, \
|
|
222
221
|
which can be specified instead of parse_mode.
|
|
223
222
|
|
|
223
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
224
|
+
chats only.
|
|
225
|
+
|
|
224
226
|
:param link_preview_options: Link preview generation options for the message.
|
|
225
227
|
|
|
226
228
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
@@ -238,7 +240,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
238
240
|
@shortcut(
|
|
239
241
|
"send_message",
|
|
240
242
|
executor=execute_method_reply,
|
|
241
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
243
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id", "message_id"},
|
|
242
244
|
)
|
|
243
245
|
async def reply(
|
|
244
246
|
self,
|
|
@@ -247,6 +249,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
247
249
|
message_id: int | None = None,
|
|
248
250
|
message_thread_id: int | None = None,
|
|
249
251
|
business_connection_id: str | None = None,
|
|
252
|
+
message_effect_id: str | None = None,
|
|
250
253
|
parse_mode: str | None = None,
|
|
251
254
|
entities: list[MessageEntity] | None = None,
|
|
252
255
|
disable_notification: bool | None = None,
|
|
@@ -261,8 +264,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
261
264
|
Use this method to send a reply to a message with text messages. On success, the sent Message is returned.
|
|
262
265
|
|
|
263
266
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
264
|
-
will be sent.
|
|
265
|
-
|
|
267
|
+
will be sent.
|
|
268
|
+
|
|
266
269
|
:param chat_id: Unique identifier for the target chat or username of the target channel \
|
|
267
270
|
(in the format @channelusername).
|
|
268
271
|
|
|
@@ -277,6 +280,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
277
280
|
:param entities: A JSON-serialized list of special entities that appear in message text, \
|
|
278
281
|
which can be specified instead of parse_mode.
|
|
279
282
|
|
|
283
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
284
|
+
chats only.
|
|
285
|
+
|
|
280
286
|
:param link_preview_options: Link preview generation options for the message.
|
|
281
287
|
|
|
282
288
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
@@ -291,7 +297,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
291
297
|
|
|
292
298
|
...
|
|
293
299
|
|
|
294
|
-
@shortcut("delete_message", custom_params={"message_thread_id"})
|
|
300
|
+
@shortcut("delete_message", custom_params={"message_thread_id", "chat_id", "message_id"})
|
|
295
301
|
async def delete(
|
|
296
302
|
self,
|
|
297
303
|
chat_id: int | None = None,
|
|
@@ -301,16 +307,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
301
307
|
) -> Result[bool, APIError]:
|
|
302
308
|
"""Shortcut `API.delete_message()`, see the [documentation](https://core.telegram.org/bots/api#deletemessage)
|
|
303
309
|
|
|
304
|
-
Use this method to delete a message, including service messages, with the
|
|
305
|
-
following limitations: - A message can only be deleted if it was sent less
|
|
306
|
-
than 48 hours ago. - Service messages about a supergroup, channel, or forum
|
|
307
|
-
topic creation can't be deleted. - A dice message in a private chat can only
|
|
308
|
-
be deleted if it was sent more than 24 hours ago. - Bots can delete outgoing
|
|
309
|
-
messages in private chats, groups, and supergroups. - Bots can delete incoming
|
|
310
|
-
messages in private chats. - Bots granted can_post_messages permissions
|
|
311
|
-
can delete outgoing messages in channels. - If the bot is an administrator
|
|
312
|
-
of a group, it can delete any message there. - If the bot has can_delete_messages
|
|
313
|
-
permission in a supergroup or a channel, it can delete any message there.
|
|
310
|
+
Use this method to delete a message, including service messages, with the
|
|
311
|
+
following limitations: - A message can only be deleted if it was sent less
|
|
312
|
+
than 48 hours ago. - Service messages about a supergroup, channel, or forum
|
|
313
|
+
topic creation can't be deleted. - A dice message in a private chat can only
|
|
314
|
+
be deleted if it was sent more than 24 hours ago. - Bots can delete outgoing
|
|
315
|
+
messages in private chats, groups, and supergroups. - Bots can delete incoming
|
|
316
|
+
messages in private chats. - Bots granted can_post_messages permissions
|
|
317
|
+
can delete outgoing messages in channels. - If the bot is an administrator
|
|
318
|
+
of a group, it can delete any message there. - If the bot has can_delete_messages
|
|
319
|
+
permission in a supergroup or a channel, it can delete any message there.
|
|
314
320
|
Returns True on success.
|
|
315
321
|
|
|
316
322
|
:param chat_id: Unique identifier for the target chat or username of the target channel \
|
|
@@ -332,7 +338,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
332
338
|
@shortcut(
|
|
333
339
|
"edit_message_text",
|
|
334
340
|
executor=execute_method_edit,
|
|
335
|
-
custom_params={"link_preview_options", "message_thread_id"},
|
|
341
|
+
custom_params={"link_preview_options", "message_thread_id", "message_id"},
|
|
336
342
|
)
|
|
337
343
|
async def edit(
|
|
338
344
|
self,
|
|
@@ -348,8 +354,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
348
354
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
349
355
|
"""Shortcut `API.edit_message_text()`, see the [documentation](https://core.telegram.org/bots/api#editmessagetext)
|
|
350
356
|
|
|
351
|
-
Use this method to edit text and game messages. On success, if the edited
|
|
352
|
-
message is not an inline message, the edited Message is returned, otherwise
|
|
357
|
+
Use this method to edit text and game messages. On success, if the edited
|
|
358
|
+
message is not an inline message, the edited Message is returned, otherwise
|
|
353
359
|
True is returned.
|
|
354
360
|
|
|
355
361
|
:param chat_id: Required if inline_message_id is not specified. Unique identifier for \
|
|
@@ -377,7 +383,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
377
383
|
|
|
378
384
|
@shortcut(
|
|
379
385
|
"copy_message",
|
|
380
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
386
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id", "message_id", "from_chat_id"},
|
|
381
387
|
)
|
|
382
388
|
async def copy(
|
|
383
389
|
self,
|
|
@@ -396,11 +402,11 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
396
402
|
) -> Result[MessageId, APIError]:
|
|
397
403
|
"""Shortcut `API.copy_message()`, see the [documentation](https://core.telegram.org/bots/api#copymessage)
|
|
398
404
|
|
|
399
|
-
Use this method to copy messages of any kind. Service messages, giveaway
|
|
400
|
-
messages, giveaway winners messages, and invoice messages can't be copied.
|
|
401
|
-
A quiz poll can be copied only if the value of the field correct_option_id
|
|
402
|
-
is known to the bot. The method is analogous to the method forwardMessage,
|
|
403
|
-
but the copied message doesn't have a link to the original message. Returns
|
|
405
|
+
Use this method to copy messages of any kind. Service messages, giveaway
|
|
406
|
+
messages, giveaway winners messages, and invoice messages can't be copied.
|
|
407
|
+
A quiz poll can be copied only if the value of the field correct_option_id
|
|
408
|
+
is known to the bot. The method is analogous to the method forwardMessage,
|
|
409
|
+
but the copied message doesn't have a link to the original message. Returns
|
|
404
410
|
the MessageId of the sent message on success.
|
|
405
411
|
|
|
406
412
|
:param chat_id: Unique identifier for the target chat or username of the target channel \
|
|
@@ -453,7 +459,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
453
459
|
|
|
454
460
|
@shortcut(
|
|
455
461
|
"set_message_reaction",
|
|
456
|
-
custom_params={"message_thread_id"},
|
|
462
|
+
custom_params={"message_thread_id", "reaction", "chat_id", "message_id"},
|
|
457
463
|
)
|
|
458
464
|
async def react(
|
|
459
465
|
self,
|
|
@@ -468,9 +474,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
468
474
|
) -> Result[bool, APIError]:
|
|
469
475
|
"""Shortcut `API.set_message_reaction()`, see the [documentation](https://core.telegram.org/bots/api#setmessagereaction)
|
|
470
476
|
|
|
471
|
-
Use this method to change the chosen reactions on a message. Service messages
|
|
472
|
-
can't be reacted to. Automatically forwarded messages from a channel to
|
|
473
|
-
its discussion group have the same available reactions as messages in the
|
|
477
|
+
Use this method to change the chosen reactions on a message. Service messages
|
|
478
|
+
can't be reacted to. Automatically forwarded messages from a channel to
|
|
479
|
+
its discussion group have the same available reactions as messages in the
|
|
474
480
|
channel. Returns True on success.
|
|
475
481
|
|
|
476
482
|
:param chat_id: Unique identifier for the target chat or username of the target channel \
|
|
@@ -502,7 +508,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
502
508
|
)
|
|
503
509
|
return await self.ctx_api.set_message_reaction(**params)
|
|
504
510
|
|
|
505
|
-
@shortcut("forward_message", custom_params={"message_thread_id"})
|
|
511
|
+
@shortcut("forward_message", custom_params={"message_thread_id", "from_chat_id", "message_id"})
|
|
506
512
|
async def forward(
|
|
507
513
|
self,
|
|
508
514
|
chat_id: int | str,
|
|
@@ -515,8 +521,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
515
521
|
) -> Result[MessageCute, APIError]:
|
|
516
522
|
"""Shortcut `API.forward_message()`, see the [documentation](https://core.telegram.org/bots/api#forwardmessage)
|
|
517
523
|
|
|
518
|
-
Use this method to forward messages of any kind. Service messages and messages
|
|
519
|
-
with protected content can't be forwarded. On success, the sent Message
|
|
524
|
+
Use this method to forward messages of any kind. Service messages and messages
|
|
525
|
+
with protected content can't be forwarded. On success, the sent Message
|
|
520
526
|
is returned.
|
|
521
527
|
|
|
522
528
|
:param chat_id: Unique identifier for the target chat or username of the target channel \
|
|
@@ -548,7 +554,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
548
554
|
lambda message: MessageCute.from_update(message, bound_api=self.api),
|
|
549
555
|
)
|
|
550
556
|
|
|
551
|
-
@shortcut("pin_chat_message", custom_params={"message_thread_id"})
|
|
557
|
+
@shortcut("pin_chat_message", custom_params={"message_thread_id", "chat_id", "message_id"})
|
|
552
558
|
async def pin(
|
|
553
559
|
self,
|
|
554
560
|
chat_id: int | str | None = None,
|
|
@@ -559,10 +565,10 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
559
565
|
) -> Result[bool, "APIError"]:
|
|
560
566
|
"""Shortcut `API.pin_chat_message()`, see the [documentation](https://core.telegram.org/bots/api#pinchatmessage)
|
|
561
567
|
|
|
562
|
-
Use this method to add a message to the list of pinned messages in a chat. If
|
|
563
|
-
the chat is not a private chat, the bot must be an administrator in the chat
|
|
564
|
-
for this to work and must have the 'can_pin_messages' administrator right
|
|
565
|
-
in a supergroup or 'can_edit_messages' administrator right in a channel.
|
|
568
|
+
Use this method to add a message to the list of pinned messages in a chat. If
|
|
569
|
+
the chat is not a private chat, the bot must be an administrator in the chat
|
|
570
|
+
for this to work and must have the 'can_pin_messages' administrator right
|
|
571
|
+
in a supergroup or 'can_edit_messages' administrator right in a channel.
|
|
566
572
|
Returns True on success.
|
|
567
573
|
|
|
568
574
|
:param chat_id: Unique identifier for the target chat or username of the target channel \
|
|
@@ -586,7 +592,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
586
592
|
)
|
|
587
593
|
return await self.ctx_api.pin_chat_message(**params)
|
|
588
594
|
|
|
589
|
-
@shortcut("unpin_chat_message", custom_params={"message_thread_id"})
|
|
595
|
+
@shortcut("unpin_chat_message", custom_params={"message_thread_id", "chat_id", "message_id"})
|
|
590
596
|
async def unpin(
|
|
591
597
|
self,
|
|
592
598
|
chat_id: int | str | None = None,
|
|
@@ -596,10 +602,10 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
596
602
|
) -> Result[bool, "APIError"]:
|
|
597
603
|
"""Shortcut `API.unpin_chat_message()`, see the [documentation](https://core.telegram.org/bots/api#unpinchatmessage)
|
|
598
604
|
|
|
599
|
-
Use this method to remove a message from the list of pinned messages in a chat.
|
|
600
|
-
If the chat is not a private chat, the bot must be an administrator in the chat
|
|
601
|
-
for this to work and must have the 'can_pin_messages' administrator right
|
|
602
|
-
in a supergroup or 'can_edit_messages' administrator right in a channel.
|
|
605
|
+
Use this method to remove a message from the list of pinned messages in a chat.
|
|
606
|
+
If the chat is not a private chat, the bot must be an administrator in the chat
|
|
607
|
+
for this to work and must have the 'can_pin_messages' administrator right
|
|
608
|
+
in a supergroup or 'can_edit_messages' administrator right in a channel.
|
|
603
609
|
Returns True on success.
|
|
604
610
|
|
|
605
611
|
:param chat_id: Unique identifier for the target chat or username of the target channel \
|
|
@@ -620,7 +626,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
620
626
|
@shortcut(
|
|
621
627
|
"send_audio",
|
|
622
628
|
executor=execute_method_answer,
|
|
623
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
629
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
624
630
|
)
|
|
625
631
|
async def answer_audio(
|
|
626
632
|
self,
|
|
@@ -628,6 +634,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
628
634
|
chat_id: int | str | None = None,
|
|
629
635
|
message_thread_id: int | None = None,
|
|
630
636
|
business_connection_id: str | None = None,
|
|
637
|
+
message_effect_id: str | None = None,
|
|
631
638
|
caption: str | None = None,
|
|
632
639
|
parse_mode: str | None = None,
|
|
633
640
|
caption_entities: list[MessageEntity] | None = None,
|
|
@@ -643,10 +650,10 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
643
650
|
) -> Result[MessageCute, APIError]:
|
|
644
651
|
"""Shortcut `API.send_audio()`, see the [documentation](https://core.telegram.org/bots/api#sendaudio)
|
|
645
652
|
|
|
646
|
-
Use this method to send audio files, if you want Telegram clients to display
|
|
647
|
-
them in the music player. Your audio must be in the .MP3 or .M4A format. On
|
|
648
|
-
success, the sent Message is returned. Bots can currently send audio files
|
|
649
|
-
of up to 50 MB in size, this limit may be changed in the future. For sending
|
|
653
|
+
Use this method to send audio files, if you want Telegram clients to display
|
|
654
|
+
them in the music player. Your audio must be in the .MP3 or .M4A format. On
|
|
655
|
+
success, the sent Message is returned. Bots can currently send audio files
|
|
656
|
+
of up to 50 MB in size, this limit may be changed in the future. For sending
|
|
650
657
|
voice messages, use the sendVoice method instead.
|
|
651
658
|
|
|
652
659
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -658,6 +665,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
658
665
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
659
666
|
forum supergroups only.
|
|
660
667
|
|
|
668
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
669
|
+
chats only.
|
|
670
|
+
|
|
661
671
|
:param audio: Audio file to send. Pass a file_id as String to send an audio file that exists \
|
|
662
672
|
on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram \
|
|
663
673
|
to get an audio file from the Internet, or upload a new one using multipart/form-data. \
|
|
@@ -700,7 +710,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
700
710
|
@shortcut(
|
|
701
711
|
"send_animation",
|
|
702
712
|
executor=execute_method_answer,
|
|
703
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
713
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
704
714
|
)
|
|
705
715
|
async def answer_animation(
|
|
706
716
|
self,
|
|
@@ -708,9 +718,11 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
708
718
|
chat_id: int | str | None = None,
|
|
709
719
|
message_thread_id: int | None = None,
|
|
710
720
|
business_connection_id: str | None = None,
|
|
721
|
+
message_effect_id: str | None = None,
|
|
711
722
|
caption: str | None = None,
|
|
712
723
|
parse_mode: str | None = None,
|
|
713
724
|
caption_entities: list[MessageEntity] | None = None,
|
|
725
|
+
show_caption_above_media: bool | None = None,
|
|
714
726
|
duration: int | None = None,
|
|
715
727
|
width: int | None = None,
|
|
716
728
|
height: int | None = None,
|
|
@@ -724,8 +736,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
724
736
|
) -> Result[MessageCute, APIError]:
|
|
725
737
|
"""Shortcut `API.send_animation()`, see the [documentation](https://core.telegram.org/bots/api#sendanimation)
|
|
726
738
|
|
|
727
|
-
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without
|
|
728
|
-
sound). On success, the sent Message is returned. Bots can currently send
|
|
739
|
+
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without
|
|
740
|
+
sound). On success, the sent Message is returned. Bots can currently send
|
|
729
741
|
animation files of up to 50 MB in size, this limit may be changed in the future.
|
|
730
742
|
|
|
731
743
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -737,6 +749,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
737
749
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
738
750
|
forum supergroups only.
|
|
739
751
|
|
|
752
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
753
|
+
chats only.
|
|
754
|
+
|
|
740
755
|
:param animation: Animation to send. Pass a file_id as String to send an animation that exists \
|
|
741
756
|
on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram \
|
|
742
757
|
to get an animation from the Internet, or upload a new animation using multipart/form-data. \
|
|
@@ -765,6 +780,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
765
780
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, \
|
|
766
781
|
which can be specified instead of parse_mode.
|
|
767
782
|
|
|
783
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
784
|
+
|
|
768
785
|
:param has_spoiler: Pass True if the animation needs to be covered with a spoiler animation. \
|
|
769
786
|
|
|
770
787
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
@@ -782,7 +799,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
782
799
|
@shortcut(
|
|
783
800
|
"send_document",
|
|
784
801
|
executor=execute_method_answer,
|
|
785
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
802
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
786
803
|
)
|
|
787
804
|
async def answer_document(
|
|
788
805
|
self,
|
|
@@ -790,10 +807,12 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
790
807
|
chat_id: int | str | None = None,
|
|
791
808
|
message_thread_id: int | None = None,
|
|
792
809
|
business_connection_id: str | None = None,
|
|
810
|
+
message_effect_id: str | None = None,
|
|
793
811
|
caption: str | None = None,
|
|
794
812
|
parse_mode: str | None = None,
|
|
795
813
|
caption_entities: list[MessageEntity] | None = None,
|
|
796
814
|
disable_content_type_detection: bool | None = None,
|
|
815
|
+
show_caption_above_media: bool | None = None,
|
|
797
816
|
thumbnail: InputFile | str | None = None,
|
|
798
817
|
disable_notification: bool | None = None,
|
|
799
818
|
protect_content: bool | None = None,
|
|
@@ -803,13 +822,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
803
822
|
) -> Result[MessageCute, APIError]:
|
|
804
823
|
"""Shortcut `API.send_document()`, see the [documentation](https://core.telegram.org/bots/api#senddocument)
|
|
805
824
|
|
|
806
|
-
Use this method to send general files. On success, the sent Message is returned.
|
|
807
|
-
Bots can currently send files of any type of up to 50 MB in size, this limit
|
|
825
|
+
Use this method to send general files. On success, the sent Message is returned.
|
|
826
|
+
Bots can currently send files of any type of up to 50 MB in size, this limit
|
|
808
827
|
may be changed in the future.
|
|
809
828
|
|
|
810
829
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
811
830
|
will be sent.
|
|
812
831
|
|
|
832
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
833
|
+
chats only.
|
|
834
|
+
|
|
813
835
|
:param chat_id: Unique identifier for the target chat or username of the target channel \
|
|
814
836
|
(in the format @channelusername).
|
|
815
837
|
|
|
@@ -841,6 +863,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
841
863
|
:param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded \
|
|
842
864
|
using multipart/form-data.
|
|
843
865
|
|
|
866
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
867
|
+
|
|
844
868
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
845
869
|
|
|
846
870
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
@@ -856,7 +880,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
856
880
|
@shortcut(
|
|
857
881
|
"send_photo",
|
|
858
882
|
executor=execute_method_answer,
|
|
859
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
883
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
860
884
|
)
|
|
861
885
|
async def answer_photo(
|
|
862
886
|
self,
|
|
@@ -864,9 +888,11 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
864
888
|
chat_id: int | str | None = None,
|
|
865
889
|
message_thread_id: int | None = None,
|
|
866
890
|
business_connection_id: str | None = None,
|
|
891
|
+
message_effect_id: str | None = None,
|
|
867
892
|
caption: str | None = None,
|
|
868
893
|
parse_mode: str | None = None,
|
|
869
894
|
caption_entities: list[MessageEntity] | None = None,
|
|
895
|
+
show_caption_above_media: bool | None = None,
|
|
870
896
|
has_spoiler: bool | None = None,
|
|
871
897
|
disable_notification: bool | None = None,
|
|
872
898
|
protect_content: bool | None = None,
|
|
@@ -887,6 +913,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
887
913
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
888
914
|
forum supergroups only.
|
|
889
915
|
|
|
916
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
917
|
+
chats only.
|
|
918
|
+
|
|
890
919
|
:param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram \
|
|
891
920
|
servers (recommended), pass an HTTP URL as a String for Telegram to get a \
|
|
892
921
|
photo from the Internet, or upload a new photo using multipart/form-data. \
|
|
@@ -909,6 +938,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
909
938
|
|
|
910
939
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
911
940
|
|
|
941
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
942
|
+
|
|
912
943
|
:param reply_parameters: Description of the message to reply to.
|
|
913
944
|
|
|
914
945
|
:param reply_markup: Additional interface options. A JSON-serialized object for an inline \
|
|
@@ -920,7 +951,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
920
951
|
@shortcut(
|
|
921
952
|
"send_sticker",
|
|
922
953
|
executor=execute_method_answer,
|
|
923
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
954
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
924
955
|
)
|
|
925
956
|
async def answer_sticker(
|
|
926
957
|
self,
|
|
@@ -928,6 +959,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
928
959
|
chat_id: int | str | None = None,
|
|
929
960
|
emoji: str | None = None,
|
|
930
961
|
message_thread_id: int | None = None,
|
|
962
|
+
message_effect_id: str | None = None,
|
|
931
963
|
business_connection_id: str | None = None,
|
|
932
964
|
disable_notification: bool | None = None,
|
|
933
965
|
protect_content: bool | None = None,
|
|
@@ -937,7 +969,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
937
969
|
) -> Result[MessageCute, APIError]:
|
|
938
970
|
"""Shortcut `API.send_sticker()`, see the [documentation](https://core.telegram.org/bots/api#sendsticker)
|
|
939
971
|
|
|
940
|
-
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
|
|
972
|
+
Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers.
|
|
941
973
|
On success, the sent Message is returned.
|
|
942
974
|
|
|
943
975
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -949,6 +981,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
949
981
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
950
982
|
forum supergroups only.
|
|
951
983
|
|
|
984
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
985
|
+
chats only.
|
|
986
|
+
|
|
952
987
|
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the \
|
|
953
988
|
Telegram servers (recommended), pass an HTTP URL as a String for Telegram \
|
|
954
989
|
to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker \
|
|
@@ -973,23 +1008,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
973
1008
|
@shortcut(
|
|
974
1009
|
"send_video",
|
|
975
1010
|
executor=execute_method_answer,
|
|
976
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1011
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
977
1012
|
)
|
|
978
1013
|
async def answer_video(
|
|
979
1014
|
self,
|
|
980
1015
|
video: InputFile | str,
|
|
981
1016
|
chat_id: int | str | None = None,
|
|
1017
|
+
emoji: str | None = None,
|
|
982
1018
|
message_thread_id: int | None = None,
|
|
1019
|
+
message_effect_id: str | None = None,
|
|
983
1020
|
business_connection_id: str | None = None,
|
|
984
|
-
caption: str | None = None,
|
|
985
|
-
parse_mode: str | None = None,
|
|
986
|
-
caption_entities: list[MessageEntity] | None = None,
|
|
987
|
-
duration: int | None = None,
|
|
988
|
-
width: int | None = None,
|
|
989
|
-
height: int | None = None,
|
|
990
|
-
thumbnail: InputFile | str | None = None,
|
|
991
|
-
has_spoiler: bool | None = None,
|
|
992
|
-
supports_streaming: bool | None = None,
|
|
993
1021
|
disable_notification: bool | None = None,
|
|
994
1022
|
protect_content: bool | None = None,
|
|
995
1023
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -998,9 +1026,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
998
1026
|
) -> Result[MessageCute, APIError]:
|
|
999
1027
|
"""Shortcut `API.send_video()`, see the [documentation](https://core.telegram.org/bots/api#sendvideo)
|
|
1000
1028
|
|
|
1001
|
-
Use this method to send video files, Telegram clients support MPEG4 videos
|
|
1002
|
-
(other formats may be sent as Document). On success, the sent Message is
|
|
1003
|
-
returned. Bots can currently send video files of up to 50 MB in size, this
|
|
1029
|
+
Use this method to send video files, Telegram clients support MPEG4 videos
|
|
1030
|
+
(other formats may be sent as Document). On success, the sent Message is
|
|
1031
|
+
returned. Bots can currently send video files of up to 50 MB in size, this
|
|
1004
1032
|
limit may be changed in the future.
|
|
1005
1033
|
|
|
1006
1034
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1012,6 +1040,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1012
1040
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1013
1041
|
forum supergroups only.
|
|
1014
1042
|
|
|
1043
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1044
|
+
chats only.
|
|
1045
|
+
|
|
1015
1046
|
:param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram \
|
|
1016
1047
|
servers (recommended), pass an HTTP URL as a String for Telegram to get a \
|
|
1017
1048
|
video from the Internet, or upload a new video using multipart/form-data. \
|
|
@@ -1046,6 +1077,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1046
1077
|
|
|
1047
1078
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
1048
1079
|
|
|
1080
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
1081
|
+
|
|
1049
1082
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1050
1083
|
|
|
1051
1084
|
:param reply_parameters: Description of the message to reply to.
|
|
@@ -1059,13 +1092,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1059
1092
|
@shortcut(
|
|
1060
1093
|
"send_video_note",
|
|
1061
1094
|
executor=execute_method_answer,
|
|
1062
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1095
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1063
1096
|
)
|
|
1064
1097
|
async def answer_video_note(
|
|
1065
1098
|
self,
|
|
1066
1099
|
video_note: InputFile | str,
|
|
1067
1100
|
chat_id: int | str | None = None,
|
|
1068
1101
|
business_connection_id: str | None = None,
|
|
1102
|
+
message_effect_id: str | None = None,
|
|
1069
1103
|
duration: int | None = None,
|
|
1070
1104
|
length: int | None = None,
|
|
1071
1105
|
message_thread_id: int | None = None,
|
|
@@ -1078,8 +1112,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1078
1112
|
) -> Result[MessageCute, APIError]:
|
|
1079
1113
|
"""Shortcut `API.send_video_note()`, see the [documentation](https://core.telegram.org/bots/api#sendvideonote)
|
|
1080
1114
|
|
|
1081
|
-
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up
|
|
1082
|
-
to 1 minute long. Use this method to send video messages. On success, the
|
|
1115
|
+
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up
|
|
1116
|
+
to 1 minute long. Use this method to send video messages. On success, the
|
|
1083
1117
|
sent Message is returned.
|
|
1084
1118
|
|
|
1085
1119
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1091,6 +1125,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1091
1125
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1092
1126
|
forum supergroups only.
|
|
1093
1127
|
|
|
1128
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1129
|
+
chats only.
|
|
1130
|
+
|
|
1094
1131
|
:param video_note: Video note to send. Pass a file_id as String to send a video note that exists \
|
|
1095
1132
|
on the Telegram servers (recommended) or upload a new video using multipart/form-data. \
|
|
1096
1133
|
More information on Sending Files: https://core.telegram.org/bots/api#sending-files. \
|
|
@@ -1123,7 +1160,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1123
1160
|
@shortcut(
|
|
1124
1161
|
"send_voice",
|
|
1125
1162
|
executor=execute_method_answer,
|
|
1126
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1163
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1127
1164
|
)
|
|
1128
1165
|
async def answer_voice(
|
|
1129
1166
|
self,
|
|
@@ -1131,6 +1168,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1131
1168
|
chat_id: int | str | None = None,
|
|
1132
1169
|
message_thread_id: int | None = None,
|
|
1133
1170
|
business_connection_id: str | None = None,
|
|
1171
|
+
message_effect_id: str | None = None,
|
|
1134
1172
|
caption: str | None = None,
|
|
1135
1173
|
parse_mode: str | None = None,
|
|
1136
1174
|
caption_entities: list[MessageEntity] | None = None,
|
|
@@ -1143,10 +1181,10 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1143
1181
|
) -> Result[MessageCute, APIError]:
|
|
1144
1182
|
"""Shortcut `API.send_voice()`, see the [documentation](https://core.telegram.org/bots/api#sendvoice)
|
|
1145
1183
|
|
|
1146
|
-
Use this method to send audio files, if you want Telegram clients to display
|
|
1147
|
-
the file as a playable voice message. For this to work, your audio must be
|
|
1148
|
-
in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document).
|
|
1149
|
-
On success, the sent Message is returned. Bots can currently send voice
|
|
1184
|
+
Use this method to send audio files, if you want Telegram clients to display
|
|
1185
|
+
the file as a playable voice message. For this to work, your audio must be
|
|
1186
|
+
in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document).
|
|
1187
|
+
On success, the sent Message is returned. Bots can currently send voice
|
|
1150
1188
|
messages of up to 50 MB in size, this limit may be changed in the future.
|
|
1151
1189
|
|
|
1152
1190
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1158,6 +1196,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1158
1196
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1159
1197
|
forum supergroups only.
|
|
1160
1198
|
|
|
1199
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1200
|
+
chats only.
|
|
1201
|
+
|
|
1161
1202
|
:param voice: Audio file to send. Pass a file_id as String to send a file that exists on the \
|
|
1162
1203
|
Telegram servers (recommended), pass an HTTP URL as a String for Telegram \
|
|
1163
1204
|
to get a file from the Internet, or upload a new one using multipart/form-data. \
|
|
@@ -1188,7 +1229,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1188
1229
|
@shortcut(
|
|
1189
1230
|
"send_poll",
|
|
1190
1231
|
executor=execute_method_answer,
|
|
1191
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1232
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1192
1233
|
)
|
|
1193
1234
|
async def answer_poll(
|
|
1194
1235
|
self,
|
|
@@ -1197,11 +1238,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1197
1238
|
chat_id: int | str | None = None,
|
|
1198
1239
|
business_connection_id: str | None = None,
|
|
1199
1240
|
message_thread_id: int | None = None,
|
|
1241
|
+
message_effect_id: str | None = None,
|
|
1200
1242
|
question_parse_mode: str | None = None,
|
|
1201
1243
|
question_entities: list[MessageEntity] | None = None,
|
|
1202
1244
|
is_anonymous: bool | None = None,
|
|
1203
1245
|
type: typing.Literal["quiz", "regular"] | None = None,
|
|
1204
1246
|
allows_multiple_answers: bool | None = None,
|
|
1247
|
+
show_caption_above_media: bool | None = None,
|
|
1205
1248
|
correct_option_id: int | None = None,
|
|
1206
1249
|
explanation: str | None = None,
|
|
1207
1250
|
explanation_parse_mode: str | None = None,
|
|
@@ -1228,6 +1271,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1228
1271
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1229
1272
|
forum supergroups only.
|
|
1230
1273
|
|
|
1274
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1275
|
+
chats only.
|
|
1276
|
+
|
|
1231
1277
|
:param question_parse_mode: Mode for parsing entities in the question. See formatting options for more \
|
|
1232
1278
|
details. Currently, only custom emoji entities are allowed.
|
|
1233
1279
|
|
|
@@ -1270,6 +1316,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1270
1316
|
|
|
1271
1317
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
1272
1318
|
|
|
1319
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
1320
|
+
|
|
1273
1321
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1274
1322
|
|
|
1275
1323
|
:param reply_parameters: Description of the message to reply to.
|
|
@@ -1283,7 +1331,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1283
1331
|
@shortcut(
|
|
1284
1332
|
"send_venue",
|
|
1285
1333
|
executor=execute_method_answer,
|
|
1286
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1334
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1287
1335
|
)
|
|
1288
1336
|
async def answer_venue(
|
|
1289
1337
|
self,
|
|
@@ -1294,6 +1342,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1294
1342
|
chat_id: int | str | None = None,
|
|
1295
1343
|
business_connection_id: str | None = None,
|
|
1296
1344
|
message_thread_id: int | None = None,
|
|
1345
|
+
message_effect_id: str | None = None,
|
|
1297
1346
|
foursquare_id: str | None = None,
|
|
1298
1347
|
foursquare_type: str | None = None,
|
|
1299
1348
|
google_place_id: str | None = None,
|
|
@@ -1306,7 +1355,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1306
1355
|
) -> Result[MessageCute, APIError]:
|
|
1307
1356
|
"""Shortcut `API.send_venue()`, see the [documentation](https://core.telegram.org/bots/api#sendvenue)
|
|
1308
1357
|
|
|
1309
|
-
Use this method to send information about a venue. On success, the sent Message
|
|
1358
|
+
Use this method to send information about a venue. On success, the sent Message
|
|
1310
1359
|
is returned.
|
|
1311
1360
|
|
|
1312
1361
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1318,6 +1367,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1318
1367
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1319
1368
|
forum supergroups only.
|
|
1320
1369
|
|
|
1370
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1371
|
+
chats only.
|
|
1372
|
+
|
|
1321
1373
|
:param latitude: Latitude of the venue.
|
|
1322
1374
|
|
|
1323
1375
|
:param longitude: Longitude of the venue.
|
|
@@ -1350,7 +1402,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1350
1402
|
@shortcut(
|
|
1351
1403
|
"send_dice",
|
|
1352
1404
|
executor=execute_method_answer,
|
|
1353
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1405
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1354
1406
|
)
|
|
1355
1407
|
async def answer_dice(
|
|
1356
1408
|
self,
|
|
@@ -1358,6 +1410,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1358
1410
|
chat_id: int | str | None = None,
|
|
1359
1411
|
business_connection_id: str | None = None,
|
|
1360
1412
|
message_thread_id: int | None = None,
|
|
1413
|
+
message_effect_id: str | None = None,
|
|
1361
1414
|
disable_notification: bool | None = None,
|
|
1362
1415
|
protect_content: bool | None = None,
|
|
1363
1416
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -1366,7 +1419,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1366
1419
|
) -> Result[MessageCute, APIError]:
|
|
1367
1420
|
"""Shortcut `API.send_dice()`, see the [documentation](https://core.telegram.org/bots/api#senddice)
|
|
1368
1421
|
|
|
1369
|
-
Use this method to send an animated emoji that will display a random value.
|
|
1422
|
+
Use this method to send an animated emoji that will display a random value.
|
|
1370
1423
|
On success, the sent Message is returned.
|
|
1371
1424
|
|
|
1372
1425
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1378,6 +1431,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1378
1431
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1379
1432
|
forum supergroups only.
|
|
1380
1433
|
|
|
1434
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1435
|
+
chats only.
|
|
1436
|
+
|
|
1381
1437
|
:param emoji: Emoji on which the dice throw animation is based. Currently, must be one \
|
|
1382
1438
|
of `🎲`, `🎯`, `🏀`, `⚽`, `🎳`, or `🎰`. Dice can have values 1-6 for `🎲`, `🎯` and \
|
|
1383
1439
|
`🎳`, values 1-5 for `🏀` and `⚽`, and values 1-64 for `🎰`. Defaults to `🎲`. \
|
|
@@ -1397,14 +1453,15 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1397
1453
|
@shortcut(
|
|
1398
1454
|
"send_game",
|
|
1399
1455
|
executor=execute_method_answer,
|
|
1400
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1456
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1401
1457
|
)
|
|
1402
1458
|
async def answer_game(
|
|
1403
1459
|
self,
|
|
1460
|
+
game_short_name: str,
|
|
1404
1461
|
chat_id: int | str | None = None,
|
|
1405
1462
|
business_connection_id: str | None = None,
|
|
1406
1463
|
message_thread_id: int | None = None,
|
|
1407
|
-
|
|
1464
|
+
message_effect_id: str | None = None,
|
|
1408
1465
|
disable_notification: bool | None = None,
|
|
1409
1466
|
protect_content: bool | None = None,
|
|
1410
1467
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -1423,6 +1480,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1423
1480
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1424
1481
|
forum supergroups only.
|
|
1425
1482
|
|
|
1483
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1484
|
+
chats only.
|
|
1485
|
+
|
|
1426
1486
|
:param game_short_name: Short name of the game, serves as the unique identifier for the game. Set \
|
|
1427
1487
|
up your games via @BotFather.
|
|
1428
1488
|
|
|
@@ -1440,19 +1500,20 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1440
1500
|
@shortcut(
|
|
1441
1501
|
"send_invoice",
|
|
1442
1502
|
executor=execute_method_answer,
|
|
1443
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1503
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1444
1504
|
)
|
|
1445
1505
|
async def answer_invoice(
|
|
1446
1506
|
self,
|
|
1447
1507
|
title: str,
|
|
1448
1508
|
description: str,
|
|
1449
1509
|
payload: str,
|
|
1450
|
-
provider_token: str,
|
|
1451
1510
|
currency: str,
|
|
1452
1511
|
prices: list[LabeledPrice],
|
|
1453
1512
|
chat_id: int | str | None = None,
|
|
1454
1513
|
business_connection_id: str | None = None,
|
|
1514
|
+
provider_token: str | None = None,
|
|
1455
1515
|
message_thread_id: int | None = None,
|
|
1516
|
+
message_effect_id: str | None = None,
|
|
1456
1517
|
max_tip_amount: int | None = None,
|
|
1457
1518
|
suggested_tip_amounts: list[int] | None = None,
|
|
1458
1519
|
start_parameter: str | None = None,
|
|
@@ -1487,6 +1548,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1487
1548
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1488
1549
|
forum supergroups only.
|
|
1489
1550
|
|
|
1551
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1552
|
+
chats only.
|
|
1553
|
+
|
|
1490
1554
|
:param title: Product name, 1-32 characters.
|
|
1491
1555
|
|
|
1492
1556
|
:param description: Product description, 1-255 characters.
|
|
@@ -1560,7 +1624,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1560
1624
|
@shortcut(
|
|
1561
1625
|
"send_chat_action",
|
|
1562
1626
|
executor=execute_method_answer,
|
|
1563
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1627
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1564
1628
|
)
|
|
1565
1629
|
async def answer_chat_action(
|
|
1566
1630
|
self,
|
|
@@ -1572,10 +1636,10 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1572
1636
|
) -> Result[bool, APIError]:
|
|
1573
1637
|
"""Shortcut `API.send_chat_action()`, see the [documentation](https://core.telegram.org/bots/api#sendchataction)
|
|
1574
1638
|
|
|
1575
|
-
Use this method when you need to tell the user that something is happening
|
|
1576
|
-
on the bot's side. The status is set for 5 seconds or less (when a message arrives
|
|
1577
|
-
from your bot, Telegram clients clear its typing status). Returns True
|
|
1578
|
-
on success. We only recommend using this method when a response from the
|
|
1639
|
+
Use this method when you need to tell the user that something is happening
|
|
1640
|
+
on the bot's side. The status is set for 5 seconds or less (when a message arrives
|
|
1641
|
+
from your bot, Telegram clients clear its typing status). Returns True
|
|
1642
|
+
on success. We only recommend using this method when a response from the
|
|
1579
1643
|
bot will take a noticeable amount of time to arrive.
|
|
1580
1644
|
|
|
1581
1645
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1605,6 +1669,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1605
1669
|
chat_id: int | str | None = None,
|
|
1606
1670
|
business_connection_id: str | None = None,
|
|
1607
1671
|
message_thread_id: int | None = None,
|
|
1672
|
+
message_effect_id: str | None = None,
|
|
1608
1673
|
caption: str | None = None,
|
|
1609
1674
|
parse_mode: str | None = None,
|
|
1610
1675
|
caption_entities: list[MessageEntity] | None = None,
|
|
@@ -1615,8 +1680,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1615
1680
|
) -> Result[list[MessageCute], APIError]:
|
|
1616
1681
|
"""Shortcut `API.send_media_group()`, see the [documentation](https://core.telegram.org/bots/api#sendmediagroup)
|
|
1617
1682
|
|
|
1618
|
-
Use this method to send a group of photos, videos, documents or audios as
|
|
1619
|
-
an album. Documents and audio files can be only grouped in an album with messages
|
|
1683
|
+
Use this method to send a group of photos, videos, documents or audios as
|
|
1684
|
+
an album. Documents and audio files can be only grouped in an album with messages
|
|
1620
1685
|
of the same type. On success, an array of Messages that were sent is returned.
|
|
1621
1686
|
|
|
1622
1687
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1628,6 +1693,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1628
1693
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1629
1694
|
forum supergroups only.
|
|
1630
1695
|
|
|
1696
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1697
|
+
chats only.
|
|
1698
|
+
|
|
1631
1699
|
:param media: A JSON-serialized array describing messages to be sent, must include 2-10 \
|
|
1632
1700
|
items.
|
|
1633
1701
|
|
|
@@ -1664,7 +1732,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1664
1732
|
@shortcut(
|
|
1665
1733
|
"send_location",
|
|
1666
1734
|
executor=execute_method_answer,
|
|
1667
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1735
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1668
1736
|
)
|
|
1669
1737
|
async def answer_location(
|
|
1670
1738
|
self,
|
|
@@ -1673,6 +1741,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1673
1741
|
chat_id: int | str | None = None,
|
|
1674
1742
|
message_thread_id: int | None = None,
|
|
1675
1743
|
business_connection_id: str | None = None,
|
|
1744
|
+
message_effect_id: str | None = None,
|
|
1676
1745
|
horizontal_accuracy: float | None = None,
|
|
1677
1746
|
heading: int | None = None,
|
|
1678
1747
|
live_period: int | None = None,
|
|
@@ -1696,6 +1765,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1696
1765
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1697
1766
|
forum supergroups only.
|
|
1698
1767
|
|
|
1768
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1769
|
+
chats only.
|
|
1770
|
+
|
|
1699
1771
|
:param latitude: Latitude of the location.
|
|
1700
1772
|
|
|
1701
1773
|
:param longitude: Longitude of the location.
|
|
@@ -1726,7 +1798,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1726
1798
|
@shortcut(
|
|
1727
1799
|
"send_contact",
|
|
1728
1800
|
executor=execute_method_answer,
|
|
1729
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1801
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1730
1802
|
)
|
|
1731
1803
|
async def answer_contact(
|
|
1732
1804
|
self,
|
|
@@ -1737,6 +1809,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1737
1809
|
chat_id: int | str | None = None,
|
|
1738
1810
|
business_connection_id: str | None = None,
|
|
1739
1811
|
message_thread_id: int | None = None,
|
|
1812
|
+
message_effect_id: str | None = None,
|
|
1740
1813
|
disable_notification: bool | None = None,
|
|
1741
1814
|
protect_content: bool | None = None,
|
|
1742
1815
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -1756,6 +1829,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1756
1829
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1757
1830
|
forum supergroups only.
|
|
1758
1831
|
|
|
1832
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1833
|
+
chats only.
|
|
1834
|
+
|
|
1759
1835
|
:param phone_number: Contact's phone number.
|
|
1760
1836
|
|
|
1761
1837
|
:param first_name: Contact's first name.
|
|
@@ -1779,14 +1855,15 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1779
1855
|
@shortcut(
|
|
1780
1856
|
"send_audio",
|
|
1781
1857
|
executor=execute_method_reply,
|
|
1782
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1858
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1783
1859
|
)
|
|
1784
1860
|
async def reply_audio(
|
|
1785
1861
|
self,
|
|
1786
1862
|
audio: InputFile | str,
|
|
1787
1863
|
chat_id: int | str | None = None,
|
|
1788
|
-
business_connection_id: str | None = None,
|
|
1789
1864
|
message_thread_id: int | None = None,
|
|
1865
|
+
business_connection_id: str | None = None,
|
|
1866
|
+
message_effect_id: str | None = None,
|
|
1790
1867
|
caption: str | None = None,
|
|
1791
1868
|
parse_mode: str | None = None,
|
|
1792
1869
|
caption_entities: list[MessageEntity] | None = None,
|
|
@@ -1802,10 +1879,10 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1802
1879
|
) -> Result[MessageCute, APIError]:
|
|
1803
1880
|
"""Shortcut `API.send_audio()`, see the [documentation](https://core.telegram.org/bots/api#sendaudio)
|
|
1804
1881
|
|
|
1805
|
-
Use this method to send a reply to a message with audio files, if you want Telegram clients to display
|
|
1806
|
-
them in the music player. Your audio must be in the .MP3 or .M4A format. On
|
|
1807
|
-
success, the sent Message is returned. Bots can currently send audio files
|
|
1808
|
-
of up to 50 MB in size, this limit may be changed in the future. For sending
|
|
1882
|
+
Use this method to send a reply to a message with audio files, if you want Telegram clients to display
|
|
1883
|
+
them in the music player. Your audio must be in the .MP3 or .M4A format. On
|
|
1884
|
+
success, the sent Message is returned. Bots can currently send audio files
|
|
1885
|
+
of up to 50 MB in size, this limit may be changed in the future. For sending
|
|
1809
1886
|
voice messages, use the sendVoice method instead.
|
|
1810
1887
|
|
|
1811
1888
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1817,6 +1894,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1817
1894
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1818
1895
|
forum supergroups only.
|
|
1819
1896
|
|
|
1897
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1898
|
+
chats only.
|
|
1899
|
+
|
|
1820
1900
|
:param audio: Audio file to send. Pass a file_id as String to send an audio file that exists \
|
|
1821
1901
|
on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram \
|
|
1822
1902
|
to get an audio file from the Internet, or upload a new one using multipart/form-data. \
|
|
@@ -1859,17 +1939,19 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1859
1939
|
@shortcut(
|
|
1860
1940
|
"send_animation",
|
|
1861
1941
|
executor=execute_method_reply,
|
|
1862
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
1942
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1863
1943
|
)
|
|
1864
1944
|
async def reply_animation(
|
|
1865
1945
|
self,
|
|
1866
1946
|
animation: InputFile | str,
|
|
1867
1947
|
chat_id: int | str | None = None,
|
|
1868
|
-
business_connection_id: str | None = None,
|
|
1869
1948
|
message_thread_id: int | None = None,
|
|
1949
|
+
business_connection_id: str | None = None,
|
|
1950
|
+
message_effect_id: str | None = None,
|
|
1870
1951
|
caption: str | None = None,
|
|
1871
1952
|
parse_mode: str | None = None,
|
|
1872
1953
|
caption_entities: list[MessageEntity] | None = None,
|
|
1954
|
+
show_caption_above_media: bool | None = None,
|
|
1873
1955
|
duration: int | None = None,
|
|
1874
1956
|
width: int | None = None,
|
|
1875
1957
|
height: int | None = None,
|
|
@@ -1883,8 +1965,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1883
1965
|
) -> Result[MessageCute, APIError]:
|
|
1884
1966
|
"""Shortcut `API.send_animation()`, see the [documentation](https://core.telegram.org/bots/api#sendanimation)
|
|
1885
1967
|
|
|
1886
|
-
Use this method to send a reply to a message with animation files (GIF or H.264/MPEG-4 AVC video without
|
|
1887
|
-
sound). On success, the sent Message is returned. Bots can currently send
|
|
1968
|
+
Use this method to send a reply to a message with animation files (GIF or H.264/MPEG-4 AVC video without
|
|
1969
|
+
sound). On success, the sent Message is returned. Bots can currently send
|
|
1888
1970
|
animation files of up to 50 MB in size, this limit may be changed in the future.
|
|
1889
1971
|
|
|
1890
1972
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1896,6 +1978,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1896
1978
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1897
1979
|
forum supergroups only.
|
|
1898
1980
|
|
|
1981
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
1982
|
+
chats only.
|
|
1983
|
+
|
|
1899
1984
|
:param animation: Animation to send. Pass a file_id as String to send an animation that exists \
|
|
1900
1985
|
on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram \
|
|
1901
1986
|
to get an animation from the Internet, or upload a new animation using multipart/form-data. \
|
|
@@ -1928,6 +2013,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1928
2013
|
|
|
1929
2014
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
1930
2015
|
|
|
2016
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
2017
|
+
|
|
1931
2018
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
1932
2019
|
|
|
1933
2020
|
:param reply_parameters: Description of the message to reply to.
|
|
@@ -1941,18 +2028,20 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1941
2028
|
@shortcut(
|
|
1942
2029
|
"send_document",
|
|
1943
2030
|
executor=execute_method_reply,
|
|
1944
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2031
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
1945
2032
|
)
|
|
1946
2033
|
async def reply_document(
|
|
1947
2034
|
self,
|
|
1948
2035
|
document: InputFile | str,
|
|
1949
2036
|
chat_id: int | str | None = None,
|
|
1950
|
-
business_connection_id: str | None = None,
|
|
1951
2037
|
message_thread_id: int | None = None,
|
|
2038
|
+
business_connection_id: str | None = None,
|
|
2039
|
+
message_effect_id: str | None = None,
|
|
1952
2040
|
caption: str | None = None,
|
|
1953
2041
|
parse_mode: str | None = None,
|
|
1954
2042
|
caption_entities: list[MessageEntity] | None = None,
|
|
1955
2043
|
disable_content_type_detection: bool | None = None,
|
|
2044
|
+
show_caption_above_media: bool | None = None,
|
|
1956
2045
|
thumbnail: InputFile | str | None = None,
|
|
1957
2046
|
disable_notification: bool | None = None,
|
|
1958
2047
|
protect_content: bool | None = None,
|
|
@@ -1962,8 +2051,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1962
2051
|
) -> Result[MessageCute, APIError]:
|
|
1963
2052
|
"""Shortcut `API.send_document()`, see the [documentation](https://core.telegram.org/bots/api#senddocument)
|
|
1964
2053
|
|
|
1965
|
-
Use this method to send a reply to a message with general files. On success, the sent Message is returned.
|
|
1966
|
-
Bots can currently send files of any type of up to 50 MB in size, this limit
|
|
2054
|
+
Use this method to send a reply to a message with general files. On success, the sent Message is returned.
|
|
2055
|
+
Bots can currently send files of any type of up to 50 MB in size, this limit
|
|
1967
2056
|
may be changed in the future.
|
|
1968
2057
|
|
|
1969
2058
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -1975,6 +2064,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
1975
2064
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
1976
2065
|
forum supergroups only.
|
|
1977
2066
|
|
|
2067
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2068
|
+
chats only.
|
|
2069
|
+
|
|
1978
2070
|
:param document: File to send. Pass a file_id as String to send a file that exists on the Telegram \
|
|
1979
2071
|
servers (recommended), pass an HTTP URL as a String for Telegram to get a \
|
|
1980
2072
|
file from the Internet, or upload a new one using multipart/form-data. \
|
|
@@ -2002,6 +2094,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2002
2094
|
|
|
2003
2095
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
2004
2096
|
|
|
2097
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
2098
|
+
|
|
2005
2099
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
2006
2100
|
|
|
2007
2101
|
:param reply_parameters: Description of the message to reply to.
|
|
@@ -2015,17 +2109,19 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2015
2109
|
@shortcut(
|
|
2016
2110
|
"send_photo",
|
|
2017
2111
|
executor=execute_method_reply,
|
|
2018
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2112
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2019
2113
|
)
|
|
2020
2114
|
async def reply_photo(
|
|
2021
2115
|
self,
|
|
2022
2116
|
photo: InputFile | str,
|
|
2023
2117
|
chat_id: int | str | None = None,
|
|
2024
|
-
business_connection_id: str | None = None,
|
|
2025
2118
|
message_thread_id: int | None = None,
|
|
2119
|
+
business_connection_id: str | None = None,
|
|
2120
|
+
message_effect_id: str | None = None,
|
|
2026
2121
|
caption: str | None = None,
|
|
2027
2122
|
parse_mode: str | None = None,
|
|
2028
2123
|
caption_entities: list[MessageEntity] | None = None,
|
|
2124
|
+
show_caption_above_media: bool | None = None,
|
|
2029
2125
|
has_spoiler: bool | None = None,
|
|
2030
2126
|
disable_notification: bool | None = None,
|
|
2031
2127
|
protect_content: bool | None = None,
|
|
@@ -2046,6 +2142,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2046
2142
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2047
2143
|
forum supergroups only.
|
|
2048
2144
|
|
|
2145
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2146
|
+
chats only.
|
|
2147
|
+
|
|
2049
2148
|
:param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram \
|
|
2050
2149
|
servers (recommended), pass an HTTP URL as a String for Telegram to get a \
|
|
2051
2150
|
photo from the Internet, or upload a new photo using multipart/form-data. \
|
|
@@ -2066,6 +2165,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2066
2165
|
|
|
2067
2166
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
2068
2167
|
|
|
2168
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
2169
|
+
|
|
2069
2170
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
2070
2171
|
|
|
2071
2172
|
:param reply_parameters: Description of the message to reply to.
|
|
@@ -2079,15 +2180,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2079
2180
|
@shortcut(
|
|
2080
2181
|
"send_sticker",
|
|
2081
2182
|
executor=execute_method_reply,
|
|
2082
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2183
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2083
2184
|
)
|
|
2084
2185
|
async def reply_sticker(
|
|
2085
2186
|
self,
|
|
2086
2187
|
sticker: InputFile | str,
|
|
2087
2188
|
chat_id: int | str | None = None,
|
|
2088
|
-
business_connection_id: str | None = None,
|
|
2089
2189
|
emoji: str | None = None,
|
|
2090
2190
|
message_thread_id: int | None = None,
|
|
2191
|
+
message_effect_id: str | None = None,
|
|
2192
|
+
business_connection_id: str | None = None,
|
|
2091
2193
|
disable_notification: bool | None = None,
|
|
2092
2194
|
protect_content: bool | None = None,
|
|
2093
2195
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -2096,7 +2198,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2096
2198
|
) -> Result[MessageCute, APIError]:
|
|
2097
2199
|
"""Shortcut `API.send_sticker()`, see the [documentation](https://core.telegram.org/bots/api#sendsticker)
|
|
2098
2200
|
|
|
2099
|
-
Use this method to send a reply to a message with static .WEBP, animated .TGS, or video .WEBM stickers.
|
|
2201
|
+
Use this method to send a reply to a message with static .WEBP, animated .TGS, or video .WEBM stickers.
|
|
2100
2202
|
On success, the sent Message is returned.
|
|
2101
2203
|
|
|
2102
2204
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -2108,6 +2210,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2108
2210
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2109
2211
|
forum supergroups only.
|
|
2110
2212
|
|
|
2213
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2214
|
+
chats only.
|
|
2215
|
+
|
|
2111
2216
|
:param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the \
|
|
2112
2217
|
Telegram servers (recommended), pass an HTTP URL as a String for Telegram \
|
|
2113
2218
|
to get a .WEBP sticker from the Internet, or upload a new .WEBP or .TGS sticker \
|
|
@@ -2132,23 +2237,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2132
2237
|
@shortcut(
|
|
2133
2238
|
"send_video",
|
|
2134
2239
|
executor=execute_method_reply,
|
|
2135
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2240
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2136
2241
|
)
|
|
2137
2242
|
async def reply_video(
|
|
2138
2243
|
self,
|
|
2139
|
-
|
|
2244
|
+
sticker: InputFile | str,
|
|
2140
2245
|
chat_id: int | str | None = None,
|
|
2141
|
-
|
|
2246
|
+
emoji: str | None = None,
|
|
2142
2247
|
message_thread_id: int | None = None,
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
caption_entities: list[MessageEntity] | None = None,
|
|
2146
|
-
duration: int | None = None,
|
|
2147
|
-
width: int | None = None,
|
|
2148
|
-
height: int | None = None,
|
|
2149
|
-
thumbnail: InputFile | str | None = None,
|
|
2150
|
-
has_spoiler: bool | None = None,
|
|
2151
|
-
supports_streaming: bool | None = None,
|
|
2248
|
+
message_effect_id: str | None = None,
|
|
2249
|
+
business_connection_id: str | None = None,
|
|
2152
2250
|
disable_notification: bool | None = None,
|
|
2153
2251
|
protect_content: bool | None = None,
|
|
2154
2252
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -2157,9 +2255,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2157
2255
|
) -> Result[MessageCute, APIError]:
|
|
2158
2256
|
"""Shortcut `API.send_video()`, see the [documentation](https://core.telegram.org/bots/api#sendvideo)
|
|
2159
2257
|
|
|
2160
|
-
Use this method to send a reply to a message with video files, Telegram clients support MPEG4 videos
|
|
2161
|
-
(other formats may be sent as Document). On success, the sent Message is
|
|
2162
|
-
returned. Bots can currently send video files of up to 50 MB in size, this
|
|
2258
|
+
Use this method to send a reply to a message with video files, Telegram clients support MPEG4 videos
|
|
2259
|
+
(other formats may be sent as Document). On success, the sent Message is
|
|
2260
|
+
returned. Bots can currently send video files of up to 50 MB in size, this
|
|
2163
2261
|
limit may be changed in the future.
|
|
2164
2262
|
|
|
2165
2263
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -2171,6 +2269,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2171
2269
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2172
2270
|
forum supergroups only.
|
|
2173
2271
|
|
|
2272
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2273
|
+
chats only.
|
|
2274
|
+
|
|
2174
2275
|
:param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram \
|
|
2175
2276
|
servers (recommended), pass an HTTP URL as a String for Telegram to get a \
|
|
2176
2277
|
video from the Internet, or upload a new video using multipart/form-data. \
|
|
@@ -2218,15 +2319,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2218
2319
|
@shortcut(
|
|
2219
2320
|
"send_video_note",
|
|
2220
2321
|
executor=execute_method_reply,
|
|
2221
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2322
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2222
2323
|
)
|
|
2223
2324
|
async def reply_video_note(
|
|
2224
2325
|
self,
|
|
2225
2326
|
video_note: InputFile | str,
|
|
2226
2327
|
chat_id: int | str | None = None,
|
|
2328
|
+
business_connection_id: str | None = None,
|
|
2329
|
+
message_effect_id: str | None = None,
|
|
2227
2330
|
duration: int | None = None,
|
|
2228
2331
|
length: int | None = None,
|
|
2229
|
-
business_connection_id: str | None = None,
|
|
2230
2332
|
message_thread_id: int | None = None,
|
|
2231
2333
|
thumbnail: InputFile | str | None = None,
|
|
2232
2334
|
disable_notification: bool | None = None,
|
|
@@ -2237,8 +2339,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2237
2339
|
) -> Result[MessageCute, APIError]:
|
|
2238
2340
|
"""Shortcut `API.send_video_note()`, see the [documentation](https://core.telegram.org/bots/api#sendvideonote)
|
|
2239
2341
|
|
|
2240
|
-
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up
|
|
2241
|
-
to 1 minute long. Use this method to send a reply to a message with video messages. On success, the
|
|
2342
|
+
As of v.4.0, Telegram clients support rounded square MPEG4 videos of up
|
|
2343
|
+
to 1 minute long. Use this method to send a reply to a message with video messages. On success, the
|
|
2242
2344
|
sent Message is returned.
|
|
2243
2345
|
|
|
2244
2346
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -2250,6 +2352,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2250
2352
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2251
2353
|
forum supergroups only.
|
|
2252
2354
|
|
|
2355
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2356
|
+
chats only.
|
|
2357
|
+
|
|
2253
2358
|
:param video_note: Video note to send. Pass a file_id as String to send a video note that exists \
|
|
2254
2359
|
on the Telegram servers (recommended) or upload a new video using multipart/form-data. \
|
|
2255
2360
|
More information on Sending Files: https://core.telegram.org/bots/api#sending-files. \
|
|
@@ -2282,14 +2387,15 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2282
2387
|
@shortcut(
|
|
2283
2388
|
"send_voice",
|
|
2284
2389
|
executor=execute_method_reply,
|
|
2285
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2390
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2286
2391
|
)
|
|
2287
2392
|
async def reply_voice(
|
|
2288
2393
|
self,
|
|
2289
2394
|
voice: InputFile | str,
|
|
2290
2395
|
chat_id: int | str | None = None,
|
|
2291
|
-
business_connection_id: str | None = None,
|
|
2292
2396
|
message_thread_id: int | None = None,
|
|
2397
|
+
business_connection_id: str | None = None,
|
|
2398
|
+
message_effect_id: str | None = None,
|
|
2293
2399
|
caption: str | None = None,
|
|
2294
2400
|
parse_mode: str | None = None,
|
|
2295
2401
|
caption_entities: list[MessageEntity] | None = None,
|
|
@@ -2302,10 +2408,10 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2302
2408
|
) -> Result[MessageCute, APIError]:
|
|
2303
2409
|
"""Shortcut `API.send_voice()`, see the [documentation](https://core.telegram.org/bots/api#sendvoice)
|
|
2304
2410
|
|
|
2305
|
-
Use this method to send a reply to a message with audio files, if you want Telegram clients to display
|
|
2306
|
-
the file as a playable voice message. For this to work, your audio must be
|
|
2307
|
-
in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document).
|
|
2308
|
-
On success, the sent Message is returned. Bots can currently send voice
|
|
2411
|
+
Use this method to send a reply to a message with audio files, if you want Telegram clients to display
|
|
2412
|
+
the file as a playable voice message. For this to work, your audio must be
|
|
2413
|
+
in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document).
|
|
2414
|
+
On success, the sent Message is returned. Bots can currently send voice
|
|
2309
2415
|
messages of up to 50 MB in size, this limit may be changed in the future.
|
|
2310
2416
|
|
|
2311
2417
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -2317,6 +2423,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2317
2423
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2318
2424
|
forum supergroups only.
|
|
2319
2425
|
|
|
2426
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2427
|
+
chats only.
|
|
2428
|
+
|
|
2320
2429
|
:param voice: Audio file to send. Pass a file_id as String to send a file that exists on the \
|
|
2321
2430
|
Telegram servers (recommended), pass an HTTP URL as a String for Telegram \
|
|
2322
2431
|
to get a file from the Internet, or upload a new one using multipart/form-data. \
|
|
@@ -2347,7 +2456,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2347
2456
|
@shortcut(
|
|
2348
2457
|
"send_poll",
|
|
2349
2458
|
executor=execute_method_reply,
|
|
2350
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2459
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2351
2460
|
)
|
|
2352
2461
|
async def reply_poll(
|
|
2353
2462
|
self,
|
|
@@ -2356,11 +2465,13 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2356
2465
|
chat_id: int | str | None = None,
|
|
2357
2466
|
business_connection_id: str | None = None,
|
|
2358
2467
|
message_thread_id: int | None = None,
|
|
2468
|
+
message_effect_id: str | None = None,
|
|
2359
2469
|
question_parse_mode: str | None = None,
|
|
2360
2470
|
question_entities: list[MessageEntity] | None = None,
|
|
2361
2471
|
is_anonymous: bool | None = None,
|
|
2362
2472
|
type: typing.Literal["quiz", "regular"] | None = None,
|
|
2363
2473
|
allows_multiple_answers: bool | None = None,
|
|
2474
|
+
show_caption_above_media: bool | None = None,
|
|
2364
2475
|
correct_option_id: int | None = None,
|
|
2365
2476
|
explanation: str | None = None,
|
|
2366
2477
|
explanation_parse_mode: str | None = None,
|
|
@@ -2387,6 +2498,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2387
2498
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2388
2499
|
forum supergroups only.
|
|
2389
2500
|
|
|
2501
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2502
|
+
chats only.
|
|
2503
|
+
|
|
2390
2504
|
:param question_parse_mode: Mode for parsing entities in the question. See formatting options for more \
|
|
2391
2505
|
details. Currently, only custom emoji entities are allowed.
|
|
2392
2506
|
|
|
@@ -2429,6 +2543,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2429
2543
|
|
|
2430
2544
|
:param disable_notification: Sends the message silently. Users will receive a notification with no sound. \
|
|
2431
2545
|
|
|
2546
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
2547
|
+
|
|
2432
2548
|
:param protect_content: Protects the contents of the sent message from forwarding and saving.
|
|
2433
2549
|
|
|
2434
2550
|
:param reply_parameters: Description of the message to reply to.
|
|
@@ -2442,7 +2558,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2442
2558
|
@shortcut(
|
|
2443
2559
|
"send_venue",
|
|
2444
2560
|
executor=execute_method_reply,
|
|
2445
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2561
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2446
2562
|
)
|
|
2447
2563
|
async def reply_venue(
|
|
2448
2564
|
self,
|
|
@@ -2453,6 +2569,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2453
2569
|
chat_id: int | str | None = None,
|
|
2454
2570
|
business_connection_id: str | None = None,
|
|
2455
2571
|
message_thread_id: int | None = None,
|
|
2572
|
+
message_effect_id: str | None = None,
|
|
2456
2573
|
foursquare_id: str | None = None,
|
|
2457
2574
|
foursquare_type: str | None = None,
|
|
2458
2575
|
google_place_id: str | None = None,
|
|
@@ -2465,7 +2582,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2465
2582
|
) -> Result[MessageCute, APIError]:
|
|
2466
2583
|
"""Shortcut `API.send_venue()`, see the [documentation](https://core.telegram.org/bots/api#sendvenue)
|
|
2467
2584
|
|
|
2468
|
-
Use this method to send a reply to a message with information about a venue. On success, the sent Message
|
|
2585
|
+
Use this method to send a reply to a message with information about a venue. On success, the sent Message
|
|
2469
2586
|
is returned.
|
|
2470
2587
|
|
|
2471
2588
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -2477,6 +2594,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2477
2594
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2478
2595
|
forum supergroups only.
|
|
2479
2596
|
|
|
2597
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2598
|
+
chats only.
|
|
2599
|
+
|
|
2480
2600
|
:param latitude: Latitude of the venue.
|
|
2481
2601
|
|
|
2482
2602
|
:param longitude: Longitude of the venue.
|
|
@@ -2509,14 +2629,15 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2509
2629
|
@shortcut(
|
|
2510
2630
|
"send_dice",
|
|
2511
2631
|
executor=execute_method_reply,
|
|
2512
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2632
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2513
2633
|
)
|
|
2514
2634
|
async def reply_dice(
|
|
2515
2635
|
self,
|
|
2636
|
+
emoji: DiceEmoji | None = None,
|
|
2516
2637
|
chat_id: int | str | None = None,
|
|
2517
2638
|
business_connection_id: str | None = None,
|
|
2518
2639
|
message_thread_id: int | None = None,
|
|
2519
|
-
|
|
2640
|
+
message_effect_id: str | None = None,
|
|
2520
2641
|
disable_notification: bool | None = None,
|
|
2521
2642
|
protect_content: bool | None = None,
|
|
2522
2643
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -2525,7 +2646,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2525
2646
|
) -> Result[MessageCute, APIError]:
|
|
2526
2647
|
"""Shortcut `API.send_dice()`, see the [documentation](https://core.telegram.org/bots/api#senddice)
|
|
2527
2648
|
|
|
2528
|
-
Use this method to send a reply to a message with an animated emoji that will display a random value.
|
|
2649
|
+
Use this method to send a reply to a message with an animated emoji that will display a random value.
|
|
2529
2650
|
On success, the sent Message is returned.
|
|
2530
2651
|
|
|
2531
2652
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -2537,6 +2658,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2537
2658
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2538
2659
|
forum supergroups only.
|
|
2539
2660
|
|
|
2661
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2662
|
+
chats only.
|
|
2663
|
+
|
|
2540
2664
|
:param emoji: Emoji on which the dice throw animation is based. Currently, must be one \
|
|
2541
2665
|
of `🎲`, `🎯`, `🏀`, `⚽`, `🎳`, or `🎰`. Dice can have values 1-6 for `🎲`, `🎯` and \
|
|
2542
2666
|
`🎳`, values 1-5 for `🏀` and `⚽`, and values 1-64 for `🎰`. Defaults to `🎲`. \
|
|
@@ -2556,14 +2680,15 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2556
2680
|
@shortcut(
|
|
2557
2681
|
"send_game",
|
|
2558
2682
|
executor=execute_method_reply,
|
|
2559
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2683
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2560
2684
|
)
|
|
2561
2685
|
async def reply_game(
|
|
2562
2686
|
self,
|
|
2687
|
+
game_short_name: str,
|
|
2563
2688
|
chat_id: int | str | None = None,
|
|
2564
2689
|
business_connection_id: str | None = None,
|
|
2565
2690
|
message_thread_id: int | None = None,
|
|
2566
|
-
|
|
2691
|
+
message_effect_id: str | None = None,
|
|
2567
2692
|
disable_notification: bool | None = None,
|
|
2568
2693
|
protect_content: bool | None = None,
|
|
2569
2694
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -2582,6 +2707,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2582
2707
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2583
2708
|
forum supergroups only.
|
|
2584
2709
|
|
|
2710
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2711
|
+
chats only.
|
|
2712
|
+
|
|
2585
2713
|
:param game_short_name: Short name of the game, serves as the unique identifier for the game. Set \
|
|
2586
2714
|
up your games via @BotFather.
|
|
2587
2715
|
|
|
@@ -2599,19 +2727,20 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2599
2727
|
@shortcut(
|
|
2600
2728
|
"send_invoice",
|
|
2601
2729
|
executor=execute_method_reply,
|
|
2602
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2730
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2603
2731
|
)
|
|
2604
2732
|
async def reply_invoice(
|
|
2605
2733
|
self,
|
|
2606
2734
|
title: str,
|
|
2607
2735
|
description: str,
|
|
2608
2736
|
payload: str,
|
|
2609
|
-
provider_token: str,
|
|
2610
2737
|
currency: str,
|
|
2611
2738
|
prices: list[LabeledPrice],
|
|
2612
2739
|
chat_id: int | str | None = None,
|
|
2613
2740
|
business_connection_id: str | None = None,
|
|
2614
2741
|
message_thread_id: int | None = None,
|
|
2742
|
+
provider_token: str | None = None,
|
|
2743
|
+
message_effect_id: str | None = None,
|
|
2615
2744
|
max_tip_amount: int | None = None,
|
|
2616
2745
|
suggested_tip_amounts: list[int] | None = None,
|
|
2617
2746
|
start_parameter: str | None = None,
|
|
@@ -2646,6 +2775,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2646
2775
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2647
2776
|
forum supergroups only.
|
|
2648
2777
|
|
|
2778
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2779
|
+
chats only.
|
|
2780
|
+
|
|
2649
2781
|
:param title: Product name, 1-32 characters.
|
|
2650
2782
|
|
|
2651
2783
|
:param description: Product description, 1-255 characters.
|
|
@@ -2721,6 +2853,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2721
2853
|
custom_params={
|
|
2722
2854
|
"media",
|
|
2723
2855
|
"reply_parameters",
|
|
2856
|
+
"chat_id",
|
|
2724
2857
|
"message_thread_id",
|
|
2725
2858
|
"caption",
|
|
2726
2859
|
"caption_entities",
|
|
@@ -2733,6 +2866,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2733
2866
|
chat_id: int | str | None = None,
|
|
2734
2867
|
business_connection_id: str | None = None,
|
|
2735
2868
|
message_thread_id: int | None = None,
|
|
2869
|
+
message_effect_id: str | None = None,
|
|
2736
2870
|
caption: str | None = None,
|
|
2737
2871
|
parse_mode: str | None = None,
|
|
2738
2872
|
caption_entities: list[MessageEntity] | None = None,
|
|
@@ -2743,8 +2877,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2743
2877
|
) -> Result[list[MessageCute], APIError]:
|
|
2744
2878
|
"""Shortcut `API.send_media_group()`, see the [documentation](https://core.telegram.org/bots/api#sendmediagroup)
|
|
2745
2879
|
|
|
2746
|
-
Use this method to send a reply to a message with a group of photos, videos, documents or audios as
|
|
2747
|
-
an album. Documents and audio files can be only grouped in an album with messages
|
|
2880
|
+
Use this method to send a reply to a message with a group of photos, videos, documents or audios as
|
|
2881
|
+
an album. Documents and audio files can be only grouped in an album with messages
|
|
2748
2882
|
of the same type. On success, an array of Messages that were sent is returned.
|
|
2749
2883
|
|
|
2750
2884
|
:param business_connection_id: Unique identifier of the business connection on behalf of which the message \
|
|
@@ -2756,6 +2890,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2756
2890
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2757
2891
|
forum supergroups only.
|
|
2758
2892
|
|
|
2893
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2894
|
+
chats only.
|
|
2895
|
+
|
|
2759
2896
|
:param media: A JSON-serialized array describing messages to be sent, must include 2-10 \
|
|
2760
2897
|
items.
|
|
2761
2898
|
|
|
@@ -2780,15 +2917,16 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2780
2917
|
@shortcut(
|
|
2781
2918
|
"send_location",
|
|
2782
2919
|
executor=execute_method_reply,
|
|
2783
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2920
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2784
2921
|
)
|
|
2785
2922
|
async def reply_location(
|
|
2786
2923
|
self,
|
|
2787
2924
|
latitude: float,
|
|
2788
2925
|
longitude: float,
|
|
2789
2926
|
chat_id: int | str | None = None,
|
|
2790
|
-
business_connection_id: str | None = None,
|
|
2791
2927
|
message_thread_id: int | None = None,
|
|
2928
|
+
business_connection_id: str | None = None,
|
|
2929
|
+
message_effect_id: str | None = None,
|
|
2792
2930
|
horizontal_accuracy: float | None = None,
|
|
2793
2931
|
heading: int | None = None,
|
|
2794
2932
|
live_period: int | None = None,
|
|
@@ -2812,6 +2950,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2812
2950
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2813
2951
|
forum supergroups only.
|
|
2814
2952
|
|
|
2953
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
2954
|
+
chats only.
|
|
2955
|
+
|
|
2815
2956
|
:param latitude: Latitude of the location.
|
|
2816
2957
|
|
|
2817
2958
|
:param longitude: Longitude of the location.
|
|
@@ -2842,7 +2983,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2842
2983
|
@shortcut(
|
|
2843
2984
|
"send_contact",
|
|
2844
2985
|
executor=execute_method_reply,
|
|
2845
|
-
custom_params={"reply_parameters", "message_thread_id"},
|
|
2986
|
+
custom_params={"reply_parameters", "message_thread_id", "chat_id"},
|
|
2846
2987
|
)
|
|
2847
2988
|
async def reply_contact(
|
|
2848
2989
|
self,
|
|
@@ -2853,6 +2994,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2853
2994
|
chat_id: int | str | None = None,
|
|
2854
2995
|
business_connection_id: str | None = None,
|
|
2855
2996
|
message_thread_id: int | None = None,
|
|
2997
|
+
message_effect_id: str | None = None,
|
|
2856
2998
|
disable_notification: bool | None = None,
|
|
2857
2999
|
protect_content: bool | None = None,
|
|
2858
3000
|
reply_parameters: ReplyParameters | dict[str, typing.Any] | None = None,
|
|
@@ -2872,6 +3014,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2872
3014
|
:param message_thread_id: Unique identifier for the target message thread (topic) of the forum; for \
|
|
2873
3015
|
forum supergroups only.
|
|
2874
3016
|
|
|
3017
|
+
:param message_effect_id: Unique identifier of the message effect to be added to the message; for private \
|
|
3018
|
+
chats only.
|
|
3019
|
+
|
|
2875
3020
|
:param phone_number: Contact's phone number.
|
|
2876
3021
|
|
|
2877
3022
|
:param first_name: Contact's first name.
|
|
@@ -2895,7 +3040,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2895
3040
|
@shortcut(
|
|
2896
3041
|
"edit_message_live_location",
|
|
2897
3042
|
executor=execute_method_edit,
|
|
2898
|
-
custom_params={"message_thread_id"},
|
|
3043
|
+
custom_params={"message_thread_id", "chat_id", "message_id"},
|
|
2899
3044
|
)
|
|
2900
3045
|
async def edit_live_location(
|
|
2901
3046
|
self,
|
|
@@ -2914,9 +3059,9 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2914
3059
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2915
3060
|
"""Shortcut `API.edit_message_live_location()`, see the [documentation](https://core.telegram.org/bots/api#editmessagelivelocation)
|
|
2916
3061
|
|
|
2917
|
-
Use this method to edit live location messages. A location can be edited
|
|
2918
|
-
until its live_period expires or editing is explicitly disabled by a call
|
|
2919
|
-
to stopMessageLiveLocation. On success, if the edited message is not an
|
|
3062
|
+
Use this method to edit live location messages. A location can be edited
|
|
3063
|
+
until its live_period expires or editing is explicitly disabled by a call
|
|
3064
|
+
to stopMessageLiveLocation. On success, if the edited message is not an
|
|
2920
3065
|
inline message, the edited Message is returned, otherwise True is returned.
|
|
2921
3066
|
|
|
2922
3067
|
:param chat_id: Required if inline_message_id is not specified. Unique identifier for \
|
|
@@ -2957,7 +3102,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2957
3102
|
@shortcut(
|
|
2958
3103
|
"edit_message_caption",
|
|
2959
3104
|
executor=execute_method_edit,
|
|
2960
|
-
custom_params={"message_thread_id"},
|
|
3105
|
+
custom_params={"message_thread_id", "chat_id", "message_id"},
|
|
2961
3106
|
)
|
|
2962
3107
|
async def edit_caption(
|
|
2963
3108
|
self,
|
|
@@ -2967,13 +3112,14 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2967
3112
|
message_thread_id: int | None = None,
|
|
2968
3113
|
parse_mode: str | None = None,
|
|
2969
3114
|
caption_entities: list[MessageEntity] | None = None,
|
|
3115
|
+
show_caption_above_media: bool | None = None,
|
|
2970
3116
|
reply_markup: InlineKeyboardMarkup | None = None,
|
|
2971
3117
|
**other: typing.Any,
|
|
2972
3118
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
2973
3119
|
"""Shortcut `API.edit_message_caption()`, see the [documentation](https://core.telegram.org/bots/api#editmessagecaption)
|
|
2974
3120
|
|
|
2975
|
-
Use this method to edit captions of messages. On success, if the edited message
|
|
2976
|
-
is not an inline message, the edited Message is returned, otherwise True
|
|
3121
|
+
Use this method to edit captions of messages. On success, if the edited message
|
|
3122
|
+
is not an inline message, the edited Message is returned, otherwise True
|
|
2977
3123
|
is returned.
|
|
2978
3124
|
|
|
2979
3125
|
:param chat_id: Required if inline_message_id is not specified. Unique identifier for \
|
|
@@ -2993,6 +3139,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
2993
3139
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, \
|
|
2994
3140
|
which can be specified instead of parse_mode.
|
|
2995
3141
|
|
|
3142
|
+
:param show_caption_above_media: Pass True, if the caption must be shown above the message media.
|
|
3143
|
+
|
|
2996
3144
|
:param reply_markup: A JSON-serialized object for an inline keyboard."""
|
|
2997
3145
|
|
|
2998
3146
|
...
|
|
@@ -3004,6 +3152,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
3004
3152
|
"type",
|
|
3005
3153
|
"message_thread_id",
|
|
3006
3154
|
"caption",
|
|
3155
|
+
"chat_id",
|
|
3156
|
+
"message_id",
|
|
3007
3157
|
"parse_mode",
|
|
3008
3158
|
"caption_entities",
|
|
3009
3159
|
},
|
|
@@ -3023,12 +3173,12 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
3023
3173
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
3024
3174
|
"""Shortcut `API.edit_message_media()`, see the [documentation](https://core.telegram.org/bots/api#editmessagemedia)
|
|
3025
3175
|
|
|
3026
|
-
Use this method to edit animation, audio, document, photo, or video messages.
|
|
3027
|
-
If a message is part of a message album, then it can be edited only to an audio
|
|
3028
|
-
for audio albums, only to a document for document albums and to a photo or
|
|
3029
|
-
a video otherwise. When an inline message is edited, a new file can't be uploaded;
|
|
3030
|
-
use a previously uploaded file via its file_id or specify a URL. On success,
|
|
3031
|
-
if the edited message is not an inline message, the edited Message is returned,
|
|
3176
|
+
Use this method to edit animation, audio, document, photo, or video messages.
|
|
3177
|
+
If a message is part of a message album, then it can be edited only to an audio
|
|
3178
|
+
for audio albums, only to a document for document albums and to a photo or
|
|
3179
|
+
a video otherwise. When an inline message is edited, a new file can't be uploaded;
|
|
3180
|
+
use a previously uploaded file via its file_id or specify a URL. On success,
|
|
3181
|
+
if the edited message is not an inline message, the edited Message is returned,
|
|
3032
3182
|
otherwise True is returned.
|
|
3033
3183
|
|
|
3034
3184
|
:param chat_id: Required if inline_message_id is not specified. Unique identifier for \
|
|
@@ -3049,7 +3199,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
3049
3199
|
|
|
3050
3200
|
:param caption_entities: A JSON-serialized list of special entities that appear in the caption, \
|
|
3051
3201
|
which can be specified instead of parse_mode.
|
|
3052
|
-
|
|
3202
|
+
|
|
3053
3203
|
:param type: Required if media is not an `str | InputMedia` object. Type of the media, \
|
|
3054
3204
|
must be one of `photo`, `video`, `animation`, `audio`, `document`.
|
|
3055
3205
|
|
|
@@ -3058,9 +3208,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
3058
3208
|
params = get_params(locals())
|
|
3059
3209
|
|
|
3060
3210
|
if not isinstance(media, InputMedia):
|
|
3061
|
-
assert
|
|
3062
|
-
type
|
|
3063
|
-
), "parameter 'type' is required, because 'media' is not an 'InputMedia' object."
|
|
3211
|
+
assert type, "parameter 'type' is required, because 'media' is not an 'InputMedia' object."
|
|
3064
3212
|
params["media"] = input_media(
|
|
3065
3213
|
params.pop("type"),
|
|
3066
3214
|
media,
|
|
@@ -3074,7 +3222,7 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
3074
3222
|
@shortcut(
|
|
3075
3223
|
"edit_message_reply_markup",
|
|
3076
3224
|
executor=execute_method_edit,
|
|
3077
|
-
custom_params={"message_thread_id"},
|
|
3225
|
+
custom_params={"message_thread_id", "chat_id", "message_id"},
|
|
3078
3226
|
)
|
|
3079
3227
|
async def edit_reply_markup(
|
|
3080
3228
|
self,
|
|
@@ -3086,8 +3234,8 @@ class MessageCute(BaseCute[Message], Message, kw_only=True):
|
|
|
3086
3234
|
) -> Result[Variative[MessageCute, bool], APIError]:
|
|
3087
3235
|
"""Shortcut `API.edit_message_reply_markup()`, see the [documentation](https://core.telegram.org/bots/api#editmessagereplymarkup)
|
|
3088
3236
|
|
|
3089
|
-
Use this method to edit only the reply markup of messages. On success, if
|
|
3090
|
-
the edited message is not an inline message, the edited Message is returned,
|
|
3237
|
+
Use this method to edit only the reply markup of messages. On success, if
|
|
3238
|
+
the edited message is not an inline message, the edited Message is returned,
|
|
3091
3239
|
otherwise True is returned.
|
|
3092
3240
|
|
|
3093
3241
|
:param chat_id: Required if inline_message_id is not specified. Unique identifier for \
|