From d91de719114225508c22de63242707e8cee477d9 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sun, 6 Feb 2022 11:57:22 +0700 Subject: [PATCH] restrict gbanned user --- program/video.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/program/video.py b/program/video.py index ebe5296..f96f5b9 100644 --- a/program/video.py +++ b/program/video.py @@ -12,6 +12,7 @@ from driver.design.chatname import CHAT_TITLE from driver.filters import command, other_filters from driver.queues import QUEUE, add_to_queue from driver.veez import call_py, user +from driver.database.dbpunish import is_gbanned_user from pyrogram import Client from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant from pyrogram.types import InlineKeyboardMarkup, Message @@ -63,6 +64,10 @@ async def vplay(c: Client, m: Message): replied = m.reply_to_message chat_id = m.chat.id user_id = m.from_user.id + user_xd = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" + if await is_gbanned_user(user_id): + await message.reply_text(f"❗️ {user_xd} **You've been blocked from using this bot!") + return if m.sender_chat: return await m.reply_text( "you're an __Anonymous__ user !\n\n» revert back to your real user account to use this bot." @@ -329,6 +334,10 @@ async def vstream(c: Client, m: Message): await m.delete() chat_id = m.chat.id user_id = m.from_user.id + user_xd = f"[{m.from_user.first_name}](tg://user?id={m.from_user.id})" + if await is_gbanned_user(user_id): + await message.reply_text(f"❗️ {user_xd} **You've been blocked from using this bot!") + return if m.sender_chat: return await m.reply_text( "you're an __Anonymous__ user !\n\n» revert back to your real user account to use this bot."