|
| 1 | +# Pyrogram - Telegram MTProto API Client Library for Python |
| 2 | +# Copyright (C) 2017-present Dan <https://github.com/delivrance> |
| 3 | +# |
| 4 | +# This file is part of Pyrogram. |
| 5 | +# |
| 6 | +# Pyrogram is free software: you can redistribute it and/or modify |
| 7 | +# it under the terms of the GNU Lesser General Public License as published |
| 8 | +# by the Free Software Foundation, either version 3 of the License, or |
| 9 | +# (at your option) any later version. |
| 10 | +# |
| 11 | +# Pyrogram is distributed in the hope that it will be useful, |
| 12 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +# GNU Lesser General Public License for more details. |
| 15 | +# |
| 16 | +# You should have received a copy of the GNU Lesser General Public License |
| 17 | +# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + |
| 19 | +from typing import Union |
| 20 | + |
| 21 | +import pyrogram |
| 22 | +from pyrogram import raw |
| 23 | + |
| 24 | + |
| 25 | +class DeleteChatReactionsBySender: |
| 26 | + async def delete_chat_reactions_by_sender( |
| 27 | + self: "pyrogram.Client", |
| 28 | + chat_id: Union[int, str], |
| 29 | + sender_id: Union[int, str], |
| 30 | + ) -> bool: |
| 31 | + """Delete all reactions sent by a certain user in a chat. |
| 32 | +
|
| 33 | + .. include:: /_includes/usable-by/users.rst |
| 34 | +
|
| 35 | + Parameters: |
| 36 | + chat_id (``int`` | ``str``): |
| 37 | + Unique identifier (int) or username (str) of the target chat. |
| 38 | +
|
| 39 | + sender_id (``int`` | ``str``): |
| 40 | + Unique identifier (int) or username (str) of the user whose reactions will be deleted. |
| 41 | +
|
| 42 | + Returns: |
| 43 | + ``bool``: True on success, False otherwise. |
| 44 | + """ |
| 45 | + |
| 46 | + return await self.invoke( |
| 47 | + raw.functions.messages.DeleteParticipantReactions( |
| 48 | + peer=await self.resolve_peer(chat_id), |
| 49 | + participant=await self.resolve_peer(sender_id), |
| 50 | + ) |
| 51 | + ) |
0 commit comments