Source code for hydrogram.raw.functions.contacts.block_from_replies
# Hydrogram - Telegram MTProto API Client Library for Python# Copyright (C) 2023-present Hydrogram <https://hydrogram.org>## This file is part of Hydrogram.## Hydrogram 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.## Hydrogram 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 Hydrogram. If not, see <http://www.gnu.org/licenses/>.fromioimportBytesIOfromhydrogram.raw.core.primitivesimportInt,Long,Int128,Int256,Bool,Bytes,String,Double,Vectorfromhydrogram.raw.coreimportTLObjectfromhydrogramimportrawfromtypingimportList,Optional,Any# # # # # # # # # # # # # # # # # # # # # # # ## !!! WARNING !!! ## This is a generated file! ## All changes made in this file will be lost! ## # # # # # # # # # # # # # # # # # # # # # # #
[docs]classBlockFromReplies(TLObject):# type: ignore"""Stop getting notifications about discussion replies of a certain user in @replies Details: - Layer: ``181`` - ID: ``29A8962C`` Parameters: msg_id (``int`` ``32-bit``): ID of the message in the @replies chat delete_message (``bool``, *optional*): Whether to delete the specified message as well delete_history (``bool``, *optional*): Whether to delete all @replies messages from this user as well report_spam (``bool``, *optional*): Whether to also report this user for spam Returns: :obj:`Updates <hydrogram.raw.base.Updates>` """__slots__:List[str]=["msg_id","delete_message","delete_history","report_spam"]ID=0x29a8962cQUALNAME="functions.contacts.BlockFromReplies"def__init__(self,*,msg_id:int,delete_message:Optional[bool]=None,delete_history:Optional[bool]=None,report_spam:Optional[bool]=None)->None:self.msg_id=msg_id# intself.delete_message=delete_message# flags.0?trueself.delete_history=delete_history# flags.1?trueself.report_spam=report_spam# flags.2?true@staticmethoddefread(b:BytesIO,*args:Any)->"BlockFromReplies":flags=Int.read(b)delete_message=Trueifflags&(1<<0)elseFalsedelete_history=Trueifflags&(1<<1)elseFalsereport_spam=Trueifflags&(1<<2)elseFalsemsg_id=Int.read(b)returnBlockFromReplies(msg_id=msg_id,delete_message=delete_message,delete_history=delete_history,report_spam=report_spam)defwrite(self,*args)->bytes:b=BytesIO()b.write(Int(self.ID,False))flags=0flags|=(1<<0)ifself.delete_messageelse0flags|=(1<<1)ifself.delete_historyelse0flags|=(1<<2)ifself.report_spamelse0b.write(Int(flags))b.write(Int(self.msg_id))returnb.getvalue()