Spaces:
Sleeping
Sleeping
Update code2.py
Browse files
code2.py
CHANGED
@@ -42,8 +42,8 @@ async def check_blacklist(event):
|
|
42 |
logger.info(f"User id: {user.id}, username: {user.username}")
|
43 |
|
44 |
# Check if the user is an admin
|
45 |
-
chat_admins = await event.
|
46 |
-
is_admin = any(admin.
|
47 |
|
48 |
if not is_admin:
|
49 |
try:
|
|
|
42 |
logger.info(f"User id: {user.id}, username: {user.username}")
|
43 |
|
44 |
# Check if the user is an admin
|
45 |
+
chat_admins = await client.get_participants(event.chat_id, filter=ChannelParticipantsAdmins)
|
46 |
+
is_admin = any(admin.id == user.id for admin in chat_admins)
|
47 |
|
48 |
if not is_admin:
|
49 |
try:
|