PyroFork: add drop_author parameter to forward_messages method

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
kvrvgv 2023-03-13 06:20:45 +03:00 committed by wulan17
parent 02acefd6e2
commit 02733d90f2
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -1,20 +1,21 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Pyrofork - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
# Copyright (C) 2022-present Mayuri-Chan <https://github.com/Mayuri-Chan>
#
# This file is part of Pyrogram.
# This file is part of Pyrofork.
#
# Pyrogram is free software: you can redistribute it and/or modify
# Pyrofork is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# Pyrofork is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
# along with Pyrofork. If not, see <http://www.gnu.org/licenses/>.
from datetime import datetime
from typing import Union, List, Iterable
@ -32,7 +33,8 @@ class ForwardMessages:
message_ids: Union[int, Iterable[int]],
disable_notification: bool = None,
schedule_date: datetime = None,
protect_content: bool = None
protect_content: bool = None,
drop_author: bool = None
) -> Union["types.Message", List["types.Message"]]:
"""Forward messages of any kind.
@ -62,6 +64,9 @@ class ForwardMessages:
protect_content (``bool``, *optional*):
Protects the contents of the sent message from forwarding and saving.
drop_author (``bool``, *optional*):
Forwards messages without quoting the original author
Returns:
:obj:`~pyrogram.types.Message` | List of :obj:`~pyrogram.types.Message`: In case *message_ids* was not
a list, a single message is returned, otherwise a list of messages is returned.
@ -87,7 +92,8 @@ class ForwardMessages:
silent=disable_notification or None,
random_id=[self.rnd_id() for _ in message_ids],
schedule_date=utils.datetime_to_timestamp(schedule_date),
noforwards=protect_content
noforwards=protect_content,
drop_author=drop_author
)
)