-
Notifications
You must be signed in to change notification settings - Fork 6
Beta #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beta #123
Changes from all commits
e352577
a846629
20ee7e6
f253d2c
f730a93
a579471
01bd63e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,9 +26,18 @@ async def send_cached_media( | |
| quote_text: str | None = None, | ||
| quote_entities: list[types.MessageEntity] | None = None, | ||
| schedule_date: datetime | None = None, | ||
| schedule_repeat_period: int | None = None, | ||
| protect_content: bool | None = None, | ||
| allow_paid_broadcast: bool | None = None, | ||
| invert_media: bool = False, | ||
| allow_paid_stars: int | None = None, | ||
| message_effect_id: int | None = None, | ||
| invert_media: bool | None = None, | ||
| quick_reply_shortcut: str | int | None = None, | ||
| send_as: int | str | None = None, | ||
| background: bool | None = None, | ||
| clear_draft: bool | None = None, | ||
| update_stickersets_order: bool | None = None, | ||
| suggested_post: types.SuggestedPost | None = None, | ||
| reply_markup: types.InlineKeyboardMarkup | ||
| | None | ||
| | types.ReplyKeyboardMarkup | ||
|
|
@@ -97,15 +106,42 @@ async def send_cached_media( | |
| schedule_date (:py:obj:`~datetime.datetime`, *optional*): | ||
| Date when the message will be automatically sent. | ||
|
|
||
| schedule_repeat_period (``int``, *optional*): | ||
| Repeat period of the scheduled message. | ||
|
|
||
| protect_content (``bool``, *optional*): | ||
| Protects the contents of the sent message from forwarding and saving. | ||
|
|
||
| allow_paid_broadcast (``bool``, *optional*): | ||
| 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. | ||
|
|
||
| message_effect_id (``int`` ``64-bit``, *optional*): | ||
| Unique identifier of the message effect to be added to the message; for private chats only. | ||
|
|
||
| invert_media (``bool``, *optional*): | ||
| Inverts the position of the media and caption. | ||
|
|
||
| quick_reply_shortcut (``str`` | ``int``, *optional*): | ||
| Quick reply shortcut identifier or name. | ||
|
|
||
| send_as (``int`` | ``str``, *optional*): | ||
| Unique identifier (int) or username (str) of the chat to send the message as. | ||
|
|
||
| background (``bool``, *optional*): | ||
| Pass True to send the message in the background. | ||
|
|
||
| clear_draft (``bool``, *optional*): | ||
| Pass True to clear the draft. | ||
|
|
||
| update_stickersets_order (``bool``, *optional*): | ||
| Pass True to update the stickersets order. | ||
|
|
||
| suggested_post (:obj:`~pyrogram.types.SuggestedPost`, *optional*): | ||
| Suggested post information. | ||
|
|
||
| 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. | ||
|
|
@@ -134,9 +170,6 @@ async def send_cached_media( | |
| media = utils.get_input_media_from_file_id(file_id) | ||
| media.spoiler = has_spoiler | ||
|
|
||
| media = utils.get_input_media_from_file_id(file_id) | ||
| media.spoiler = has_spoiler | ||
|
|
||
| r = await self.invoke( | ||
| raw.functions.messages.SendMedia( | ||
| peer=utils.get_input_peer(await self.resolve_peer(chat_id)), | ||
|
|
@@ -148,6 +181,23 @@ async def send_cached_media( | |
| noforwards=protect_content, | ||
| allow_paid_floodskip=allow_paid_broadcast, | ||
| invert_media=invert_media, | ||
| effect=message_effect_id, | ||
| background=background, | ||
| clear_draft=clear_draft, | ||
| update_stickersets_order=update_stickersets_order, | ||
| schedule_repeat_period=schedule_repeat_period, | ||
| send_as=utils.get_input_peer(await self.resolve_peer(send_as)) | ||
| if send_as | ||
| else None, | ||
| quick_reply_shortcut=await utils.get_input_quick_reply_shortcut( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Using truthiness to gate Because quick_reply_shortcut = await utils.get_input_quick_reply_shortcut(quick_reply_shortcut)
if quick_reply_shortcut is not None
else None,Please also update other call sites that rely on |
||
| quick_reply_shortcut, | ||
| ) | ||
| if quick_reply_shortcut | ||
| else None, | ||
| allow_paid_stars=allow_paid_stars, | ||
| suggested_post=await suggested_post.write() | ||
| if suggested_post | ||
| else None, | ||
| reply_markup=await reply_markup.write(self) | ||
| if reply_markup | ||
| else None, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5366,6 +5366,7 @@ async def copy( | |
| message_thread_id=message_thread_id, | ||
| allow_paid_broadcast=allow_paid_broadcast, | ||
| allow_paid_stars=allow_paid_stars, | ||
| message_effect_id=message_effect_id, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line introduces a |
||
| quick_reply_shortcut=quick_reply_shortcut, | ||
| send_as=send_as, | ||
| background=background, | ||
|
|
@@ -5386,6 +5387,7 @@ async def copy( | |
| message_thread_id=message_thread_id, | ||
| allow_paid_broadcast=allow_paid_broadcast, | ||
| allow_paid_stars=allow_paid_stars, | ||
| message_effect_id=message_effect_id, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| quick_reply_shortcut=quick_reply_shortcut, | ||
| send_as=send_as, | ||
| background=background, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This updated “Github repo” link still uses
http://for GitHub, which can cause unnecessary redirects and (in some contexts) mixed-content warnings. Consider switching it tohttps://for consistency with the other updated links.Severity: low
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.