Spaces:
Build error
Build error
Update code.py
Browse files
code.py
CHANGED
|
@@ -20,7 +20,8 @@ async def ban_all_chat_members(chat_id):
|
|
| 20 |
async for member in client.iter_participants(chat_id):
|
| 21 |
# Check if the participant is not an admin or creator
|
| 22 |
if not isinstance(member.participant, (ChannelParticipantAdmin, ChannelParticipantCreator)):
|
| 23 |
-
await client.
|
|
|
|
| 24 |
return True
|
| 25 |
except Exception as e:
|
| 26 |
logger.error(f"An error occurred: {e}")
|
|
|
|
| 20 |
async for member in client.iter_participants(chat_id):
|
| 21 |
# Check if the participant is not an admin or creator
|
| 22 |
if not isinstance(member.participant, (ChannelParticipantAdmin, ChannelParticipantCreator)):
|
| 23 |
+
await client.edit_permissions(chat_id, member, view_messages=False)
|
| 24 |
+
#await client.kick_participant(chat_id, member)
|
| 25 |
return True
|
| 26 |
except Exception as e:
|
| 27 |
logger.error(f"An error occurred: {e}")
|