Update main.py
Browse files
main.py
CHANGED
@@ -4,6 +4,7 @@ import os
|
|
4 |
from pyrogram import Client, filters
|
5 |
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
|
6 |
from pyrogram.types import *
|
|
|
7 |
import akenoai as ak
|
8 |
from config import API_KEY, API_ID, API_HASH, BOT_TOKEN
|
9 |
from scripts import progress
|
@@ -52,6 +53,64 @@ api = ak.PornoHub(key=API_KEY)
|
|
52 |
|
53 |
not_allowed = ["hi", "hello", "hey", "hai", "help"]
|
54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
@client.on_message(filters.command("start") & filters.private)
|
56 |
async def welcome_start(client: Client, message: Message):
|
57 |
keyboard = InlineKeyboardMarkup(
|
@@ -82,6 +141,7 @@ async def welcome_start(client: Client, message: Message):
|
|
82 |
@client.on_message(
|
83 |
filters.command(["hubsearch"])
|
84 |
& filters.private
|
|
|
85 |
& ~filters.forwarded
|
86 |
)
|
87 |
async def searchhub(client: Client, message: Message):
|
@@ -130,6 +190,7 @@ async def searchhub(client: Client, message: Message):
|
|
130 |
@client.on_message(
|
131 |
filters.command(["hubdl"])
|
132 |
& filters.private
|
|
|
133 |
& ~filters.forwarded
|
134 |
)
|
135 |
async def porno_download(client: Client, message: Message):
|
|
|
4 |
from pyrogram import Client, filters
|
5 |
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton
|
6 |
from pyrogram.types import *
|
7 |
+
from pyrogram.errors import *
|
8 |
import akenoai as ak
|
9 |
from config import API_KEY, API_ID, API_HASH, BOT_TOKEN
|
10 |
from scripts import progress
|
|
|
53 |
|
54 |
not_allowed = ["hi", "hello", "hey", "hai", "help"]
|
55 |
|
56 |
+
@Clienr.on_message(filters.incoming & filters.private, group=-1)
|
57 |
+
async def must_join_channel(bot: Client, msg: Message):
|
58 |
+
MUST_JOIN = "RendyProjects"
|
59 |
+
try:
|
60 |
+
if not (
|
61 |
+
await check_membership(MUST_JOIN, bot, msg)
|
62 |
+
and
|
63 |
+
await check_membership(MUST_JOIN_2, bot, msg)
|
64 |
+
):
|
65 |
+
force_button = InlineKeyboardMarkup(
|
66 |
+
[
|
67 |
+
[
|
68 |
+
InlineKeyboardButton(
|
69 |
+
text="Rendy Projects",
|
70 |
+
url=f"https://t.me/{MUST_JOIN}"
|
71 |
+
)
|
72 |
+
]
|
73 |
+
]
|
74 |
+
)
|
75 |
+
mention = msg.from_user.mention if msg.from_user else ""
|
76 |
+
user_id = msg.from_user.id if msg.from_user else 0
|
77 |
+
await msg.delete()
|
78 |
+
await msg.reply(
|
79 |
+
f"Hey {mention}\n⚠️ To use this bot you have to <b>subscribe to our channel</b>",
|
80 |
+
disable_web_page_preview=True,
|
81 |
+
reply_markup=force_button
|
82 |
+
)
|
83 |
+
await msg.stop_propagation()
|
84 |
+
except ChatAdminRequired:
|
85 |
+
pass
|
86 |
+
|
87 |
+
async def check_membership(channel_id, bot, msg):
|
88 |
+
try:
|
89 |
+
user_id = msg.from_user.id if msg.from_user else 0
|
90 |
+
mention_user = await bot.get_users(user_id)
|
91 |
+
user = await bot.get_chat_member(channel_id, user_id)
|
92 |
+
if user.status == ChatMemberStatus.BANNED:
|
93 |
+
admin_support = InlineKeyboardMarkup(
|
94 |
+
[
|
95 |
+
[
|
96 |
+
InlineKeyboardButton(
|
97 |
+
text="Developer",
|
98 |
+
url="https://t.me/xtdevs"
|
99 |
+
)
|
100 |
+
]
|
101 |
+
]
|
102 |
+
)
|
103 |
+
mention = mention_user.mention if mention_user else ""
|
104 |
+
await bot.send_message(
|
105 |
+
msg.chat.id,
|
106 |
+
text=f"❌ you {mention} have been blocked from the group support\n\nclick the button below to contact the group admin",
|
107 |
+
reply_markup=admin_support
|
108 |
+
)
|
109 |
+
return False
|
110 |
+
return True
|
111 |
+
except UserNotParticipant:
|
112 |
+
return False
|
113 |
+
|
114 |
@client.on_message(filters.command("start") & filters.private)
|
115 |
async def welcome_start(client: Client, message: Message):
|
116 |
keyboard = InlineKeyboardMarkup(
|
|
|
141 |
@client.on_message(
|
142 |
filters.command(["hubsearch"])
|
143 |
& filters.private
|
144 |
+
& filters.incoming
|
145 |
& ~filters.forwarded
|
146 |
)
|
147 |
async def searchhub(client: Client, message: Message):
|
|
|
190 |
@client.on_message(
|
191 |
filters.command(["hubdl"])
|
192 |
& filters.private
|
193 |
+
& filters.incoming
|
194 |
& ~filters.forwarded
|
195 |
)
|
196 |
async def porno_download(client: Client, message: Message):
|