Update main.py
Browse files
main.py
CHANGED
@@ -53,6 +53,7 @@ api = ak.PornoHub(key=API_KEY)
|
|
53 |
|
54 |
not_allowed = ["hi", "hello", "hey", "hai", "help"]
|
55 |
|
|
|
56 |
@Client.on_message(filters.incoming & filters.private, group=-1)
|
57 |
async def must_join_channel(bot: Client, msg: Message):
|
58 |
MUST_JOIN = "RendyProjects"
|
@@ -80,6 +81,41 @@ async def must_join_channel(bot: Client, msg: Message):
|
|
80 |
pass
|
81 |
except ChatAdminRequired:
|
82 |
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
async def check_membership(channel_id, bot, msg):
|
85 |
try:
|
|
|
53 |
|
54 |
not_allowed = ["hi", "hello", "hey", "hai", "help"]
|
55 |
|
56 |
+
"""
|
57 |
@Client.on_message(filters.incoming & filters.private, group=-1)
|
58 |
async def must_join_channel(bot: Client, msg: Message):
|
59 |
MUST_JOIN = "RendyProjects"
|
|
|
81 |
pass
|
82 |
except ChatAdminRequired:
|
83 |
pass
|
84 |
+
"""
|
85 |
+
|
86 |
+
@client.on_message(
|
87 |
+
filters.incoming
|
88 |
+
& filters.private,
|
89 |
+
group=-1
|
90 |
+
)
|
91 |
+
async def must_join_channel(bot: Client, msg: Message):
|
92 |
+
MUST_JOIN = "RendyProjects"
|
93 |
+
try:
|
94 |
+
if not (
|
95 |
+
await check_membership(MUST_JOIN, bot, msg)
|
96 |
+
):
|
97 |
+
force_button = InlineKeyboardMarkup(
|
98 |
+
[
|
99 |
+
[
|
100 |
+
InlineKeyboardButton(
|
101 |
+
text="Rendy Projects",
|
102 |
+
url=f"https://t.me/{MUST_JOIN}"
|
103 |
+
)
|
104 |
+
]
|
105 |
+
]
|
106 |
+
)
|
107 |
+
mention = msg.from_user.mention if msg.from_user else ""
|
108 |
+
user_id = msg.from_user.id if msg.from_user else 0
|
109 |
+
await msg.delete()
|
110 |
+
await msg.reply(
|
111 |
+
f"Hey {mention}\n⚠️ To use this bot you have to <b>subscribe to our channel</b>",
|
112 |
+
disable_web_page_preview=True,
|
113 |
+
reply_markup=force_button
|
114 |
+
)
|
115 |
+
await msg.stop_propagation()
|
116 |
+
except ChatAdminRequired:
|
117 |
+
pass
|
118 |
+
|
119 |
|
120 |
async def check_membership(channel_id, bot, msg):
|
121 |
try:
|