Skip to content

API 7.4 Message effects #4278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/substitutions/global.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@
.. |non_optional_story_argument| replace:: As of this version, this argument is now required. In accordance with our `stability policy <https://docs.python-telegram-bot.org/en/stable/stability_policy.html>`__, the signature will be kept as optional for now, though they are mandatory and an error will be raised if you don't pass it.

.. |business_id_str| replace:: Unique identifier of the business connection on behalf of which the message will be sent.

.. |message_effect_id| replace:: Unique identifier of the message effect to be added to the message; for private chats only.
93 changes: 92 additions & 1 deletion telegram/_bot.py

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions telegram/_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ async def send_message(
link_preview_options: ODVInput["LinkPreviewOptions"] = DEFAULT_NONE,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1045,6 +1046,7 @@ async def send_message(
pool_timeout=pool_timeout,
api_kwargs=api_kwargs,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def delete_message(
Expand Down Expand Up @@ -1121,6 +1123,7 @@ async def send_media_group(
message_thread_id: Optional[int] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1162,6 +1165,7 @@ async def send_media_group(
caption_entities=caption_entities,
reply_parameters=reply_parameters,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_chat_action(
Expand Down Expand Up @@ -1214,6 +1218,7 @@ async def send_photo(
has_spoiler: Optional[bool] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1255,6 +1260,7 @@ async def send_photo(
api_kwargs=api_kwargs,
has_spoiler=has_spoiler,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_contact(
Expand All @@ -1269,6 +1275,7 @@ async def send_contact(
message_thread_id: Optional[int] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1309,6 +1316,7 @@ async def send_contact(
protect_content=protect_content,
message_thread_id=message_thread_id,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_audio(
Expand All @@ -1327,6 +1335,7 @@ async def send_audio(
thumbnail: Optional[FileInput] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1371,6 +1380,7 @@ async def send_audio(
api_kwargs=api_kwargs,
thumbnail=thumbnail,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_document(
Expand All @@ -1387,6 +1397,7 @@ async def send_document(
thumbnail: Optional[FileInput] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1429,6 +1440,7 @@ async def send_document(
protect_content=protect_content,
message_thread_id=message_thread_id,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_dice(
Expand All @@ -1440,6 +1452,7 @@ async def send_dice(
message_thread_id: Optional[int] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1475,6 +1488,7 @@ async def send_dice(
protect_content=protect_content,
message_thread_id=message_thread_id,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_game(
Expand All @@ -1486,6 +1500,7 @@ async def send_game(
message_thread_id: Optional[int] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1521,6 +1536,7 @@ async def send_game(
protect_content=protect_content,
message_thread_id=message_thread_id,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_invoice(
Expand Down Expand Up @@ -1551,6 +1567,7 @@ async def send_invoice(
protect_content: ODVInput[bool] = DEFAULT_NONE,
message_thread_id: Optional[int] = None,
reply_parameters: Optional["ReplyParameters"] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1615,6 +1632,7 @@ async def send_invoice(
protect_content=protect_content,
message_thread_id=message_thread_id,
reply_parameters=reply_parameters,
message_effect_id=message_effect_id,
)

async def send_location(
Expand All @@ -1631,6 +1649,7 @@ async def send_location(
message_thread_id: Optional[int] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1673,6 +1692,7 @@ async def send_location(
protect_content=protect_content,
message_thread_id=message_thread_id,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_animation(
Expand All @@ -1692,6 +1712,7 @@ async def send_animation(
thumbnail: Optional[FileInput] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1737,6 +1758,7 @@ async def send_animation(
has_spoiler=has_spoiler,
thumbnail=thumbnail,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_sticker(
Expand All @@ -1749,6 +1771,7 @@ async def send_sticker(
emoji: Optional[str] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1785,6 +1808,7 @@ async def send_sticker(
message_thread_id=message_thread_id,
emoji=emoji,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_venue(
Expand All @@ -1803,6 +1827,7 @@ async def send_venue(
message_thread_id: Optional[int] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1847,6 +1872,7 @@ async def send_venue(
protect_content=protect_content,
message_thread_id=message_thread_id,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_video(
Expand All @@ -1867,6 +1893,7 @@ async def send_video(
thumbnail: Optional[FileInput] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1913,6 +1940,7 @@ async def send_video(
message_thread_id=message_thread_id,
has_spoiler=has_spoiler,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_video_note(
Expand All @@ -1927,6 +1955,7 @@ async def send_video_note(
thumbnail: Optional[FileInput] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -1967,6 +1996,7 @@ async def send_video_note(
protect_content=protect_content,
message_thread_id=message_thread_id,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_voice(
Expand All @@ -1982,6 +2012,7 @@ async def send_voice(
message_thread_id: Optional[int] = None,
reply_parameters: Optional["ReplyParameters"] = None,
business_connection_id: Optional[str] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -2023,6 +2054,7 @@ async def send_voice(
protect_content=protect_content,
message_thread_id=message_thread_id,
business_connection_id=business_connection_id,
message_effect_id=message_effect_id,
)

async def send_poll(
Expand All @@ -2047,6 +2079,7 @@ async def send_poll(
business_connection_id: Optional[str] = None,
question_parse_mode: ODVInput[str] = DEFAULT_NONE,
question_entities: Optional[Sequence["MessageEntity"]] = None,
message_effect_id: Optional[str] = None,
*,
reply_to_message_id: Optional[int] = None,
allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
Expand Down Expand Up @@ -2083,6 +2116,7 @@ async def send_poll(
write_timeout=write_timeout,
connect_timeout=connect_timeout,
pool_timeout=pool_timeout,
message_effect_id=message_effect_id,
explanation=explanation,
explanation_parse_mode=explanation_parse_mode,
open_period=open_period,
Expand Down
Loading