forked from mrnoobx/Pro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbanned.py
40 lines (33 loc) · 1.66 KB
/
banned.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from pyrogram import Client, filters
from utils import temp
from pyrogram.types import Message
from database.users_chats_db import db
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from info import SUPPORT_CHAT
async def banned_users(_, client, message: Message):
return (
message.from_user is not None or not message.sender_chat
) and message.from_user.id in temp.BANNED_USERS
banned_user = filters.create(banned_users)
async def disabled_chat(_, client, message: Message):
return message.chat.id in temp.BANNED_CHATS
disabled_group=filters.create(disabled_chat)
@Client.on_message(filters.private & banned_user & filters.incoming)
async def ban_reply(bot, message):
ban = await db.get_ban_status(message.from_user.id)
await message.reply(f'sᴏʀʀʏ ᴜ ʀᴇ ʙᴀɴɴᴇᴅ ʙʏ ᴀᴅᴍɪɴ. \nʙᴀɴ ʀᴇᴀsᴏɴ: {ban["ban_reason"]}')
@Client.on_message(filters.group & disabled_group & filters.incoming)
async def grp_bd(bot, message):
buttons = [[
InlineKeyboardButton('sᴜᴘᴘᴏʀᴛ', url=f'https://t.me/{SUPPORT_CHAT}')
]]
reply_markup=InlineKeyboardMarkup(buttons)
vazha = await db.get_chat(message.chat.id)
k = await message.reply(
text=f"ᴄʜᴀᴛ ɴᴏᴛ ᴀʟʟᴏᴡᴇᴅ 🐞\n\nᴜ ʜᴀᴠᴇ ʙᴀɴɴᴇᴅ ᴅᴜᴇ ᴛᴏ ɪʟʟᴇɢᴀʟ ᴜsᴀɢᴇ ᴏғ ᴍᴇ .. ɪғ ᴜ ᴜsᴇ ᴍᴇ ɴᴏᴡ ᴀғᴛᴇʀ ᴘʟᴇᴀsᴇ ᴄᴏɴᴛᴀᴄᴛ sᴜᴘᴘᴏʀᴛ ᴏʀ ᴏᴡɴᴇʀ \nReason : <code>{vazha['reason']}</code>.",
reply_markup=reply_markup)
try:
await k.pin()
except:
pass
await bot.leave_chat(message.chat.id)