mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 13:27:47 +00:00
Allow passing msg ids as int in forward_messages()
This commit is contained in:
parent
3d9b1cd4b0
commit
a2640775dc
@ -1122,7 +1122,7 @@ class Client:
|
|||||||
def forward_messages(self,
|
def forward_messages(self,
|
||||||
chat_id: int or str,
|
chat_id: int or str,
|
||||||
from_chat_id: int or str,
|
from_chat_id: int or str,
|
||||||
message_ids: list,
|
message_ids: list or int,
|
||||||
disable_notification: bool = None):
|
disable_notification: bool = None):
|
||||||
"""Use this method to forward messages of any kind.
|
"""Use this method to forward messages of any kind.
|
||||||
|
|
||||||
@ -1139,8 +1139,8 @@ class Client:
|
|||||||
For a contact that exists in your Telegram address book you can use his phone number (str).
|
For a contact that exists in your Telegram address book you can use his phone number (str).
|
||||||
For a private channel/supergroup you can use its *t.me/joinchat/* link.
|
For a private channel/supergroup you can use its *t.me/joinchat/* link.
|
||||||
|
|
||||||
message_ids (``list``):
|
message_ids (``list`` | ``int``):
|
||||||
A list of Message identifiers in the chat specified in *from_chat_id*.
|
A list of Message identifiers in the chat specified in *from_chat_id* or a single message id.
|
||||||
|
|
||||||
disable_notification (``bool``, optional):
|
disable_notification (``bool``, optional):
|
||||||
Sends the message silently.
|
Sends the message silently.
|
||||||
@ -1152,6 +1152,12 @@ class Client:
|
|||||||
Raises:
|
Raises:
|
||||||
:class:`Error <pyrogram.Error>`
|
:class:`Error <pyrogram.Error>`
|
||||||
"""
|
"""
|
||||||
|
message_ids = (
|
||||||
|
message_ids
|
||||||
|
if isinstance(message_ids, list)
|
||||||
|
else [message_ids]
|
||||||
|
)
|
||||||
|
|
||||||
return self.send(
|
return self.send(
|
||||||
functions.messages.ForwardMessages(
|
functions.messages.ForwardMessages(
|
||||||
to_peer=self.resolve_peer(chat_id),
|
to_peer=self.resolve_peer(chat_id),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user