mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Pyrogram: Add message_thread_id parameter to forward_message() method and forward() bound method
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
9b92492553
commit
f22cc34c9a
2 changed files with 13 additions and 1 deletions
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue