From a43faba74273a6ae0ea96f8072c2b1e87600d956 Mon Sep 17 00:00:00 2001 From: Shrimadhav U K Date: Mon, 4 Nov 2024 14:20:08 +0530 Subject: [PATCH] Add allow_paid_broadcast parameter to methods. --- docs/source/releases/changes-in-this-fork.rst | 4 +- pyrogram/methods/bots/send_game.py | 5 + pyrogram/methods/business/send_invoice.py | 5 + pyrogram/methods/messages/copy_media_group.py | 15 +++ pyrogram/methods/messages/forward_messages.py | 5 + pyrogram/methods/messages/send_animation.py | 5 + pyrogram/methods/messages/send_audio.py | 5 + .../methods/messages/send_cached_media.py | 5 + pyrogram/methods/messages/send_contact.py | 5 + pyrogram/methods/messages/send_dice.py | 5 + pyrogram/methods/messages/send_document.py | 5 + pyrogram/methods/messages/send_location.py | 5 + pyrogram/methods/messages/send_media_group.py | 5 + pyrogram/methods/messages/send_message.py | 7 ++ pyrogram/methods/messages/send_paid_media.py | 5 + pyrogram/methods/messages/send_photo.py | 5 + pyrogram/methods/messages/send_poll.py | 5 + pyrogram/methods/messages/send_sticker.py | 5 + pyrogram/methods/messages/send_venue.py | 5 + pyrogram/methods/messages/send_video.py | 5 + pyrogram/methods/messages/send_video_note.py | 5 + pyrogram/methods/messages/send_voice.py | 5 + pyrogram/types/messages_and_media/message.py | 102 ++++++++++++++++++ 23 files changed, 222 insertions(+), 1 deletion(-) diff --git a/docs/source/releases/changes-in-this-fork.rst b/docs/source/releases/changes-in-this-fork.rst index 441eb0bd6..5692647ab 100644 --- a/docs/source/releases/changes-in-this-fork.rst +++ b/docs/source/releases/changes-in-this-fork.rst @@ -23,6 +23,9 @@ Changes in this Fork | Scheme layer used: 192 | +------------------------+ +- Added the parameter ``allow_paid_broadcast`` to the methods :meth:`~pyrogram.Client.copy_media_group`, :meth:`~pyrogram.Client.send_game`, :meth:`~pyrogram.Client.send_invoice`, :meth:`~pyrogram.Client.forward_messages`, :meth:`~pyrogram.Client.send_animation`, :meth:`~pyrogram.Client.send_audio`, :meth:`~pyrogram.Client.send_cached_media`, :meth:`~pyrogram.Client.send_contact`, :meth:`~pyrogram.Client.send_dice`, :meth:`~pyrogram.Client.send_document`, :meth:`~pyrogram.Client.send_location`, :meth:`~pyrogram.Client.send_media_group`, :meth:`~pyrogram.Client.send_message`, :meth:`~pyrogram.Client.send_paid_media`, :meth:`~pyrogram.Client.send_photo`, :meth:`~pyrogram.Client.send_poll`, :meth:`~pyrogram.Client.send_sticker`, :meth:`~pyrogram.Client.send_venue`, :meth:`~pyrogram.Client.send_video_note`, :meth:`~pyrogram.Client.send_video`, :meth:`~pyrogram.Client.send_voice` and the bound methods :meth:`~pyrogram.types.Message.reply_game`, :meth:`~pyrogram.types.Message.reply_text`, :meth:`~pyrogram.types.Message.reply_animation`, :meth:`~pyrogram.types.Message.reply_audio`, :meth:`~pyrogram.types.Message.reply_contact`, :meth:`~pyrogram.types.Message.reply_document`, :meth:`~pyrogram.types.Message.reply_location`, :meth:`~pyrogram.types.Message.reply_media_group`, :meth:`~pyrogram.types.Message.reply_photo`, :meth:`~pyrogram.types.Message.reply_poll`, :meth:`~pyrogram.types.Message.reply_sticker`, :meth:`~pyrogram.types.Message.reply_venue`, :meth:`~pyrogram.types.Message.reply_video`, :meth:`~pyrogram.types.Message.reply_video_note`, :meth:`~pyrogram.types.Message.reply_voice`, :meth:`~pyrogram.types.Message.reply_invoice`, :meth:`~pyrogram.types.Message.forward`, :meth:`~pyrogram.types.Message.copy`, :meth:`~pyrogram.types.Message.reply_cached_media`. +- Introduced the ability to add media to existing text messages using the method :meth:`~pyrogram.Client.edit_message_media`, :meth:`~pyrogram.Client.edit_cached_media`, :meth:`~pyrogram.types.Message.edit_media`, :meth:`~pyrogram.types.Message.edit_cached_media`. +- Added the class :obj:`~pyrogram.types.CopyTextButton` and the field ``copy_text`` in the class :obj:`~pyrogram.types.InlineKeyboardButton` allowing bots to send and receive inline buttons that copy arbitrary text. - View `new and changed `__ `raw API methods `__. +------------------------+ @@ -41,7 +44,6 @@ Changes in this Fork - Added :meth:`~pyrogram.types.Message.star` bound method to the :obj:`~pyrogram.types.Message`. - Added the field ``alternative_videos`` to the :obj:`~pyrogram.types.Message`. - Added the fields ``connected_website`` and ``write_access_allowed`` to the :obj:`~pyrogram.types.Message`. -- Add ``copy_text`` to :obj:`~pyrogram.types.InlineKeyboardButton`. - Fix ``chat`` being None in some cases in the :obj:`~pyrogram.types.Message`. - Fix deleting messages does not return the count in some cases. - View `new and changed `__ `raw API methods `__. diff --git a/pyrogram/methods/bots/send_game.py b/pyrogram/methods/bots/send_game.py index 4cd4a8a6e..78890298e 100644 --- a/pyrogram/methods/bots/send_game.py +++ b/pyrogram/methods/bots/send_game.py @@ -32,6 +32,7 @@ async def send_game( game_short_name: str, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_thread_id: int = None, business_connection_id: str = None, send_as: Union[int, str] = None, @@ -65,6 +66,9 @@ async def send_game( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_thread_id (``int``, *optional*): If the message is in a thread, ID of the original message. @@ -129,6 +133,7 @@ async def send_game( random_id=self.rnd_id(), send_as=await self.resolve_peer(send_as) if send_as else None, noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, effect=message_effect_id, reply_markup=await reply_markup.write(self) if reply_markup else None ) diff --git a/pyrogram/methods/business/send_invoice.py b/pyrogram/methods/business/send_invoice.py index cd3066065..291762aab 100644 --- a/pyrogram/methods/business/send_invoice.py +++ b/pyrogram/methods/business/send_invoice.py @@ -53,6 +53,7 @@ async def send_invoice( is_flexible: bool = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, send_as: Union[int, str] = None, @@ -147,6 +148,9 @@ async def send_invoice( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -224,6 +228,7 @@ async def send_invoice( random_id=self.rnd_id(), send_as=await self.resolve_peer(send_as) if send_as else None, noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) diff --git a/pyrogram/methods/messages/copy_media_group.py b/pyrogram/methods/messages/copy_media_group.py index 3c500e047..97c875884 100644 --- a/pyrogram/methods/messages/copy_media_group.py +++ b/pyrogram/methods/messages/copy_media_group.py @@ -38,6 +38,9 @@ async def copy_media_group( message_thread_id: int = None, send_as: Union[int, str] = None, schedule_date: datetime = None, + protect_content: bool = None, + allow_paid_broadcast: bool = None, + message_effect_id: int = None, reply_to_message_id: int = None ) -> List["types.Message"]: """Copy a media group by providing one of the message ids. @@ -87,6 +90,15 @@ async def copy_media_group( schedule_date (:py:obj:`~datetime.datetime`, *optional*): Date when the message will be automatically sent. + protect_content (``bool``, *optional*): + Pass True if the content of the message must be protected from forwarding and saving; for bots only. + + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + + message_effect_id (``int`` ``64-bit``, *optional*): + Unique identifier of the message effect to be added to the message; for private chats only. + Returns: List of :obj:`~pyrogram.types.Message`: On success, a list of copied messages is returned. @@ -167,6 +179,9 @@ async def copy_media_group( reply_to=reply_to, send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), + noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, + effect=message_effect_id, invert_media=any(show_caption_above_media) ), sleep_threshold=60 diff --git a/pyrogram/methods/messages/forward_messages.py b/pyrogram/methods/messages/forward_messages.py index 7a02f9b13..33d67169a 100644 --- a/pyrogram/methods/messages/forward_messages.py +++ b/pyrogram/methods/messages/forward_messages.py @@ -33,6 +33,7 @@ async def forward_messages( message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, drop_author: bool = None, drop_media_captions: bool = None, send_as: Union[int, str] = None, @@ -66,6 +67,9 @@ async def forward_messages( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a fee; for bots only + drop_author (``bool``, *optional*): Whether to forward messages without quoting the original author. @@ -109,6 +113,7 @@ async def forward_messages( drop_author=drop_author, drop_media_captions=drop_media_captions, noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, random_id=[self.rnd_id() for _ in message_ids], send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), diff --git a/pyrogram/methods/messages/send_animation.py b/pyrogram/methods/messages/send_animation.py index 81841549b..8cc459e7a 100644 --- a/pyrogram/methods/messages/send_animation.py +++ b/pyrogram/methods/messages/send_animation.py @@ -55,6 +55,7 @@ async def send_animation( message_effect_id: int = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, ttl_seconds: int = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -151,6 +152,9 @@ async def send_animation( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + ttl_seconds (``int``, *optional*): The message will be self-destructed in the specified time after its content was opened. The message's self-destruct time, in seconds; must be between 0 and 60 in private chats. @@ -293,6 +297,7 @@ async def progress(current, total): send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, invert_media=show_caption_above_media, diff --git a/pyrogram/methods/messages/send_audio.py b/pyrogram/methods/messages/send_audio.py index 20c121cd6..35544ebad 100644 --- a/pyrogram/methods/messages/send_audio.py +++ b/pyrogram/methods/messages/send_audio.py @@ -52,6 +52,7 @@ async def send_audio( message_effect_id: int = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -139,6 +140,9 @@ async def send_audio( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*): Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. @@ -262,6 +266,7 @@ async def progress(current, total): send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) diff --git a/pyrogram/methods/messages/send_cached_media.py b/pyrogram/methods/messages/send_cached_media.py index 8cb0bb0cc..0b828e1eb 100644 --- a/pyrogram/methods/messages/send_cached_media.py +++ b/pyrogram/methods/messages/send_cached_media.py @@ -43,6 +43,7 @@ async def send_cached_media( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, has_spoiler: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -112,6 +113,9 @@ async def send_cached_media( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + has_spoiler (``bool``, *optional*): True, if the message media is covered by a spoiler animation. @@ -155,6 +159,7 @@ async def send_cached_media( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, invert_media=show_caption_above_media, diff --git a/pyrogram/methods/messages/send_contact.py b/pyrogram/methods/messages/send_contact.py index 2bb9ccdaa..52ab443af 100644 --- a/pyrogram/methods/messages/send_contact.py +++ b/pyrogram/methods/messages/send_contact.py @@ -41,6 +41,7 @@ async def send_contact( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -98,6 +99,9 @@ async def send_contact( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -147,6 +151,7 @@ async def send_contact( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id ) diff --git a/pyrogram/methods/messages/send_dice.py b/pyrogram/methods/messages/send_dice.py index 35ed9e009..2f3431f85 100644 --- a/pyrogram/methods/messages/send_dice.py +++ b/pyrogram/methods/messages/send_dice.py @@ -38,6 +38,7 @@ async def send_dice( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -90,6 +91,9 @@ async def send_dice( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -140,6 +144,7 @@ async def send_dice( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, message="" diff --git a/pyrogram/methods/messages/send_document.py b/pyrogram/methods/messages/send_document.py index 596c6eb4a..1d9540325 100644 --- a/pyrogram/methods/messages/send_document.py +++ b/pyrogram/methods/messages/send_document.py @@ -50,6 +50,7 @@ async def send_document( message_effect_id: int = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -133,6 +134,9 @@ async def send_document( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*): Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. @@ -254,6 +258,7 @@ async def progress(current, total): send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) diff --git a/pyrogram/methods/messages/send_location.py b/pyrogram/methods/messages/send_location.py index 2bfdf8ecd..075f67cc4 100644 --- a/pyrogram/methods/messages/send_location.py +++ b/pyrogram/methods/messages/send_location.py @@ -42,6 +42,7 @@ async def send_location( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -96,6 +97,9 @@ async def send_location( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -146,6 +150,7 @@ async def send_location( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id ) diff --git a/pyrogram/methods/messages/send_media_group.py b/pyrogram/methods/messages/send_media_group.py index 1af3a893d..2b1674cd6 100644 --- a/pyrogram/methods/messages/send_media_group.py +++ b/pyrogram/methods/messages/send_media_group.py @@ -48,6 +48,7 @@ async def send_media_group( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_to_message_id: int = None ) -> List["types.Message"]: @@ -90,6 +91,9 @@ async def send_media_group( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -459,6 +463,7 @@ async def send_media_group( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, effect=message_effect_id, invert_media=any(show_caption_above_media) ) diff --git a/pyrogram/methods/messages/send_message.py b/pyrogram/methods/messages/send_message.py index a5716f4d1..63b34a845 100644 --- a/pyrogram/methods/messages/send_message.py +++ b/pyrogram/methods/messages/send_message.py @@ -37,6 +37,7 @@ async def send_message( link_preview_options: "types.LinkPreviewOptions" = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_thread_id: int = None, business_connection_id: str = None, send_as: Union[int, str] = None, @@ -81,6 +82,9 @@ async def send_message( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only message_thread_id (``int``, *optional*): If the message is in a thread, ID of the original message. @@ -218,6 +222,7 @@ async def send_message( invert_media=link_preview_options.show_above_text, entities=entities, noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, effect=message_effect_id ) if business_connection_id: @@ -254,6 +259,7 @@ async def send_message( # TODO # TODO noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, # TODO invert_media=link_preview_options.show_above_text if link_preview_options else None, reply_to=reply_to, @@ -285,6 +291,7 @@ async def send_message( # TODO # TODO noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, # TODO invert_media=link_preview_options.show_above_text if link_preview_options else None, reply_to=reply_to, diff --git a/pyrogram/methods/messages/send_paid_media.py b/pyrogram/methods/messages/send_paid_media.py index 24d6cb131..033123d74 100644 --- a/pyrogram/methods/messages/send_paid_media.py +++ b/pyrogram/methods/messages/send_paid_media.py @@ -44,6 +44,7 @@ async def send_paid_media( show_caption_above_media: bool = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_parameters: "types.ReplyParameters" = None, business_connection_id: str = None, send_as: Union[int, str] = None, @@ -92,6 +93,9 @@ async def send_paid_media( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_parameters (:obj:`~pyrogram.types.ReplyParameters`, *optional*): Description of the message to reply to @@ -273,6 +277,7 @@ async def send_paid_media( schedule_date=utils.datetime_to_timestamp(schedule_date), reply_markup=await reply_markup.write(self) if reply_markup else None, noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, invert_media=show_caption_above_media, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) ) diff --git a/pyrogram/methods/messages/send_photo.py b/pyrogram/methods/messages/send_photo.py index 812b90e59..34268d4c3 100644 --- a/pyrogram/methods/messages/send_photo.py +++ b/pyrogram/methods/messages/send_photo.py @@ -49,6 +49,7 @@ async def send_photo( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, view_once: bool = None, message_effect_id: int = None, reply_markup: Union[ @@ -124,6 +125,9 @@ async def send_photo( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + view_once (``bool``, *optional*): Pass True if the message should be opened only once and should be self-destructed once closed; private chats only. @@ -236,6 +240,7 @@ async def send_photo( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, invert_media=show_caption_above_media, diff --git a/pyrogram/methods/messages/send_poll.py b/pyrogram/methods/messages/send_poll.py index 5991a92da..555bd176e 100644 --- a/pyrogram/methods/messages/send_poll.py +++ b/pyrogram/methods/messages/send_poll.py @@ -46,6 +46,7 @@ async def send_poll( is_closed: bool = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_parameters: "types.ReplyParameters" = None, message_thread_id: int = None, business_connection_id: str = None, @@ -131,6 +132,9 @@ async def send_poll( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_parameters (:obj:`~pyrogram.types.ReplyParameters`, *optional*): Description of the message to reply to @@ -249,6 +253,7 @@ async def send_poll( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id ) diff --git a/pyrogram/methods/messages/send_sticker.py b/pyrogram/methods/messages/send_sticker.py index 50c9bd56b..8c93fb823 100644 --- a/pyrogram/methods/messages/send_sticker.py +++ b/pyrogram/methods/messages/send_sticker.py @@ -42,6 +42,7 @@ async def send_sticker( emoji: str = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_thread_id: int = None, business_connection_id: str = None, send_as: Union[int, str] = None, @@ -95,6 +96,9 @@ async def send_sticker( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_thread_id (``int``, *optional*): If the message is in a thread, ID of the original message. @@ -218,6 +222,7 @@ async def send_sticker( noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, peer=await self.resolve_peer(chat_id), diff --git a/pyrogram/methods/messages/send_venue.py b/pyrogram/methods/messages/send_venue.py index 88f786dea..a20782511 100644 --- a/pyrogram/methods/messages/send_venue.py +++ b/pyrogram/methods/messages/send_venue.py @@ -45,6 +45,7 @@ async def send_venue( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -109,6 +110,9 @@ async def send_venue( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -166,6 +170,7 @@ async def send_venue( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id ) diff --git a/pyrogram/methods/messages/send_video.py b/pyrogram/methods/messages/send_video.py index 6a97d76c6..715d22f6d 100644 --- a/pyrogram/methods/messages/send_video.py +++ b/pyrogram/methods/messages/send_video.py @@ -48,6 +48,7 @@ async def send_video( supports_streaming: bool = True, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_thread_id: int = None, business_connection_id: str = None, send_as: Union[int, str] = None, @@ -127,6 +128,9 @@ async def send_video( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_thread_id (``int``, *optional*): If the message is in a thread, ID of the original message. @@ -300,6 +304,7 @@ async def progress(current, total): send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, invert_media=show_caption_above_media, diff --git a/pyrogram/methods/messages/send_video_note.py b/pyrogram/methods/messages/send_video_note.py index 47209875c..8f8a999ee 100644 --- a/pyrogram/methods/messages/send_video_note.py +++ b/pyrogram/methods/messages/send_video_note.py @@ -40,6 +40,7 @@ async def send_video_note( thumb: Union[str, BinaryIO] = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_thread_id: int = None, business_connection_id: str = None, send_as: Union[int, str] = None, @@ -97,6 +98,9 @@ async def send_video_note( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_thread_id (``int``, *optional*): If the message is in a thread, ID of the original message. @@ -256,6 +260,7 @@ async def send_video_note( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) diff --git a/pyrogram/methods/messages/send_voice.py b/pyrogram/methods/messages/send_voice.py index da7caf82a..65ce12bda 100644 --- a/pyrogram/methods/messages/send_voice.py +++ b/pyrogram/methods/messages/send_voice.py @@ -42,6 +42,7 @@ async def send_voice( duration: int = 0, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_thread_id: int = None, business_connection_id: str = None, send_as: Union[int, str] = None, @@ -98,6 +99,9 @@ async def send_voice( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_thread_id (``int``, *optional*): If the message is in a thread, ID of the original message. @@ -252,6 +256,7 @@ async def send_voice( send_as=await self.resolve_peer(send_as) if send_as else None, schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, + allow_paid_floodskip=allow_paid_broadcast, reply_markup=await reply_markup.write(self) if reply_markup else None, effect=message_effect_id, **await utils.parse_text_entities(self, caption, parse_mode, caption_entities) diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index e192325ec..9f3c41ff3 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -1487,6 +1487,7 @@ async def reply_text( link_preview_options: "types.LinkPreviewOptions" = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, reply_markup: Union[ @@ -1547,6 +1548,9 @@ async def reply_text( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -1589,6 +1593,7 @@ async def reply_text( link_preview_options=link_preview_options, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_thread_id=self.message_thread_id, business_connection_id=self.business_connection_id, send_as=send_as, @@ -1622,6 +1627,7 @@ async def reply_animation( reply_parameters: "types.ReplyParameters" = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, ttl_seconds: int = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -1724,6 +1730,9 @@ async def reply_animation( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + ttl_seconds (``int``, *optional*): The message will be self-destructed in the specified time after its content was opened. The message's self-destruct time, in seconds; must be between 0 and 60 in private chats. @@ -1792,6 +1801,7 @@ async def reply_animation( send_as=send_as, schedule_date=schedule_date, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, ttl_seconds=ttl_seconds, reply_markup=reply_markup, reply_to_message_id=reply_to_message_id, @@ -1817,6 +1827,7 @@ async def reply_audio( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -1907,6 +1918,9 @@ async def reply_audio( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*): Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. @@ -1968,6 +1982,7 @@ async def reply_audio( send_as=send_as, schedule_date=schedule_date, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_markup=reply_markup, reply_to_message_id=reply_to_message_id, progress=progress, @@ -1984,6 +1999,7 @@ async def reply_cached_media( show_caption_above_media: bool = None, disable_notification: bool = None, message_effect_id: int = None, + allow_paid_broadcast: bool = None, reply_parameters: "types.ReplyParameters" = None, send_as: Union[int, str] = None, schedule_date: datetime = None, @@ -2041,6 +2057,9 @@ async def reply_cached_media( message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_parameters (:obj:`~pyrogram.types.ReplyParameters`, *optional*): Description of the message to reply to @@ -2081,6 +2100,7 @@ async def reply_cached_media( show_caption_above_media=show_caption_above_media, disable_notification=disable_notification, message_effect_id=message_effect_id, + allow_paid_broadcast=allow_paid_broadcast, reply_parameters=reply_parameters, message_thread_id=self.message_thread_id, business_connection_id=self.business_connection_id, @@ -2167,6 +2187,7 @@ async def reply_contact( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2233,6 +2254,9 @@ async def reply_contact( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*): Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. @@ -2265,6 +2289,7 @@ async def reply_contact( send_as=send_as, schedule_date=schedule_date, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_markup=reply_markup, reply_to_message_id=reply_to_message_id ) @@ -2285,6 +2310,7 @@ async def reply_document( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2373,6 +2399,9 @@ async def reply_document( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*): Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. @@ -2432,6 +2461,7 @@ async def reply_document( send_as=send_as, schedule_date=schedule_date, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_markup=reply_markup, reply_to_message_id=reply_to_message_id, force_document=force_document, @@ -2445,6 +2475,7 @@ async def reply_game( quote: bool = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, send_as: Union[int, str] = None, @@ -2501,6 +2532,9 @@ async def reply_game( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup`, *optional*): An object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown automatically. If not empty, the first button must launch the game. @@ -2526,6 +2560,8 @@ async def reply_game( message_effect_id=message_effect_id, reply_parameters=reply_parameters, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, + allow_paid_broadcast=allow_paid_broadcast, message_thread_id=self.message_thread_id, business_connection_id=self.business_connection_id, send_as=send_as, @@ -2623,6 +2659,7 @@ async def reply_location( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -2686,6 +2723,9 @@ async def reply_location( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*): Additional interface options. An object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. @@ -2717,6 +2757,7 @@ async def reply_location( send_as=send_as, schedule_date=schedule_date, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_markup=reply_markup, reply_to_message_id=reply_to_message_id ) @@ -2731,6 +2772,7 @@ async def reply_media_group( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_to_message_id: int = None ) -> List["types.Message"]: """Bound method *reply_media_group* of :obj:`~pyrogram.types.Message`. @@ -2783,6 +2825,9 @@ async def reply_media_group( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + Returns: On success, a :obj:`~pyrogram.types.Messages` object is returned containing all the single messages sent. @@ -2809,6 +2854,7 @@ async def reply_media_group( send_as=send_as, schedule_date=schedule_date, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_to_message_id=reply_to_message_id ) @@ -2828,6 +2874,7 @@ async def reply_photo( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, view_once: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", @@ -2910,6 +2957,9 @@ async def reply_photo( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + view_once (``bool``, *optional*): Pass True if the message should be opened only once and should be self-destructed once closed; private chats only. @@ -2972,6 +3022,7 @@ async def reply_photo( send_as=send_as, schedule_date=schedule_date, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, view_once=view_once, reply_markup=reply_markup, reply_to_message_id=reply_to_message_id, @@ -2998,6 +3049,7 @@ async def reply_poll( quote: bool = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, send_as: Union[int, str] = None, @@ -3105,6 +3157,9 @@ async def reply_poll( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -3157,6 +3212,7 @@ async def reply_poll( is_closed=is_closed, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id, reply_parameters=reply_parameters, message_thread_id=self.message_thread_id, @@ -3177,6 +3233,7 @@ async def reply_sticker( emoji: str = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, reply_markup: Union[ @@ -3239,6 +3296,9 @@ async def reply_sticker( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -3306,6 +3366,7 @@ async def reply_sticker( emoji=emoji, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_thread_id=self.message_thread_id, business_connection_id=self.business_connection_id, send_as=send_as, @@ -3334,6 +3395,7 @@ async def reply_venue( send_as: Union[int, str] = None, schedule_date: datetime = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, reply_markup: Union[ "types.InlineKeyboardMarkup", "types.ReplyKeyboardMarkup", @@ -3396,6 +3458,9 @@ async def reply_venue( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -3443,6 +3508,7 @@ async def reply_venue( send_as=send_as, schedule_date=schedule_date, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_to_message_id=reply_to_message_id, reply_markup=reply_markup ) @@ -3463,6 +3529,7 @@ async def reply_video( supports_streaming: bool = True, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, reply_markup: Union[ @@ -3551,6 +3618,9 @@ async def reply_video( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -3638,6 +3708,7 @@ async def reply_video( supports_streaming=supports_streaming, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_thread_id=self.message_thread_id, business_connection_id=self.business_connection_id, send_as=send_as, @@ -3663,6 +3734,7 @@ async def reply_video_note( thumb: str = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, reply_markup: Union[ @@ -3729,6 +3801,9 @@ async def reply_video_note( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -3812,6 +3887,7 @@ async def reply_video_note( thumb=thumb, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_thread_id=self.message_thread_id, business_connection_id=self.business_connection_id, send_as=send_as, @@ -3839,6 +3915,7 @@ async def reply_voice( duration: int = 0, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, reply_markup: Union[ @@ -3904,6 +3981,9 @@ async def reply_voice( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -3981,6 +4061,7 @@ async def reply_voice( duration=duration, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_thread_id=self.message_thread_id, business_connection_id=self.business_connection_id, send_as=send_as, @@ -4023,6 +4104,7 @@ async def reply_invoice( is_flexible: bool = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_effect_id: int = None, reply_parameters: "types.ReplyParameters" = None, send_as: Union[int, str] = None, @@ -4117,6 +4199,9 @@ async def reply_invoice( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. @@ -4184,6 +4269,7 @@ async def reply_invoice( is_flexible=is_flexible, disable_notification=disable_notification, protect_content=self.has_protected_content if protect_content is None else protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=message_effect_id or self.effect_id, reply_parameters=reply_parameters, send_as=send_as, @@ -4467,6 +4553,7 @@ async def forward( message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, drop_author: bool = None, drop_media_captions: bool = None, send_as: Union[int, str] = None, @@ -4505,6 +4592,9 @@ async def forward( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a fee; for bots only + drop_author (``bool``, *optional*): Whether to forward messages without quoting the original author. @@ -4534,6 +4624,7 @@ async def forward( message_thread_id=message_thread_id, disable_notification=disable_notification, protect_content=protect_content, + allow_paid_broadcast=allow_paid_broadcast, drop_author=drop_author, drop_media_captions=drop_media_captions, send_as=send_as, @@ -4559,6 +4650,7 @@ async def copy( schedule_date: datetime = None, business_connection_id: str = None, protect_content: bool = None, + allow_paid_broadcast: bool = None, message_thread_id: int = None, reply_to_message_id: int = None ) -> Union["types.Message", List["types.Message"]]: @@ -4629,6 +4721,9 @@ async def copy( protect_content (``bool``, *optional*): Pass True if the content of the message must be protected from forwarding and saving; for bots only. + allow_paid_broadcast (``bool``, *optional*): + Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only + message_thread_id (``int``, *optional*): Unique identifier for the target message thread (topic) of the forum; for forum supergroups only @@ -4657,6 +4752,7 @@ async def copy( link_preview_options=self.link_preview_options, disable_notification=disable_notification, protect_content=self.has_protected_content if protect_content is None else protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=self.effect_id, reply_parameters=reply_parameters, reply_markup=self.reply_markup if reply_markup is object else reply_markup, @@ -4676,6 +4772,7 @@ async def copy( business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id, schedule_date=schedule_date, protect_content=self.has_protected_content if protect_content is None else protect_content, + allow_paid_broadcast=allow_paid_broadcast, has_spoiler=self.has_media_spoiler, reply_to_message_id=reply_to_message_id, send_as=send_as, @@ -4712,6 +4809,7 @@ async def copy( business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id, schedule_date=schedule_date, protect_content=self.has_protected_content if protect_content is None else protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_to_message_id=reply_to_message_id, send_as=send_as, reply_markup=self.reply_markup if reply_markup is object else reply_markup @@ -4728,6 +4826,7 @@ async def copy( business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id, schedule_date=schedule_date, protect_content=self.has_protected_content if protect_content is None else protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_to_message_id=reply_to_message_id, send_as=send_as, reply_markup=self.reply_markup if reply_markup is object else reply_markup @@ -4748,6 +4847,7 @@ async def copy( business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id, schedule_date=schedule_date, protect_content=self.has_protected_content if protect_content is None else protect_content, + allow_paid_broadcast=allow_paid_broadcast, reply_to_message_id=reply_to_message_id, send_as=send_as, reply_markup=self.reply_markup if reply_markup is object else reply_markup @@ -4773,6 +4873,7 @@ async def copy( close_date=self.poll.close_date, disable_notification=disable_notification, protect_content=self.has_protected_content if protect_content is None else protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_effect_id=self.effect_id, reply_parameters=reply_parameters, message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id, @@ -4788,6 +4889,7 @@ async def copy( game_short_name=self.game.short_name, disable_notification=disable_notification, protect_content=self.has_protected_content if protect_content is None else protect_content, + allow_paid_broadcast=allow_paid_broadcast, message_thread_id=self.message_thread_id if message_thread_id is None else message_thread_id, business_connection_id=self.business_connection_id if business_connection_id is None else business_connection_id, message_effect_id=self.effect_id,