diff --git a/pyrogram/methods/bots/send_game.py b/pyrogram/methods/bots/send_game.py index faafa91c..4bd9f50b 100644 --- a/pyrogram/methods/bots/send_game.py +++ b/pyrogram/methods/bots/send_game.py @@ -102,7 +102,7 @@ async def send_game( Repeat period of the scheduled message. allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. quick_reply_shortcut (``str`` | ``int``, *optional*): Quick reply shortcut identifier or name. diff --git a/pyrogram/methods/business/send_invoice.py b/pyrogram/methods/business/send_invoice.py index 502d12e0..08240080 100644 --- a/pyrogram/methods/business/send_invoice.py +++ b/pyrogram/methods/business/send_invoice.py @@ -26,6 +26,7 @@ async def send_invoice( message_thread_id: int | None = None, quote_text: str | None = None, allow_paid_broadcast: bool | None = None, + allow_paid_stars: int | None = None, quote_entities: list[types.MessageEntity] | None = None, reply_markup: types.InlineKeyboardMarkup | None = None, ): @@ -90,6 +91,9 @@ async def send_invoice( for reply_to_message only. allow_paid_broadcast (``bool``, *optional*): + + allow_paid_stars (``int``, *optional*): + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only quote_entities (List of :obj:`~pyrogram.types.MessageEntity`, *optional*): @@ -211,6 +215,7 @@ async def send_invoice( extended_media=cast("Any", extended_media), ), allow_paid_floodskip=allow_paid_broadcast, + allow_paid_stars=allow_paid_stars, random_id=self.rnd_id(), reply_to=reply_to, message="", diff --git a/pyrogram/methods/messages/copy_message.py b/pyrogram/methods/messages/copy_message.py index ccfe3fc5..f67a7cd6 100644 --- a/pyrogram/methods/messages/copy_message.py +++ b/pyrogram/methods/messages/copy_message.py @@ -112,7 +112,7 @@ async def copy_message( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only. allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. diff --git a/pyrogram/methods/messages/forward_messages.py b/pyrogram/methods/messages/forward_messages.py index 5e7be666..fc64c330 100644 --- a/pyrogram/methods/messages/forward_messages.py +++ b/pyrogram/methods/messages/forward_messages.py @@ -74,7 +74,7 @@ async def forward_messages( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only. allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. drop_author (``bool``, *optional*): Forwards messages without quoting the original author diff --git a/pyrogram/methods/messages/send_animation.py b/pyrogram/methods/messages/send_animation.py index 1bc4246c..9b7babf8 100644 --- a/pyrogram/methods/messages/send_animation.py +++ b/pyrogram/methods/messages/send_animation.py @@ -161,7 +161,7 @@ async def send_animation( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only. allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. invert_media (``bool``, *optional*): Inverts the position of the animation and caption. diff --git a/pyrogram/methods/messages/send_audio.py b/pyrogram/methods/messages/send_audio.py index 9403d75d..de1d660e 100644 --- a/pyrogram/methods/messages/send_audio.py +++ b/pyrogram/methods/messages/send_audio.py @@ -41,6 +41,7 @@ async def send_audio( schedule_date: datetime | None = None, protect_content: bool | None = None, allow_paid_broadcast: bool | None = None, + allow_paid_stars: int | None = None, reply_markup: types.InlineKeyboardMarkup | None | types.ReplyKeyboardMarkup @@ -139,6 +140,9 @@ async def send_audio( Protects the contents of the sent message from forwarding and saving. allow_paid_broadcast (``bool``, *optional*): + + allow_paid_stars (``int``, *optional*): + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. 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*): @@ -268,6 +272,7 @@ async def progress(current, total): schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, allow_paid_floodskip=allow_paid_broadcast, + allow_paid_stars=allow_paid_stars, effect=message_effect_id, reply_markup=await reply_markup.write(self) if reply_markup diff --git a/pyrogram/methods/messages/send_cached_media.py b/pyrogram/methods/messages/send_cached_media.py index ee50a16c..695ad0ac 100644 --- a/pyrogram/methods/messages/send_cached_media.py +++ b/pyrogram/methods/messages/send_cached_media.py @@ -116,7 +116,7 @@ async def send_cached_media( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. diff --git a/pyrogram/methods/messages/send_contact.py b/pyrogram/methods/messages/send_contact.py index 6b51f38b..25c0341b 100644 --- a/pyrogram/methods/messages/send_contact.py +++ b/pyrogram/methods/messages/send_contact.py @@ -110,7 +110,7 @@ async def send_contact( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. invert_media (``bool``, *optional*): Inverts the position of the media and caption. diff --git a/pyrogram/methods/messages/send_dice.py b/pyrogram/methods/messages/send_dice.py index 1eede1a5..e9a8cb8d 100644 --- a/pyrogram/methods/messages/send_dice.py +++ b/pyrogram/methods/messages/send_dice.py @@ -26,6 +26,7 @@ async def send_dice( schedule_date: datetime | None = None, protect_content: bool | None = None, allow_paid_broadcast: bool | None = None, + allow_paid_stars: int | None = None, message_effect_id: int | None = None, reply_markup: types.InlineKeyboardMarkup | None @@ -94,6 +95,9 @@ async def send_dice( Protects the contents of the sent message from forwarding and saving. allow_paid_broadcast (``bool``, *optional*): + + allow_paid_stars (``int``, *optional*): + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. 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*): @@ -140,6 +144,7 @@ async def send_dice( schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, allow_paid_floodskip=allow_paid_broadcast, + allow_paid_stars=allow_paid_stars, 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 c509abca..ca1be87d 100644 --- a/pyrogram/methods/messages/send_document.py +++ b/pyrogram/methods/messages/send_document.py @@ -39,6 +39,7 @@ async def send_document( schedule_date: datetime | None = None, protect_content: bool | None = None, allow_paid_broadcast: bool | None = None, + allow_paid_stars: int | None = None, reply_markup: types.InlineKeyboardMarkup | None | types.ReplyKeyboardMarkup @@ -131,6 +132,9 @@ async def send_document( Protects the contents of the sent message from forwarding and saving. allow_paid_broadcast (``bool``, *optional*): + + allow_paid_stars (``int``, *optional*): + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. 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*): @@ -250,6 +254,7 @@ async def progress(current, total): schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, allow_paid_floodskip=allow_paid_broadcast, + allow_paid_stars=allow_paid_stars, effect=message_effect_id, reply_markup=await reply_markup.write(self) if reply_markup @@ -273,7 +278,7 @@ async def progress(current, total): except FilePartMissing as e: await self.save_file( document, - file_id=file.id, + file_id=getattr(file, "id", None), file_part=e.value, ) else: diff --git a/pyrogram/methods/messages/send_location.py b/pyrogram/methods/messages/send_location.py index 370b027a..b2a8194f 100644 --- a/pyrogram/methods/messages/send_location.py +++ b/pyrogram/methods/messages/send_location.py @@ -106,7 +106,7 @@ async def send_location( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. diff --git a/pyrogram/methods/messages/send_media_group.py b/pyrogram/methods/messages/send_media_group.py index e2ece3bc..488191a0 100644 --- a/pyrogram/methods/messages/send_media_group.py +++ b/pyrogram/methods/messages/send_media_group.py @@ -115,7 +115,7 @@ async def send_media_group( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only. allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. diff --git a/pyrogram/methods/messages/send_message.py b/pyrogram/methods/messages/send_message.py index bf8f34f9..5e301490 100644 --- a/pyrogram/methods/messages/send_message.py +++ b/pyrogram/methods/messages/send_message.py @@ -112,7 +112,7 @@ async def send_message( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. invert_media (``bool``, *optional*): Move web page preview to above the message. diff --git a/pyrogram/methods/messages/send_photo.py b/pyrogram/methods/messages/send_photo.py index d2e91485..7600474f 100644 --- a/pyrogram/methods/messages/send_photo.py +++ b/pyrogram/methods/messages/send_photo.py @@ -135,7 +135,7 @@ async def send_photo( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. diff --git a/pyrogram/methods/messages/send_poll.py b/pyrogram/methods/messages/send_poll.py index d06cf3f3..bdb4ef90 100644 --- a/pyrogram/methods/messages/send_poll.py +++ b/pyrogram/methods/messages/send_poll.py @@ -123,7 +123,7 @@ async def send_poll( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_thread_id (``int``, *optional*): Unique identifier for the target message thread (topic) of the forum. diff --git a/pyrogram/methods/messages/send_sticker.py b/pyrogram/methods/messages/send_sticker.py index 8ceec5a5..d383537f 100644 --- a/pyrogram/methods/messages/send_sticker.py +++ b/pyrogram/methods/messages/send_sticker.py @@ -34,6 +34,7 @@ async def send_sticker( schedule_date: datetime | None = None, protect_content: bool | None = None, allow_paid_broadcast: bool | None = None, + allow_paid_stars: int | None = None, message_effect_id: int | None = None, reply_markup: types.InlineKeyboardMarkup | None @@ -107,6 +108,9 @@ async def send_sticker( Protects the contents of the sent message from forwarding and saving. allow_paid_broadcast (``bool``, *optional*): + + allow_paid_stars (``int``, *optional*): + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. 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*): @@ -219,6 +223,7 @@ async def send_sticker( schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, allow_paid_floodskip=allow_paid_broadcast, + allow_paid_stars=allow_paid_stars, effect=message_effect_id, reply_markup=await reply_markup.write(self) if reply_markup @@ -235,7 +240,7 @@ async def send_sticker( else: r = await self.invoke(rpc) except FilePartMissing as e: - await self.save_file(sticker, file_id=file.id, file_part=e.value) + await self.save_file(sticker, file_id=getattr(file, "id", None), file_part=e.value) else: for i in r.updates: if isinstance( diff --git a/pyrogram/methods/messages/send_venue.py b/pyrogram/methods/messages/send_venue.py index 021a97a2..a545afe8 100644 --- a/pyrogram/methods/messages/send_venue.py +++ b/pyrogram/methods/messages/send_venue.py @@ -118,7 +118,7 @@ async def send_venue( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. diff --git a/pyrogram/methods/messages/send_video.py b/pyrogram/methods/messages/send_video.py index 98736665..be46a311 100644 --- a/pyrogram/methods/messages/send_video.py +++ b/pyrogram/methods/messages/send_video.py @@ -164,7 +164,7 @@ async def send_video( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only. diff --git a/pyrogram/methods/messages/send_video_note.py b/pyrogram/methods/messages/send_video_note.py index b2974ce8..bf41c36d 100644 --- a/pyrogram/methods/messages/send_video_note.py +++ b/pyrogram/methods/messages/send_video_note.py @@ -34,6 +34,7 @@ async def send_video_note( schedule_date: datetime | None = None, protect_content: bool | None = None, allow_paid_broadcast: bool | None = None, + allow_paid_stars: int | None = None, ttl_seconds: int | None = None, message_effect_id: int | None = None, reply_markup: types.InlineKeyboardMarkup @@ -120,6 +121,9 @@ async def send_video_note( Protects the contents of the sent message from forwarding and saving. allow_paid_broadcast (``bool``, *optional*): + + allow_paid_stars (``int``, *optional*): + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only ttl_seconds (``int``, *optional*): @@ -244,6 +248,7 @@ async def send_video_note( schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, allow_paid_floodskip=allow_paid_broadcast, + allow_paid_stars=allow_paid_stars, effect=message_effect_id, reply_markup=await reply_markup.write(self) if reply_markup @@ -262,7 +267,7 @@ async def send_video_note( except FilePartMissing as e: await self.save_file( video_note, - file_id=file.id, + file_id=getattr(file, "id", None), file_part=e.value, ) else: diff --git a/pyrogram/methods/messages/send_voice.py b/pyrogram/methods/messages/send_voice.py index d6662ad9..ec8d9e73 100644 --- a/pyrogram/methods/messages/send_voice.py +++ b/pyrogram/methods/messages/send_voice.py @@ -35,6 +35,7 @@ async def send_voice( schedule_date: datetime | None = None, protect_content: bool | None = None, allow_paid_broadcast: bool | None = None, + allow_paid_stars: int | None = None, message_effect_id: int | None = None, reply_markup: types.InlineKeyboardMarkup | None @@ -119,6 +120,9 @@ async def send_voice( Protects the contents of the sent message from forwarding and saving. allow_paid_broadcast (``bool``, *optional*): + + allow_paid_stars (``int``, *optional*): + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. 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*): @@ -227,6 +231,7 @@ async def send_voice( schedule_date=utils.datetime_to_timestamp(schedule_date), noforwards=protect_content, allow_paid_floodskip=allow_paid_broadcast, + allow_paid_stars=allow_paid_stars, effect=message_effect_id, reply_markup=await reply_markup.write(self) if reply_markup @@ -248,7 +253,7 @@ async def send_voice( else: r = await self.invoke(rpc) except FilePartMissing as e: - await self.save_file(voice, file_id=file.id, file_part=e.value) + await self.save_file(voice, file_id=getattr(file, "id", None), file_part=e.value) else: for i in r.updates: if isinstance( diff --git a/pyrogram/methods/messages/send_web_page.py b/pyrogram/methods/messages/send_web_page.py index 21ae73e1..8735a998 100644 --- a/pyrogram/methods/messages/send_web_page.py +++ b/pyrogram/methods/messages/send_web_page.py @@ -30,6 +30,7 @@ async def send_web_page( schedule_date: datetime | None = None, protect_content: bool | None = None, allow_paid_broadcast: bool | None = None, + allow_paid_stars: int | None = None, message_effect_id: int | None = None, reply_markup: types.InlineKeyboardMarkup | None @@ -105,6 +106,9 @@ async def send_web_page( Protects the contents of the sent message from forwarding and saving. allow_paid_broadcast (``bool``, *optional*): + + allow_paid_stars (``int``, *optional*): + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots message_effect_id (``int`` ``64-bit``, *optional*): @@ -158,6 +162,7 @@ async def send_web_page( entities=entities, noforwards=protect_content, allow_paid_floodskip=allow_paid_broadcast, + allow_paid_stars=allow_paid_stars, effect=message_effect_id, ) if business_connection_id is not None: diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index 4ed1a84f..4a5996cc 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -4931,7 +4931,7 @@ async def forward( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. drop_author (``bool``, *optional*): Forwards messages without quoting the original author @@ -5099,7 +5099,7 @@ async def copy( Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots allow_paid_stars (``int``, *optional*): - Amount of stars to pay for the message; for bots only. + For paid messages, specifies the amount of Telegram Stars the user has agreed to pay in order to send the message. message_effect_id (``int`` ``64-bit``, *optional*): Unique identifier of the message effect to be added to the message; for private chats only.