diff --git a/pyrogram/methods/messages/forward_messages.py b/pyrogram/methods/messages/forward_messages.py index 8635e171..548dcdda 100644 --- a/pyrogram/methods/messages/forward_messages.py +++ b/pyrogram/methods/messages/forward_messages.py @@ -30,6 +30,7 @@ class ForwardMessages: chat_id: Union[int, str], from_chat_id: Union[int, str], message_ids: Union[int, Iterable[int]], + message_thread_id: int = None, disable_notification: bool = None, schedule_date: datetime = None, protect_content: bool = None @@ -52,6 +53,10 @@ class ForwardMessages: message_ids (``int`` | Iterable of ``int``): An iterable of message identifiers in the chat specified in *from_chat_id* or a single message id. + message_thread_id (``int``, *optional*): + Unique identifier of a message thread to which the message belongs. + for supergroups only + disable_notification (``bool``, *optional*): Sends the message silently. Users will receive a notification with no sound. @@ -84,6 +89,7 @@ class ForwardMessages: to_peer=await self.resolve_peer(chat_id), from_peer=await self.resolve_peer(from_chat_id), id=message_ids, + top_msg_id=message_thread_id, silent=disable_notification or None, random_id=[self.rnd_id() for _ in message_ids], schedule_date=utils.datetime_to_timestamp(schedule_date), diff --git a/pyrogram/types/messages_and_media/message.py b/pyrogram/types/messages_and_media/message.py index 8669798b..1f6a6fbc 100644 --- a/pyrogram/types/messages_and_media/message.py +++ b/pyrogram/types/messages_and_media/message.py @@ -64,7 +64,8 @@ class Message(Object, Update): Unique message identifier inside this chat. message_thread_id (``int``, *optional*): - Unique identifier of a message thread to which the message belongs; for supergroups only + Unique identifier of a message thread to which the message belongs. + for supergroups only from_user (:obj:`~pyrogram.types.User`, *optional*): Sender, empty for messages sent to channels. @@ -2994,6 +2995,7 @@ class Message(Object, Update): async def forward( self, chat_id: Union[int, str], + message_thread_id: int = None, disable_notification: bool = None, schedule_date: datetime = None ) -> Union["types.Message", List["types.Message"]]: @@ -3020,6 +3022,9 @@ class Message(Object, Update): For your personal cloud (Saved Messages) you can simply use "me" or "self". For a contact that exists in your Telegram address book you can use his phone number (str). + message_thread_id (``int``, *optional*): + Unique identifier of a message thread to which the message belongs; for supergroups only + disable_notification (``bool``, *optional*): Sends the message silently. Users will receive a notification with no sound. @@ -3037,6 +3042,7 @@ class Message(Object, Update): chat_id=chat_id, from_chat_id=self.chat.id, message_ids=self.id, + message_thread_id=message_thread_id, disable_notification=disable_notification, schedule_date=schedule_date )