diff --git a/pyrogram/methods/bots/send_game.py b/pyrogram/methods/bots/send_game.py index 8af2bb0e..ba3d2f36 100644 --- a/pyrogram/methods/bots/send_game.py +++ b/pyrogram/methods/bots/send_game.py @@ -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: diff --git a/pyrogram/methods/messages/send_animation.py b/pyrogram/methods/messages/send_animation.py index 48f0e144..e70fb19a 100644 --- a/pyrogram/methods/messages/send_animation.py +++ b/pyrogram/methods/messages/send_animation.py @@ -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) ) diff --git a/pyrogram/methods/messages/send_audio.py b/pyrogram/methods/messages/send_audio.py index e936248a..200f9271 100644 --- a/pyrogram/methods/messages/send_audio.py +++ b/pyrogram/methods/messages/send_audio.py @@ -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) ) diff --git a/pyrogram/methods/messages/send_contact.py b/pyrogram/methods/messages/send_contact.py index fce5af70..5cf6fbd3 100644 --- a/pyrogram/methods/messages/send_contact.py +++ b/pyrogram/methods/messages/send_contact.py @@ -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( diff --git a/pyrogram/methods/messages/send_dice.py b/pyrogram/methods/messages/send_dice.py index 69bd6094..c1cd0acf 100644 --- a/pyrogram/methods/messages/send_dice.py +++ b/pyrogram/methods/messages/send_dice.py @@ -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: diff --git a/pyrogram/methods/messages/send_document.py b/pyrogram/methods/messages/send_document.py index 2dbb2b8a..05301b3c 100644 --- a/pyrogram/methods/messages/send_document.py +++ b/pyrogram/methods/messages/send_document.py @@ -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) ) diff --git a/pyrogram/methods/messages/send_location.py b/pyrogram/methods/messages/send_location.py index 54847100..97704e83 100644 --- a/pyrogram/methods/messages/send_location.py +++ b/pyrogram/methods/messages/send_location.py @@ -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( diff --git a/pyrogram/methods/messages/send_media_group.py b/pyrogram/methods/messages/send_media_group.py index c75c2375..83927d4a 100644 --- a/pyrogram/methods/messages/send_media_group.py +++ b/pyrogram/methods/messages/send_media_group.py @@ -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: diff --git a/pyrogram/methods/messages/send_message.py b/pyrogram/methods/messages/send_message.py index 2760e439..54dfd348 100644 --- a/pyrogram/methods/messages/send_message.py +++ b/pyrogram/methods/messages/send_message.py @@ -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( diff --git a/pyrogram/methods/messages/send_photo.py b/pyrogram/methods/messages/send_photo.py index 1394f313..cb9f477b 100644 --- a/pyrogram/methods/messages/send_photo.py +++ b/pyrogram/methods/messages/send_photo.py @@ -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) ) diff --git a/pyrogram/methods/messages/send_poll.py b/pyrogram/methods/messages/send_poll.py index cb94fe59..848696ea 100644 --- a/pyrogram/methods/messages/send_poll.py +++ b/pyrogram/methods/messages/send_poll.py @@ -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( diff --git a/pyrogram/methods/messages/send_sticker.py b/pyrogram/methods/messages/send_sticker.py index 10e39cc3..aa2bb0f7 100644 --- a/pyrogram/methods/messages/send_sticker.py +++ b/pyrogram/methods/messages/send_sticker.py @@ -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="" ) diff --git a/pyrogram/methods/messages/send_venue.py b/pyrogram/methods/messages/send_venue.py index 57db75e9..8ccd96e9 100644 --- a/pyrogram/methods/messages/send_venue.py +++ b/pyrogram/methods/messages/send_venue.py @@ -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( diff --git a/pyrogram/methods/messages/send_video.py b/pyrogram/methods/messages/send_video.py index c599c21f..f6b6319e 100644 --- a/pyrogram/methods/messages/send_video.py +++ b/pyrogram/methods/messages/send_video.py @@ -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) ) diff --git a/pyrogram/methods/messages/send_video_note.py b/pyrogram/methods/messages/send_video_note.py index 2de9348d..9c9f3fa4 100644 --- a/pyrogram/methods/messages/send_video_note.py +++ b/pyrogram/methods/messages/send_video_note.py @@ -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="" ) diff --git a/pyrogram/methods/messages/send_voice.py b/pyrogram/methods/messages/send_voice.py index 6c66a0b4..e3393f34 100644 --- a/pyrogram/methods/messages/send_voice.py +++ b/pyrogram/methods/messages/send_voice.py @@ -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) ) diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index fa714d2c..e528acf4 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -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 )