Spaces:
Running
Running
main.py
CHANGED
@@ -13,6 +13,7 @@ import asyncio
|
|
13 |
import logging
|
14 |
from pyrogram import *
|
15 |
from pyrogram.enums import MessageEntityType
|
|
|
16 |
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
17 |
from config import *
|
18 |
from database import db
|
@@ -91,7 +92,6 @@ async def start_command(client, message):
|
|
91 |
reply_markup=reply_markup
|
92 |
)
|
93 |
|
94 |
-
|
95 |
@bot.on_message(filters.command("addmoduser") & filters.group)
|
96 |
async def addwhitelist(client, message):
|
97 |
if message.from_user.id not in [6477856957]:
|
@@ -210,34 +210,37 @@ async def delwhitelistbot(client, message):
|
|
210 |
|
211 |
@bot.on_chat_member_updated(filters.group)
|
212 |
async def group_join(client, message):
|
213 |
-
|
214 |
-
if message.
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
)
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
await db.antieval.update_one(
|
236 |
-
{"bot_id": client.me.id},
|
237 |
-
{"$addToSet": {"chat_id": message.chat.id}},
|
238 |
-
upsert=True,
|
239 |
-
)
|
240 |
-
logging.info(f"Added to group: {message.chat.title} ({message.chat.id})")
|
241 |
|
242 |
@bot.on_message(filters.via_bot)
|
243 |
async def block_inline_via_bot(client, message):
|
|
|
13 |
import logging
|
14 |
from pyrogram import *
|
15 |
from pyrogram.enums import MessageEntityType
|
16 |
+
from pyrogram.errors import ChannelPrivate
|
17 |
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
18 |
from config import *
|
19 |
from database import db
|
|
|
92 |
reply_markup=reply_markup
|
93 |
)
|
94 |
|
|
|
95 |
@bot.on_message(filters.command("addmoduser") & filters.group)
|
96 |
async def addwhitelist(client, message):
|
97 |
if message.from_user.id not in [6477856957]:
|
|
|
210 |
|
211 |
@bot.on_chat_member_updated(filters.group)
|
212 |
async def group_join(client, message):
|
213 |
+
try:
|
214 |
+
if message.new_chat_member and message.new_chat_member.user.id == client.me.id:
|
215 |
+
if message.chat.id in LEAVE_GROUP_LIST:
|
216 |
+
await client.leave_chat(message.chat.id)
|
217 |
+
await message.reply_text(
|
218 |
+
"GUA KELUAR DULU YA! LU TARIK BOT KE GRUP DEVELOPER YANG SUDAH DIBLACKLIST! π₯\n"
|
219 |
+
"GAK MALU APA TARIK BOT TAPI GAK TAU ATURAN?\n"
|
220 |
+
"INI BUKAN BOT PAJANGAN, INI BOT ANTI EVAL! π«π§ "
|
221 |
+
)
|
222 |
+
return
|
223 |
+
|
224 |
+
privileges = message.new_chat_member.privileges
|
225 |
+
|
226 |
+
if not privileges or not privileges.can_restrict_members or not privileges.can_delete_messages:
|
227 |
+
await client.send_message(
|
228 |
+
message.chat.id,
|
229 |
+
"GUA KELUAR DULU YA! LU NARIK BOT TAPI GAK KASIH IZIN BANNED! π₯\n"
|
230 |
+
"BIKIN BOT BUAT APA KALO CUMA JADI PAJANGAN?"
|
231 |
+
)
|
232 |
+
await client.leave_chat(message.chat.id)
|
233 |
+
logging.info(f"Left group: {message.chat.title} ({message.chat.id})")
|
234 |
+
return
|
235 |
+
|
236 |
+
await db.antieval.update_one(
|
237 |
+
{"bot_id": client.me.id},
|
238 |
+
{"$addToSet": {"chat_id": message.chat.id}},
|
239 |
+
upsert=True,
|
240 |
)
|
241 |
+
logging.info(f"Added to group: {message.chat.title} ({message.chat.id})")
|
242 |
+
except ChannelPrivate:
|
243 |
+
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
@bot.on_message(filters.via_bot)
|
246 |
async def block_inline_via_bot(client, message):
|