From 15fce7bee94cccb4a92345e2a41a9def7f6ae356 Mon Sep 17 00:00:00 2001 From: 5hojib <107526130+5hojib@users.noreply.github.com> Date: Wed, 8 Jul 2026 17:39:15 +0000 Subject: [PATCH 1/2] Update methods for MTProto API schema layer 227 - Add `allow_paid_stars` parameter to message-sending methods based on new API schema - Formatted updated files - Checked for type issues --- pyrogram/methods/business/send_invoice.py | 5 +++++ pyrogram/methods/messages/send_audio.py | 5 +++++ pyrogram/methods/messages/send_dice.py | 5 +++++ pyrogram/methods/messages/send_document.py | 5 +++++ pyrogram/methods/messages/send_sticker.py | 5 +++++ pyrogram/methods/messages/send_video_note.py | 5 +++++ pyrogram/methods/messages/send_voice.py | 5 +++++ pyrogram/methods/messages/send_web_page.py | 5 +++++ 8 files changed, 40 insertions(+) diff --git a/pyrogram/methods/business/send_invoice.py b/pyrogram/methods/business/send_invoice.py index 502d12e0..d7c65a41 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*): + Pass the amount of stars to pay for the message; for bots only 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/send_audio.py b/pyrogram/methods/messages/send_audio.py index 9403d75d..a69c6192 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*): + Pass the amount of stars to pay for the message; for bots only 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_dice.py b/pyrogram/methods/messages/send_dice.py index 1eede1a5..8d542718 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*): + Pass the amount of stars to pay for the message; for bots only 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..fc7771bc 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*): + Pass the amount of stars to pay for the message; for bots only 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 diff --git a/pyrogram/methods/messages/send_sticker.py b/pyrogram/methods/messages/send_sticker.py index 8ceec5a5..d81e6629 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*): + Pass the amount of stars to pay for the message; for bots only 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 diff --git a/pyrogram/methods/messages/send_video_note.py b/pyrogram/methods/messages/send_video_note.py index b2974ce8..de840d82 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*): + Pass the amount of stars to pay for the message; for bots only 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 diff --git a/pyrogram/methods/messages/send_voice.py b/pyrogram/methods/messages/send_voice.py index d6662ad9..2267b127 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*): + Pass the amount of stars to pay for the message; for bots only 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 diff --git a/pyrogram/methods/messages/send_web_page.py b/pyrogram/methods/messages/send_web_page.py index 21ae73e1..7c48a792 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*): + Pass the amount of stars to pay for the message; for bots only 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: From 472ba0ade538dc92b242cdb738d2cb77f2d04828 Mon Sep 17 00:00:00 2001 From: 5hojib <107526130+5hojib@users.noreply.github.com> Date: Wed, 8 Jul 2026 18:00:39 +0000 Subject: [PATCH 2/2] Update MTProto API layer, methods and types with allow_paid_stars - Update docstrings for `allow_paid_stars` - Add `allow_paid_stars` to multiple message sending methods - Fix `file.id` attribute check in send methods - Formatted with ruff --- pyrogram/methods/bots/send_game.py | 2 +- pyrogram/methods/business/send_invoice.py | 2 +- pyrogram/methods/messages/copy_message.py | 2 +- pyrogram/methods/messages/forward_messages.py | 2 +- pyrogram/methods/messages/send_animation.py | 2 +- pyrogram/methods/messages/send_audio.py | 2 +- pyrogram/methods/messages/send_cached_media.py | 2 +- pyrogram/methods/messages/send_contact.py | 2 +- pyrogram/methods/messages/send_dice.py | 2 +- pyrogram/methods/messages/send_document.py | 4 ++-- pyrogram/methods/messages/send_location.py | 2 +- pyrogram/methods/messages/send_media_group.py | 2 +- pyrogram/methods/messages/send_message.py | 2 +- pyrogram/methods/messages/send_photo.py | 2 +- pyrogram/methods/messages/send_poll.py | 2 +- pyrogram/methods/messages/send_sticker.py | 4 ++-- pyrogram/methods/messages/send_venue.py | 2 +- pyrogram/methods/messages/send_video.py | 2 +- pyrogram/methods/messages/send_video_note.py | 4 ++-- pyrogram/methods/messages/send_voice.py | 4 ++-- pyrogram/methods/messages/send_web_page.py | 2 +- pyrogram/types/messages_and_media/message.py | 4 ++-- 22 files changed, 27 insertions(+), 27 deletions(-) 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 d7c65a41..08240080 100644 --- a/pyrogram/methods/business/send_invoice.py +++ b/pyrogram/methods/business/send_invoice.py @@ -93,7 +93,7 @@ async def send_invoice( allow_paid_broadcast (``bool``, *optional*): allow_paid_stars (``int``, *optional*): - Pass the 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. 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*): 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 a69c6192..de1d660e 100644 --- a/pyrogram/methods/messages/send_audio.py +++ b/pyrogram/methods/messages/send_audio.py @@ -142,7 +142,7 @@ async def send_audio( allow_paid_broadcast (``bool``, *optional*): allow_paid_stars (``int``, *optional*): - Pass the 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. 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*): 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 8d542718..e9a8cb8d 100644 --- a/pyrogram/methods/messages/send_dice.py +++ b/pyrogram/methods/messages/send_dice.py @@ -97,7 +97,7 @@ async def send_dice( allow_paid_broadcast (``bool``, *optional*): allow_paid_stars (``int``, *optional*): - Pass the 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. 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*): diff --git a/pyrogram/methods/messages/send_document.py b/pyrogram/methods/messages/send_document.py index fc7771bc..ca1be87d 100644 --- a/pyrogram/methods/messages/send_document.py +++ b/pyrogram/methods/messages/send_document.py @@ -134,7 +134,7 @@ async def send_document( allow_paid_broadcast (``bool``, *optional*): allow_paid_stars (``int``, *optional*): - Pass the 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. 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*): @@ -278,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 d81e6629..d383537f 100644 --- a/pyrogram/methods/messages/send_sticker.py +++ b/pyrogram/methods/messages/send_sticker.py @@ -110,7 +110,7 @@ async def send_sticker( allow_paid_broadcast (``bool``, *optional*): allow_paid_stars (``int``, *optional*): - Pass the 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. 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*): @@ -240,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 de840d82..bf41c36d 100644 --- a/pyrogram/methods/messages/send_video_note.py +++ b/pyrogram/methods/messages/send_video_note.py @@ -123,7 +123,7 @@ async def send_video_note( allow_paid_broadcast (``bool``, *optional*): allow_paid_stars (``int``, *optional*): - Pass the 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. Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots only ttl_seconds (``int``, *optional*): @@ -267,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 2267b127..ec8d9e73 100644 --- a/pyrogram/methods/messages/send_voice.py +++ b/pyrogram/methods/messages/send_voice.py @@ -122,7 +122,7 @@ async def send_voice( allow_paid_broadcast (``bool``, *optional*): allow_paid_stars (``int``, *optional*): - Pass the 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. 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*): @@ -253,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 7c48a792..8735a998 100644 --- a/pyrogram/methods/messages/send_web_page.py +++ b/pyrogram/methods/messages/send_web_page.py @@ -108,7 +108,7 @@ async def send_web_page( allow_paid_broadcast (``bool``, *optional*): allow_paid_stars (``int``, *optional*): - Pass the 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. Pass True to allow the message to ignore regular broadcast limits for a small fee; for bots message_effect_id (``int`` ``64-bit``, *optional*): 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.