Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyrogram/methods/bots/send_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions pyrogram/methods/business/send_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
):
Expand Down Expand Up @@ -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*):
Expand Down Expand Up @@ -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="",
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/copy_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/forward_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions pyrogram/methods/messages/send_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Comment on lines +144 to 146

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The docstring section for allow_paid_broadcast and allow_paid_stars is now ambiguous and misaligned with the parameter headings.

The allow_paid_stars block is currently inserted between the allow_paid_broadcast heading and its description (Pass True to allow the message to ignore regular broadcast limits...), making that description appear to apply to allow_paid_stars and leaving allow_paid_broadcast without a clear explanation. Please reorder so each parameter’s heading and description are contiguous (e.g., keep the full allow_paid_broadcast section together, then add allow_paid_stars), and apply the same fix to the other modified methods for consistency.


reply_markup (:obj:`~pyrogram.types.InlineKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardMarkup` | :obj:`~pyrogram.types.ReplyKeyboardRemove` | :obj:`~pyrogram.types.ForceReply`, *optional*):
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_cached_media.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions pyrogram/methods/messages/send_dice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*):
Expand Down Expand Up @@ -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="",
Expand Down
7 changes: 6 additions & 1 deletion pyrogram/methods/messages/send_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*):
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_media_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_poll.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion pyrogram/methods/messages/send_sticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*):
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_venue.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pyrogram/methods/messages/send_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion pyrogram/methods/messages/send_video_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*):
Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion pyrogram/methods/messages/send_voice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*):
Expand Down Expand Up @@ -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
Expand All @@ -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(
Expand Down
5 changes: 5 additions & 0 deletions pyrogram/methods/messages/send_web_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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*):
Expand Down Expand Up @@ -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:
Expand Down
Loading