From 084a08639369e28e2e28a79e0ec512e502d0649c Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sun, 6 Feb 2022 12:46:06 +0700 Subject: [PATCH] forgot --- program/admins.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/program/admins.py b/program/admins.py index e8c1a66..27ca4ba 100644 --- a/program/admins.py +++ b/program/admins.py @@ -7,6 +7,7 @@ from driver.queues import QUEUE, clear_queue from driver.filters import command, other_filters from driver.decorators import authorized_users_only from driver.utils import skip_current_song, skip_item +from driver.database.dbpunish import is_gbanned_user from program.utils.inline import ( stream_markup, close_mark, @@ -23,9 +24,13 @@ from pyrogram.types import ( @Client.on_message(command(["reload", f"reload@{BOT_USERNAME}"]) & other_filters) @authorized_users_only -async def update_admin(client, message): +async def update_admin(client, message: Message): global admins new_admins = [] + user_id = message.from_user.id + if await is_gbanned_user(user_id): + await message.reply_text("❗️ **You've been blocked from using this bot!") + return new_ads = await client.get_chat_members(message.chat.id, filter="administrators") for u in new_ads: new_admins.append(u.user.id)