@@ -150,6 +150,22 @@ class ChatEvent(Object):
150150 Affected chat member status of the user.
151151 For :obj:`~pyrogram.enums.ChatEventAction.MEMBER_SUBSCRIPTION_EXTENDED` action only.
152152
153+ show_message_sender_enabled (``bool``, *optional*):
154+ The show_message_sender setting of a channel was toggled.
155+ For :obj:`~pyrogram.enums.ChatEventAction.SHOW_MESSAGE_SENDER_ENABLED` action only.
156+
157+ has_aggressive_anti_spam_enabled (``bool``, *optional*):
158+ The ``has_aggressive_anti_spam_enabled`` setting of a supergroup was toggled.
159+ For :obj:`~pyrogram.enums.ChatEventAction.AGGRESSIVE_ANTI_SPAM_TOGGLED` action only.
160+
161+ has_protected_content (``bool``, *optional*):
162+ The ``has_protected_content`` setting of a channel was toggled.
163+ For :obj:`~pyrogram.enums.ChatEventAction.PROTECTED_CONTENT_TOGGLED` action only.
164+
165+ is_forum (``bool``, *optional*):
166+ The ``is_forum`` setting of a channel was toggled.
167+ For :obj:`~pyrogram.enums.ChatEventAction.CHAT_IS_FORUM_TOGGLED` action only.
168+
153169 """
154170
155171 def __init__ (
@@ -220,6 +236,11 @@ def __init__(
220236
221237 old_chat_member : "types.ChatMember" = None ,
222238 new_chat_member : "types.ChatMember" = None ,
239+
240+ show_message_sender_enabled : bool = None ,
241+ has_aggressive_anti_spam_enabled : bool = None ,
242+ has_protected_content : bool = None ,
243+ is_forum : bool = None ,
223244 ):
224245 super ().__init__ ()
225246
@@ -290,6 +311,11 @@ def __init__(
290311 self .old_chat_member = old_chat_member
291312 self .new_chat_member = new_chat_member
292313
314+ self .show_message_sender_enabled = show_message_sender_enabled
315+ self .has_aggressive_anti_spam_enabled = has_aggressive_anti_spam_enabled
316+ self .has_protected_content = has_protected_content
317+ self .is_forum = is_forum
318+
293319 @staticmethod
294320 async def _parse (
295321 client : "pyrogram.Client" ,
@@ -365,6 +391,11 @@ async def _parse(
365391 old_chat_member : Optional [types .ChatMember ] = None
366392 new_chat_member : Optional [types .ChatMember ] = None
367393
394+ show_message_sender_enabled : Optional [bool ] = None
395+ has_aggressive_anti_spam_enabled : Optional [bool ] = None
396+ has_protected_content : Optional [bool ] = None
397+ is_forum : Optional [bool ] = None
398+
368399 if isinstance (action , raw .types .ChannelAdminLogEventActionChangeAbout ):
369400 old_description = action .prev_value
370401 new_description = action .new_value
@@ -509,6 +540,22 @@ async def _parse(
509540 new_chat_member = types .ChatMember ._parse (client , action .new_participant , users , chats )
510541 action = enums .ChatEventAction .MEMBER_SUBSCRIPTION_EXTENDED
511542
543+ elif isinstance (action , raw .types .ChannelAdminLogEventActionToggleSignatureProfiles ):
544+ show_message_sender_enabled = action .new_value
545+ action = enums .ChatEventAction .SHOW_MESSAGE_SENDER_ENABLED
546+
547+ elif isinstance (action , raw .types .ChannelAdminLogEventActionToggleAntiSpam ):
548+ has_aggressive_anti_spam_enabled = action .new_value
549+ action = enums .ChatEventAction .AGGRESSIVE_ANTI_SPAM_TOGGLED
550+
551+ elif isinstance (action , raw .types .ChannelAdminLogEventActionToggleNoForwards ):
552+ has_protected_content = action .new_value
553+ action = enums .ChatEventAction .PROTECTED_CONTENT_TOGGLED
554+
555+ elif isinstance (action , raw .types .ChannelAdminLogEventActionToggleForum ):
556+ is_forum = action .new_value
557+ action = enums .ChatEventAction .CHAT_IS_FORUM_TOGGLED
558+
512559 else :
513560 action = f"{ enums .ChatEventAction .UNKNOWN } -{ action .QUALNAME } "
514561
@@ -579,4 +626,9 @@ async def _parse(
579626
580627 old_chat_member = old_chat_member ,
581628 new_chat_member = new_chat_member ,
629+
630+ show_message_sender_enabled = show_message_sender_enabled ,
631+ has_aggressive_anti_spam_enabled = has_aggressive_anti_spam_enabled ,
632+ has_protected_content = has_protected_content ,
633+ is_forum = is_forum ,
582634 )
0 commit comments