From 02733d90f2fa4e9499a3c615d7b7a2dba53bf3d5 Mon Sep 17 00:00:00 2001 From: kvrvgv Date: Mon, 13 Mar 2023 06:20:45 +0300 Subject: [PATCH] PyroFork: add drop_author parameter to forward_messages method Signed-off-by: wulan17 --- pyrogram/methods/messages/forward_messages.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pyrogram/methods/messages/forward_messages.py b/pyrogram/methods/messages/forward_messages.py index 8635e171..d54563a6 100644 --- a/pyrogram/methods/messages/forward_messages.py +++ b/pyrogram/methods/messages/forward_messages.py @@ -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 +# Copyright (C) 2022-present 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 . +# along with Pyrofork. If not, see . 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 ) )