pyrofork: Add message_effect_id to send* methods

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
shriMADhav U k 2024-05-29 09:57:13 +02:00 committed by wulan17
parent 45a7764153
commit f684ce9563
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5
17 changed files with 91 additions and 6 deletions

View file

@ -34,6 +34,7 @@ class SendGame:
business_connection_id: str = None,
reply_to_message_id: int = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -73,6 +74,9 @@ class SendGame:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -105,6 +109,7 @@ class SendGame:
reply_to=reply_to,
random_id=self.rnd_id(),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None
)
if business_connection_id is not None:

View file

@ -56,6 +56,7 @@ class SendAnimation:
quote_entities: List["types.MessageEntity"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -150,6 +151,9 @@ class SendAnimation:
List of special entities that appear in quote_text, which can be specified instead of *parse_mode*.
for reply_to_message only.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats only.
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
Date when the message will be automatically sent.
@ -278,6 +282,7 @@ class SendAnimation:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None,
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
)

View file

@ -52,6 +52,7 @@ class SendAudio:
reply_to_chat_id: Union[int, str] = None,
quote_text: str = None,
quote_entities: List["types.MessageEntity"] = None,
message_effect_id: int = None,
schedule_date: datetime = None,
protect_content: bool = None,
reply_markup: Union[
@ -143,6 +144,9 @@ class SendAudio:
List of special entities that appear in quote_text, which can be specified instead of *parse_mode*.
for reply_to_message only.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats only.
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
Date when the message will be automatically sent.
@ -264,6 +268,7 @@ class SendAudio:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None,
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
)

View file

@ -43,6 +43,7 @@ class SendContact:
parse_mode: Optional["enums.ParseMode"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -112,6 +113,9 @@ class SendContact:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -150,7 +154,8 @@ class SendContact:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
reply_markup=await reply_markup.write(self) if reply_markup else None
reply_markup=await reply_markup.write(self) if reply_markup else None,
effect=message_effect_id
)
if business_connection_id is not None:
r = await self.invoke(

View file

@ -41,6 +41,7 @@ class SendDice:
parse_mode: Optional["enums.ParseMode"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -108,6 +109,9 @@ class SendDice:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -149,6 +153,7 @@ class SendDice:
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
reply_markup=await reply_markup.write(self) if reply_markup else None,
effect=message_effect_id,
message=""
)
if business_connection_id is not None:

View file

@ -50,6 +50,7 @@ class SendDocument:
reply_to_chat_id: Union[int, str] = None,
quote_text: str = None,
quote_entities: List["types.MessageEntity"] = None,
message_effect_id: int = None,
schedule_date: datetime = None,
protect_content: bool = None,
reply_markup: Union[
@ -135,6 +136,9 @@ class SendDocument:
List of special entities that appear in quote_text, which can be specified instead of *parse_mode*.
for reply_to_message only.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats only.
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
Date when the message will be automatically sent.
@ -242,6 +246,7 @@ class SendDocument:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None,
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
)

View file

@ -41,6 +41,7 @@ class SendLocation:
parse_mode: Optional["enums.ParseMode"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -104,6 +105,9 @@ class SendLocation:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -142,7 +146,8 @@ class SendLocation:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
reply_markup=await reply_markup.write(self) if reply_markup else None
reply_markup=await reply_markup.write(self) if reply_markup else None,
effect=message_effect_id
)
if business_connection_id is not None:
r = await self.invoke(

View file

@ -57,6 +57,7 @@ class SendMediaGroup:
parse_mode: Optional["enums.ParseMode"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None
) -> List["types.Message"]:
"""Send a group of photos or videos as an album.
@ -114,6 +115,9 @@ class SendMediaGroup:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
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 the sent messages is returned.
@ -465,7 +469,8 @@ class SendMediaGroup:
silent=disable_notification or None,
reply_to=reply_to,
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content
noforwards=protect_content,
effect=message_effect_id
)
if business_connection_id is not None:

View file

@ -44,6 +44,7 @@ class SendMessage:
schedule_date: datetime = None,
protect_content: bool = None,
invert_media: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -115,6 +116,9 @@ class SendMessage:
invert_media (``bool``, *optional*):
Move web page preview to above 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.
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.
@ -182,7 +186,8 @@ class SendMessage:
message=message,
entities=entities,
noforwards=protect_content,
invert_media=invert_media
invert_media=invert_media,
effect=message_effect_id,
)
if business_connection_id is not None:
r = await self.invoke(

View file

@ -50,6 +50,7 @@ class SendPhoto:
quote_entities: List["types.MessageEntity"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -132,6 +133,9 @@ class SendPhoto:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -227,6 +231,7 @@ class SendPhoto:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None,
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
)

View file

@ -51,6 +51,7 @@ class SendPoll:
quote_entities: List["types.MessageEntity"] = None,
parse_mode: Optional["enums.ParseMode"] = None,
schedule_date: datetime = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -154,6 +155,9 @@ class SendPoll:
schedule_date (:py:obj:`~datetime.datetime`, *optional*):
Date when the message will be automatically sent.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -209,7 +213,8 @@ class SendPoll:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
reply_markup=await reply_markup.write(self) if reply_markup else None
reply_markup=await reply_markup.write(self) if reply_markup else None,
effect=message_effect_id
)
if business_connection_id is not None:
r = await self.invoke(

View file

@ -48,6 +48,7 @@ class SendSticker:
parse_mode: Optional["enums.ParseMode"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -117,6 +118,9 @@ class SendSticker:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -208,6 +212,7 @@ class SendSticker:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None,
message=""
)

View file

@ -45,6 +45,7 @@ class SendVenue:
parse_mode: Optional["enums.ParseMode"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -121,6 +122,9 @@ class SendVenue:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -166,7 +170,8 @@ class SendVenue:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
reply_markup=await reply_markup.write(self) if reply_markup else None
reply_markup=await reply_markup.write(self) if reply_markup else None,
effect=message_effect_id
)
if business_connection_id is not None:
r = await self.invoke(

View file

@ -57,6 +57,7 @@ class SendVideo:
quote_entities: List["types.MessageEntity"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -162,6 +163,9 @@ class SendVideo:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats 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.
@ -284,6 +288,7 @@ class SendVideo:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None,
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
)

View file

@ -51,6 +51,7 @@ class SendVideoNote:
schedule_date: datetime = None,
protect_content: bool = None,
ttl_seconds: int = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -108,6 +109,9 @@ class SendVideoNote:
reply_to_story_id (``int``, *optional*):
Unique identifier for the target story.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats only.
reply_to_chat_id (``int`` | ``str``, *optional*):
Unique identifier for the origin chat.
for reply to message from another chat.
@ -242,6 +246,7 @@ class SendVideoNote:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None,
message=""
)

View file

@ -50,6 +50,7 @@ class SendVoice:
quote_entities: List["types.MessageEntity"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
reply_markup: Union[
"types.InlineKeyboardMarkup",
"types.ReplyKeyboardMarkup",
@ -111,6 +112,9 @@ class SendVoice:
reply_to_story_id (``int``, *optional*):
Unique identifier for the target story.
message_effect_id (``int`` ``64-bit``, *optional*):
Unique identifier of the message effect to be added to the message; for private chats only.
reply_to_chat_id (``int`` | ``str``, *optional*):
Unique identifier for the origin chat.
for reply to message from another chat.
@ -229,6 +233,7 @@ class SendVoice:
random_id=self.rnd_id(),
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content,
effect=message_effect_id,
reply_markup=await reply_markup.write(self) if reply_markup else None,
**await utils.parse_text_entities(self, caption, parse_mode, caption_entities)
)

View file

@ -1253,6 +1253,7 @@ class Message(Object, Update):
quote_entities: List["types.MessageEntity"] = None,
schedule_date: datetime = None,
protect_content: bool = None,
message_effect_id: int = None,
invert_media: bool = None,
reply_markup=None
) -> "Message":
@ -1324,6 +1325,9 @@ class Message(Object, Update):
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
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*):
Move web page preview to above the message.
@ -1372,6 +1376,7 @@ class Message(Object, Update):
quote_entities=quote_entities,
schedule_date=schedule_date,
protect_content=protect_content,
message_effect_id=message_effect_id,
invert_media=invert_media,
reply_markup=reply_markup
)