mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
PyroFork: add drop_author parameter to forward_messages method
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
02acefd6e2
commit
02733d90f2
1 changed files with 13 additions and 7 deletions
|
|
@ -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
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue