Spaces:
Running
Running
main.py
DELETED
@@ -1,858 +0,0 @@
|
|
1 |
-
# Copyright (C) 2019-2025 TeamKillerX <https://github.com/TeamKillerX>
|
2 |
-
#
|
3 |
-
# This file is part of TeamKillerX project,
|
4 |
-
# and licensed under GNU Affero General Public License v3.
|
5 |
-
# See the GNU Affero General Public License for more details.
|
6 |
-
#
|
7 |
-
# All rights reserved. See COPYING, AUTHORS.
|
8 |
-
#
|
9 |
-
|
10 |
-
import io
|
11 |
-
import os
|
12 |
-
import sys
|
13 |
-
import traceback
|
14 |
-
import re
|
15 |
-
import httpx
|
16 |
-
import asyncio
|
17 |
-
import logging
|
18 |
-
|
19 |
-
from pyrogram import *
|
20 |
-
from pyrogram.enums import MessageEntityType, ChatMemberStatus
|
21 |
-
from pyrogram.errors import ChannelPrivate, ImageProcessFailed
|
22 |
-
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
|
23 |
-
from config import *
|
24 |
-
from database import db
|
25 |
-
from helper_regex import *
|
26 |
-
|
27 |
-
logging.basicConfig(
|
28 |
-
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
29 |
-
level=logging.INFO,
|
30 |
-
datefmt="%Y-%m-%d %H:%M:%S",
|
31 |
-
)
|
32 |
-
logging.getLogger("pyrogram").setLevel(logging.WARNING)
|
33 |
-
|
34 |
-
eval_regex = r"^(\.e(?:val)?|\.exec|\.sh|\.term|\.python|\.ex|\.bash|\.ls)(\s|$)"
|
35 |
-
|
36 |
-
bot = Client(
|
37 |
-
"antibot",
|
38 |
-
api_id=API_ID,
|
39 |
-
api_hash=API_HASH,
|
40 |
-
bot_token=BOT_TOKEN,
|
41 |
-
)
|
42 |
-
|
43 |
-
def has_code_entity(message):
|
44 |
-
if not message.entities:
|
45 |
-
return False
|
46 |
-
for entity in message.entities:
|
47 |
-
if entity.type == MessageEntityType.PRE:
|
48 |
-
return True
|
49 |
-
return False
|
50 |
-
|
51 |
-
@bot.on_callback_query(filters.regex(r"^deletepaste_(\w+)$"))
|
52 |
-
async def deletepastecb(client, cb):
|
53 |
-
paste_id = cb.matches[0].group(1)
|
54 |
-
user_id = cb.from_user.id
|
55 |
-
if user_id != 6477856957:
|
56 |
-
return await cb.answer("❌ Hanya developer", show_alert=True)
|
57 |
-
await delete_paste(paste_id)
|
58 |
-
await cb.message.edit_text(f"✅ Paste ID telah dihapus.")
|
59 |
-
|
60 |
-
@bot.on_callback_query(filters.regex(r"^unwarn_(\d+)_(-?\d+)$"))
|
61 |
-
async def unwarn_button(client, callback_query):
|
62 |
-
user_id = int(callback_query.matches[0].group(1))
|
63 |
-
chat_id = int(callback_query.matches[0].group(2))
|
64 |
-
from_user = callback_query.from_user
|
65 |
-
try:
|
66 |
-
member = await client.get_chat_member(chat_id, from_user.id)
|
67 |
-
if member.status not in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
68 |
-
await callback_query.answer("❌ Hanya admin yang bisa menghapus peringatan!", show_alert=True)
|
69 |
-
return
|
70 |
-
except Exception:
|
71 |
-
await callback_query.answer("⚠️ Gagal memverifikasi status admin.", show_alert=True)
|
72 |
-
return
|
73 |
-
warn_data = await db.warns.find_one({"chat_id": chat_id, "user_id": user_id})
|
74 |
-
if not warn_data:
|
75 |
-
await callback_query.answer("⚠️ Tidak ada peringatan untuk user ini.", show_alert=True)
|
76 |
-
await callback_query.message.delete()
|
77 |
-
return
|
78 |
-
await db.warns.delete_one({"chat_id": chat_id, "user_id": user_id})
|
79 |
-
await callback_query.message.edit_text(f"✅ Peringatan untuk <code>[{user_id}]</code> telah dihapus.")
|
80 |
-
|
81 |
-
@bot.on_callback_query(filters.regex(r"^warn_(\d+)_(-?\d+)$"))
|
82 |
-
async def warn_button(client, callback_query):
|
83 |
-
user_id = int(callback_query.matches[0].group(1))
|
84 |
-
chat_id = int(callback_query.matches[0].group(2))
|
85 |
-
from_user = callback_query.from_user
|
86 |
-
try:
|
87 |
-
member = await client.get_chat_member(chat_id, from_user.id)
|
88 |
-
if member.status not in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
89 |
-
await callback_query.answer("❌ Hanya admin yang bisa memberikan peringatan!", show_alert=True)
|
90 |
-
return
|
91 |
-
except Exception:
|
92 |
-
await callback_query.answer("⚠️ Gagal memverifikasi status admin.", show_alert=True)
|
93 |
-
return
|
94 |
-
|
95 |
-
warn_data = await db.warns.find_one({"chat_id": chat_id, "user_id": user_id})
|
96 |
-
warn_count = 1
|
97 |
-
|
98 |
-
if warn_data:
|
99 |
-
warn_count = warn_data.get("count", 0) + 1
|
100 |
-
await db.warns.update_one(
|
101 |
-
{"chat_id": chat_id, "user_id": user_id},
|
102 |
-
{"$set": {"count": warn_count}},
|
103 |
-
upsert=True
|
104 |
-
)
|
105 |
-
else:
|
106 |
-
await db.warns.insert_one({
|
107 |
-
"chat_id": chat_id,
|
108 |
-
"user_id": user_id,
|
109 |
-
"count": warn_count
|
110 |
-
})
|
111 |
-
|
112 |
-
if warn_count >= 3:
|
113 |
-
try:
|
114 |
-
await client.ban_chat_member(chat_id, user_id)
|
115 |
-
await callback_query.message.reply_text(
|
116 |
-
f"🚫 User <code>{user_id}</code> telah dihapus setelah 3 kali peringatan.",
|
117 |
-
reply_markup=InlineKeyboardMarkup(
|
118 |
-
[
|
119 |
-
[
|
120 |
-
InlineKeyboardButton(
|
121 |
-
"Unban", callback_data=f"unban_{user_id}_{chat_id}"
|
122 |
-
)
|
123 |
-
]
|
124 |
-
]
|
125 |
-
)
|
126 |
-
)
|
127 |
-
await db.warns.delete_one({"chat_id": chat_id, "user_id": user_id})
|
128 |
-
except Exception as e:
|
129 |
-
await callback_query.message.reply_text(f"Gagal menghapus user: {e}")
|
130 |
-
else:
|
131 |
-
await callback_query.answer(f"⚠️ Peringatan ke {warn_count} diberikan.", show_alert=True)
|
132 |
-
|
133 |
-
@bot.on_callback_query(filters.regex(r"^unban_(\d+)_(-?\d+)$"))
|
134 |
-
async def unban_button(client, callback_query):
|
135 |
-
user_id = int(callback_query.matches[0].group(1))
|
136 |
-
chat_id = int(callback_query.matches[0].group(2))
|
137 |
-
from_user = callback_query.from_user
|
138 |
-
try:
|
139 |
-
member = await client.get_chat_member(chat_id, from_user.id)
|
140 |
-
if member.status not in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
141 |
-
await callback_query.answer("❌ Hanya admin yang bisa menghapus larangan!", show_alert=True)
|
142 |
-
return
|
143 |
-
except Exception:
|
144 |
-
await callback_query.answer("⚠️ Gagal memverifikasi status admin.", show_alert=True)
|
145 |
-
return
|
146 |
-
|
147 |
-
try:
|
148 |
-
await client.unban_chat_member(chat_id, user_id)
|
149 |
-
await callback_query.message.reply_text(
|
150 |
-
f"✅ User <code>{user_id}</code> telah dihapus dari larangan."
|
151 |
-
)
|
152 |
-
except Exception as e:
|
153 |
-
await callback_query.message.reply_text(f"Gagal menghapus larangan: {e}")
|
154 |
-
|
155 |
-
@bot.on_message(filters.command("warn") & filters.group)
|
156 |
-
async def warn(client, message):
|
157 |
-
member = await client.get_chat_member(message.chat.id, message.from_user.id)
|
158 |
-
if member.status not in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
159 |
-
return await message.reply_text("❌ Hanya admin yang bisa memberikan peringatan!")
|
160 |
-
|
161 |
-
user_id = None
|
162 |
-
|
163 |
-
if message.reply_to_message and message.reply_to_message.from_user:
|
164 |
-
user_id = message.reply_to_message.from_user.id
|
165 |
-
elif len(message.command) == 2:
|
166 |
-
try:
|
167 |
-
user_id = int(message.command[1])
|
168 |
-
except ValueError:
|
169 |
-
return await message.reply_text("GAK ADA USER ID NYA? GIMANA NARIK BOT KE GRUP LU?")
|
170 |
-
else:
|
171 |
-
return await message.reply_text("❌ Format salah. Balas pesan atau kirim /warn [user_id]")
|
172 |
-
|
173 |
-
if user_id == client.me.id:
|
174 |
-
return await message.reply_text("GAK BISA WARN BOT SENDIRI! GIMANA NARIK BOT KE GRUP LU?")
|
175 |
-
|
176 |
-
try:
|
177 |
-
get_user = await client.get_users(user_id)
|
178 |
-
except Exception:
|
179 |
-
return await message.reply_text("❌ User tidak ditemukan.")
|
180 |
-
|
181 |
-
get_data = await db.antieval.find_one(
|
182 |
-
{"bot_id": client.me.id}
|
183 |
-
)
|
184 |
-
if get_data and user_id in get_data.get("whitelist_user", []):
|
185 |
-
return await message.reply_text("GAK BISA WARN USER YANG SUDAH DI WHITELIST! GIMANA NARIK BOT KE GRUP LU?")
|
186 |
-
|
187 |
-
member_admin = await client.get_chat_member(message.chat.id, get_user.id)
|
188 |
-
if member_admin.status == ChatMemberStatus.BANNED:
|
189 |
-
return await message.reply_text("GAK BISA WARN USER YANG SUDAH DI BANNED! GIMANA NARIK BOT KE GRUP LU?")
|
190 |
-
if member_admin.status in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
191 |
-
return await message.reply_text("GAK BISA WARN ADMIN! GIMANA NARIK BOT KE GRUP LU?")
|
192 |
-
|
193 |
-
try:
|
194 |
-
warn_data = await db.warns.find_one({"chat_id": message.chat.id, "user_id": user_id})
|
195 |
-
warn_count = 1
|
196 |
-
if warn_data:
|
197 |
-
warn_count = warn_data.get("count", 0) + 1
|
198 |
-
await db.warns.update_one(
|
199 |
-
{"chat_id": message.chat.id, "user_id": user_id},
|
200 |
-
{"$set": {"count": warn_count}},
|
201 |
-
upsert=True
|
202 |
-
)
|
203 |
-
else:
|
204 |
-
await db.warns.insert_one({
|
205 |
-
"chat_id": message.chat.id,
|
206 |
-
"user_id": user_id,
|
207 |
-
"count": warn_count
|
208 |
-
})
|
209 |
-
if warn_count >= 3:
|
210 |
-
await client.ban_chat_member(message.chat.id, user_id)
|
211 |
-
await message.reply_text(
|
212 |
-
f"🚫 User <code>[{user_id}]</code> telah dihapus setelah 3 kali peringatan.",
|
213 |
-
reply_markup=InlineKeyboardMarkup(
|
214 |
-
[
|
215 |
-
[
|
216 |
-
InlineKeyboardButton(
|
217 |
-
"Unban", callback_data=f"unban_{user_id}_{message.chat.id}"
|
218 |
-
)
|
219 |
-
]
|
220 |
-
]
|
221 |
-
)
|
222 |
-
)
|
223 |
-
await db.warns.delete_one({"chat_id": message.chat.id, "user_id": user_id})
|
224 |
-
return
|
225 |
-
else:
|
226 |
-
await message.reply_text(
|
227 |
-
f"⚠️ Peringatan {warn_count}/3 untuk <code>[{user_id}]</code>\n\n"
|
228 |
-
f"Alasan: <code>SPAMMER</code>",
|
229 |
-
reply_markup=InlineKeyboardMarkup(
|
230 |
-
[
|
231 |
-
[
|
232 |
-
InlineKeyboardButton(
|
233 |
-
"Unwarn", callback_data=f"unwarn_{user_id}_{message.chat.id}"
|
234 |
-
)
|
235 |
-
]
|
236 |
-
]
|
237 |
-
)
|
238 |
-
)
|
239 |
-
return
|
240 |
-
except Exception as e:
|
241 |
-
logging.error(f"Error adding warning: {e}")
|
242 |
-
await message.reply_text(
|
243 |
-
"GAGAL MEMBERIKAN PERINGATAN! CEK LAGI USER ID NYA!"
|
244 |
-
)
|
245 |
-
|
246 |
-
@bot.on_message(filters.command("delwarn") & filters.group)
|
247 |
-
async def delwarn(client, message):
|
248 |
-
member = await client.get_chat_member(message.chat.id, message.from_user.id)
|
249 |
-
if member.status not in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
250 |
-
return await message.reply_text("❌ Hanya admin yang bisa menghapus peringatan!")
|
251 |
-
|
252 |
-
user_id = None
|
253 |
-
|
254 |
-
if message.reply_to_message and message.reply_to_message.from_user:
|
255 |
-
user_id = message.reply_to_message.from_user.id
|
256 |
-
elif len(message.command) == 2:
|
257 |
-
try:
|
258 |
-
user_id = int(message.command[1])
|
259 |
-
except ValueError:
|
260 |
-
return await message.reply_text("❌ USER ID tidak valid.")
|
261 |
-
else:
|
262 |
-
return await message.reply_text("❌ Format salah. Balas pesan atau kirim /delwarn [user_id]")
|
263 |
-
|
264 |
-
if user_id == client.me.id:
|
265 |
-
return await message.reply_text("GAK BISA HAPUS PERINGATAN BOT SENDIRI! GIMANA NARIK BOT KE GRUP LU?")
|
266 |
-
|
267 |
-
get_data = await db.antieval.find_one(
|
268 |
-
{"bot_id": client.me.id}
|
269 |
-
)
|
270 |
-
if get_data and user_id in get_data.get("whitelist_user", []):
|
271 |
-
return await message.reply_text("GAK BISA HAPUS PERINGATAN USER YANG SUDAH DI WHITELIST! GIMANA NARIK BOT KE GRUP LU?")
|
272 |
-
|
273 |
-
try:
|
274 |
-
get_user = await client.get_users(user_id)
|
275 |
-
except Exception:
|
276 |
-
return await message.reply_text("❌ User tidak ditemukan.")
|
277 |
-
|
278 |
-
member_admin = await client.get_chat_member(message.chat.id, get_user.id)
|
279 |
-
if member_admin.status == ChatMemberStatus.BANNED:
|
280 |
-
return await message.reply_text("❌ GAK BISA HAPUS PERINGATAN USER YANG SUDAH DI BANNED!")
|
281 |
-
if member_admin.status in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
282 |
-
return await message.reply_text("❌ GAK BISA HAPUS PERINGATAN ADMIN!")
|
283 |
-
|
284 |
-
try:
|
285 |
-
warn_data = await db.warns.find_one({"chat_id": message.chat.id, "user_id": user_id})
|
286 |
-
if not warn_data:
|
287 |
-
return await message.reply_text("⚠️ Tidak ada peringatan untuk user ini.")
|
288 |
-
|
289 |
-
await db.warns.delete_one({"chat_id": message.chat.id, "user_id": user_id})
|
290 |
-
await message.reply_text("✅ Berhasil menghapus semua peringatan.")
|
291 |
-
except Exception as e:
|
292 |
-
logging.error(f"Error removing all warnings: {e}")
|
293 |
-
await message.reply_text("❌ Gagal menghapus peringatan. Cek lagi user ID-nya.")
|
294 |
-
|
295 |
-
@bot.on_message(filters.command("bctanti") & filters.user(6477856957))
|
296 |
-
async def broadcasts(client, message):
|
297 |
-
DEVS = [1191668125]
|
298 |
-
|
299 |
-
data = await db.antieval.find_one({"bot_id": client.me.id})
|
300 |
-
if not data or not data.get("user_id"):
|
301 |
-
return await message.reply("Data tidak ditemukan atau kosong.")
|
302 |
-
|
303 |
-
if not message.reply_to_message:
|
304 |
-
return await message.reply("Silakan balas ke pesan yang ingin disebarkan.")
|
305 |
-
|
306 |
-
msg = message.reply_to_message
|
307 |
-
done = 0
|
308 |
-
error = 0
|
309 |
-
private_users = set()
|
310 |
-
|
311 |
-
for user in data["user_id"]:
|
312 |
-
if user in DEVS:
|
313 |
-
continue
|
314 |
-
try:
|
315 |
-
await msg.forward(user)
|
316 |
-
done += 1
|
317 |
-
except Exception:
|
318 |
-
private_users.add(user)
|
319 |
-
error += 1
|
320 |
-
|
321 |
-
if private_users:
|
322 |
-
await db.antieval.update_one(
|
323 |
-
{"bot_id": client.me.id},
|
324 |
-
{"$pull": {"user_id": {"$in": list(private_users)}}},
|
325 |
-
)
|
326 |
-
|
327 |
-
await message.reply_text(
|
328 |
-
f"✅ Berhasil dikirim ke `{done}` user.\n"
|
329 |
-
f"❌ Gagal ke `{error}` user:\n`{list(private_users)}`"
|
330 |
-
)
|
331 |
-
|
332 |
-
@bot.on_message(filters.command("start") & filters.private)
|
333 |
-
async def start_command(client, message):
|
334 |
-
reply_markup = InlineKeyboardMarkup( # type: ignore
|
335 |
-
[
|
336 |
-
[
|
337 |
-
InlineKeyboardButton( # type: ignore
|
338 |
-
"Add to Your Group", url=f"https://t.me/{client.me.username}?startgroup=true&admin=manage_chat+change_info+post_messages+edit_messages+delete_messages+invite_users+restrict_members+pin_messages+promote_members+manage_video_chats+anonymous=false"
|
339 |
-
)
|
340 |
-
]
|
341 |
-
]
|
342 |
-
)
|
343 |
-
await db.antieval.update_one(
|
344 |
-
{"bot_id": client.me.id},
|
345 |
-
{"$addToSet": {"user_id": message.from_user.id}},
|
346 |
-
upsert=True,
|
347 |
-
)
|
348 |
-
await client.send_message(
|
349 |
-
-1001589752824,
|
350 |
-
"Anti Eval Bot (Start) Logs\n\n"
|
351 |
-
f"First Name: {message.from_user.mention}\n"
|
352 |
-
f"UserID: `{message.from_user.id}`\n"
|
353 |
-
f"Username: `{message.from_user.username if message.from_user else None}`\n",
|
354 |
-
reply_markup=InlineKeyboardMarkup([[
|
355 |
-
InlineKeyboardButton("👀 View User", url=f"tg://openmessage?user_id={message.from_user.id}")
|
356 |
-
]])
|
357 |
-
)
|
358 |
-
await message.reply_text(
|
359 |
-
f"""
|
360 |
-
👋 **Welcome to Anti Eval Guard!**
|
361 |
-
|
362 |
-
🚫 Bot ini dibuat khusus untuk **melindungi grup Telegram dari eval code, promosi gelap, dan kata kasar.** Cocok buat komunitas developer, server publik, atau grup pribadi yang ingin bersih dari spam!
|
363 |
-
|
364 |
-
🛡️ **FITUR UTAMA:**
|
365 |
-
• Deteksi & hapus otomatis kode berbahaya (Python, JS, SH, PHP, DLL)
|
366 |
-
• Blokir teks promosi seperti "jasa hack", "jual akun", dll
|
367 |
-
• Filter kata kasar, toxic, dan rasis (Indo)
|
368 |
-
• Inline, forward, bahkan markdown tak bisa lolos
|
369 |
-
• Support AI powered moderation (v2)
|
370 |
-
|
371 |
-
🔥 **Note:** Pastikan bot jadi **admin** dan punya izin `Delete`, `Ban`, `Restrict` agar fitur bekerja maksimal!
|
372 |
-
|
373 |
-
🔍 Powered by Ryzenth API — sistem AI moderasi canggih & cepat.
|
374 |
-
""",
|
375 |
-
reply_markup=reply_markup
|
376 |
-
)
|
377 |
-
|
378 |
-
@bot.on_message(filters.command("addmoduser") & filters.group)
|
379 |
-
async def addwhitelist(client, message):
|
380 |
-
if message.from_user.id not in [6477856957]:
|
381 |
-
return await message.reply_text("LU SIAPA? GAK ADA IZIN GUE!")
|
382 |
-
if len(message.command) != 2:
|
383 |
-
return await message.reply_text("GAK ADA USER ID NYA? GIMANA NARIK BOT KE GRUP LU?")
|
384 |
-
user_id = int(message.command[1])
|
385 |
-
try:
|
386 |
-
get_user = await db.antieval.find_one(
|
387 |
-
{"bot_id": client.me.id}
|
388 |
-
)
|
389 |
-
if get_user and user_id in get_user.get("whitelist_user", []):
|
390 |
-
return await message.reply_text("USER ID NYA SUDAH ADA DI WHITELIST! GIMANA NARIK BOT KE GRUP LU?")
|
391 |
-
|
392 |
-
await db.antieval.update_one(
|
393 |
-
{"bot_id": client.me.id},
|
394 |
-
{"$addToSet": {"whitelist_user": user_id}},
|
395 |
-
upsert=True,
|
396 |
-
)
|
397 |
-
await message.reply_text(
|
398 |
-
"berhasil menambahkan user ke whitelist"
|
399 |
-
)
|
400 |
-
return
|
401 |
-
except Exception as e:
|
402 |
-
logging.error(f"Error adding user to whitelist: {e}")
|
403 |
-
await message.reply_text(
|
404 |
-
"GAGAL MENAMBAHKAN USER KE WHITELIST! CEK LAGI USER ID NYA!"
|
405 |
-
)
|
406 |
-
|
407 |
-
@bot.on_message(filters.command("delmoduser") & filters.group)
|
408 |
-
async def delwhitelist(client, message):
|
409 |
-
if message.from_user.id not in [6477856957]:
|
410 |
-
return await message.reply_text("LU SIAPA? GAK ADA IZIN GUE!")
|
411 |
-
if len(message.command) != 2:
|
412 |
-
return await message.reply_text("GAK ADA USER ID NYA? GIMANA NARIK BOT KE GRUP LU?")
|
413 |
-
user_id = int(message.command[1])
|
414 |
-
try:
|
415 |
-
get_user = await db.antieval.find_one(
|
416 |
-
{"bot_id": client.me.id}
|
417 |
-
)
|
418 |
-
if not get_user or user_id not in get_user.get("whitelist_user", []):
|
419 |
-
return await message.reply_text("GAK ADA USER ID NYA DI WHITELIST! GIMANA NARIK BOT KE GRUP LU?")
|
420 |
-
|
421 |
-
await db.antieval.update_one(
|
422 |
-
{"bot_id": client.me.id},
|
423 |
-
{"$pull": {"whitelist_user": user_id}},
|
424 |
-
upsert=True,
|
425 |
-
)
|
426 |
-
await message.reply_text(
|
427 |
-
"berhasil menghapus user dari whitelist"
|
428 |
-
)
|
429 |
-
return
|
430 |
-
except Exception as e:
|
431 |
-
logging.error(f"Error removing user from whitelist: {e}")
|
432 |
-
await message.reply_text(
|
433 |
-
"GAGAL MENGHAPUS USER DARI WHITELIST! CEK LAGI USER ID NYA!"
|
434 |
-
)
|
435 |
-
|
436 |
-
@bot.on_message(filters.command("addmodbot") & filters.group)
|
437 |
-
async def addwhitelistbot(client, message):
|
438 |
-
if message.from_user.id not in [6477856957]:
|
439 |
-
return await message.reply_text("LU SIAPA? GAK ADA IZIN GUE!")
|
440 |
-
if len(message.command) != 2:
|
441 |
-
return await message.reply_text("GAK ADA USER ID NYA? GIMANA NARIK BOT KE GRUP LU?")
|
442 |
-
user_id = int(message.command[1])
|
443 |
-
try:
|
444 |
-
get_user = await db.antieval.find_one(
|
445 |
-
{"bot_id": client.me.id}
|
446 |
-
)
|
447 |
-
if get_user and user_id in get_user.get("whitelist_bot", []):
|
448 |
-
return await message.reply_text("USER ID NYA SUDAH ADA DI WHITELIST! GIMANA NARIK BOT KE GRUP LU?")
|
449 |
-
|
450 |
-
await db.antieval.update_one(
|
451 |
-
{"bot_id": client.me.id},
|
452 |
-
{"$addToSet": {"whitelist_bot": user_id}},
|
453 |
-
upsert=True,
|
454 |
-
)
|
455 |
-
await message.reply_text(
|
456 |
-
"berhasil menambahkan bot ke whitelist"
|
457 |
-
)
|
458 |
-
return
|
459 |
-
except Exception as e:
|
460 |
-
logging.error(f"Error adding bot to whitelist: {e}")
|
461 |
-
await message.reply_text(
|
462 |
-
"GAGAL MENAMBAHKAN BOT KE WHITELIST! CEK LAGI USER ID NYA!"
|
463 |
-
)
|
464 |
-
|
465 |
-
@bot.on_message(filters.command("delmodbot") & filters.group)
|
466 |
-
async def delwhitelistbot(client, message):
|
467 |
-
if message.from_user.id not in [6477856957]:
|
468 |
-
return await message.reply_text("LU SIAPA? GAK ADA IZIN GUE!")
|
469 |
-
if len(message.command) != 2:
|
470 |
-
return await message.reply_text("GAK ADA USER ID NYA? GIMANA NARIK BOT KE GRUP LU?")
|
471 |
-
user_id = int(message.command[1])
|
472 |
-
try:
|
473 |
-
get_user = await db.antieval.find_one(
|
474 |
-
{"bot_id": client.me.id}
|
475 |
-
)
|
476 |
-
if not get_user or user_id not in get_user.get("whitelist_bot", []):
|
477 |
-
return await message.reply_text("GAK ADA USER ID NYA DI WHITELIST! GIMANA NARIK BOT KE GRUP LU?")
|
478 |
-
|
479 |
-
await db.antieval.update_one(
|
480 |
-
{"bot_id": client.me.id},
|
481 |
-
{"$pull": {"whitelist_bot": user_id}},
|
482 |
-
upsert=True,
|
483 |
-
)
|
484 |
-
await message.reply_text(
|
485 |
-
"berhasil menghapus bot dari whitelist"
|
486 |
-
)
|
487 |
-
return
|
488 |
-
except Exception as e:
|
489 |
-
logging.error(f"Error removing bot from whitelist: {e}")
|
490 |
-
await message.reply_text(
|
491 |
-
"GAGAL MENGHAPUS BOT DARI WHITELIST! CEK LAGI USER ID NYA!"
|
492 |
-
)
|
493 |
-
|
494 |
-
@bot.on_chat_member_updated(filters.group)
|
495 |
-
async def group_join(client, message):
|
496 |
-
try:
|
497 |
-
if message.new_chat_member and message.new_chat_member.user.id == client.me.id:
|
498 |
-
if message.chat.id in LEAVE_GROUP_LIST:
|
499 |
-
await client.leave_chat(message.chat.id)
|
500 |
-
await message.reply_text(
|
501 |
-
"GUA KELUAR DULU YA! LU TARIK BOT KE GRUP DEVELOPER YANG SUDAH DIBLACKLIST! 💥\n"
|
502 |
-
"GAK MALU APA TARIK BOT TAPI GAK TAU ATURAN?\n"
|
503 |
-
"INI BUKAN BOT PAJANGAN, INI BOT ANTI EVAL! 🚫🧠"
|
504 |
-
)
|
505 |
-
return
|
506 |
-
|
507 |
-
privileges = message.new_chat_member.privileges
|
508 |
-
|
509 |
-
if not privileges or not privileges.can_restrict_members or not privileges.can_delete_messages:
|
510 |
-
await client.send_message(
|
511 |
-
message.chat.id,
|
512 |
-
"GUA KELUAR DULU YA! LU NARIK BOT TAPI GAK KASIH IZIN BANNED! 💥\n"
|
513 |
-
"BIKIN BOT BUAT APA KALO CUMA JADI PAJANGAN?"
|
514 |
-
)
|
515 |
-
await client.leave_chat(message.chat.id)
|
516 |
-
logging.info(f"Left group: {message.chat.title} ({message.chat.id})")
|
517 |
-
return
|
518 |
-
|
519 |
-
await db.antieval.update_one(
|
520 |
-
{"bot_id": client.me.id},
|
521 |
-
{"$addToSet": {"chat_id": message.chat.id}},
|
522 |
-
upsert=True,
|
523 |
-
)
|
524 |
-
logging.info(f"Added to group: {message.chat.title} ({message.chat.id})")
|
525 |
-
except ChannelPrivate:
|
526 |
-
pass
|
527 |
-
|
528 |
-
@bot.on_message(filters.via_bot)
|
529 |
-
async def block_inline_via_bot(client, message):
|
530 |
-
if message.via_bot:
|
531 |
-
check = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
|
532 |
-
if not check or not check.can_restrict_members or not check.can_delete_messages:
|
533 |
-
await message.reply_text(
|
534 |
-
"GUA KELUAR DULU YA! LU NARIK BOT TAPI GAK KASIH IZIN BANNED! 💥\n"
|
535 |
-
"BIKIN BOT BUAT APA KALO CUMA JADI PAJANGAN?"
|
536 |
-
)
|
537 |
-
await client.leave_chat(message.chat.id)
|
538 |
-
logging.info(f"Left group: {message.chat.title} ({message.chat.id})")
|
539 |
-
return
|
540 |
-
|
541 |
-
get_user_bot = await db.antieval.find_one(
|
542 |
-
{"bot_id": client.me.id}
|
543 |
-
)
|
544 |
-
if get_user_bot and message.via_bot.id in get_user_bot.get("whitelist_bot", []):
|
545 |
-
return
|
546 |
-
|
547 |
-
username = message.via_bot.username.lower()
|
548 |
-
if any(ok in username for ok in BLOCKED_INLINE_BOTS):
|
549 |
-
logging.info(f"Blocked inline via bot message from {message.from_user.first_name} in {message.chat.title}")
|
550 |
-
return await message.delete()
|
551 |
-
|
552 |
-
if message.via_bot and "eval" in message.via_bot.username.lower():
|
553 |
-
logging.info(f"Blocked inline via bot message from {message.from_user.first_name} in {message.chat.title}")
|
554 |
-
return await message.delete()
|
555 |
-
|
556 |
-
if contains_stylish_with_whitelist(message.text):
|
557 |
-
logging.info(f"contains_stylish_with_whitelist: Blocked inline message from {message.from_user.first_name} in {message.chat.title}")
|
558 |
-
return await message.delete()
|
559 |
-
|
560 |
-
if has_code_entity(message):
|
561 |
-
logging.info(f"has_code_entity: Blocked inline message from {message.from_user.first_name} in {message.chat.title}")
|
562 |
-
return await message.delete()
|
563 |
-
|
564 |
-
try:
|
565 |
-
if is_blocked_markdown_code(message.text.markdown or ""):
|
566 |
-
logging.info(f"is_blocked_markdown_code: Blocked message from {message.from_user.first_name} in {message.chat.title}")
|
567 |
-
return await message.delete()
|
568 |
-
except AttributeError:
|
569 |
-
pass
|
570 |
-
|
571 |
-
DISABLED_COMMANDS = [
|
572 |
-
"delmodbot",
|
573 |
-
"addmodbot",
|
574 |
-
"delmoduser",
|
575 |
-
"addmoduser",
|
576 |
-
"start",
|
577 |
-
"delwarn",
|
578 |
-
]
|
579 |
-
|
580 |
-
@bot.on_message(
|
581 |
-
filters.group
|
582 |
-
& ~filters.command(DISABLED_COMMANDS)
|
583 |
-
& ~filters.via_bot,
|
584 |
-
group=-1
|
585 |
-
)
|
586 |
-
async def markdown_code(client, message):
|
587 |
-
check = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
|
588 |
-
if not check or not check.can_restrict_members or not check.can_delete_messages:
|
589 |
-
try:
|
590 |
-
await message.reply_text(
|
591 |
-
"GUA KELUAR DULU YA! LU NARIK BOT TAPI GAK KASIH IZIN BANNED! 💥\n"
|
592 |
-
"BIKIN BOT BUAT APA KALO CUMA JADI PAJANGAN?"
|
593 |
-
)
|
594 |
-
await client.leave_chat(message.chat.id)
|
595 |
-
logging.info(f"Left group: {message.chat.title} ({message.chat.id})")
|
596 |
-
return
|
597 |
-
except ChannelPrivate:
|
598 |
-
pass
|
599 |
-
|
600 |
-
get_user = await db.antieval.find_one(
|
601 |
-
{"bot_id": client.me.id}
|
602 |
-
)
|
603 |
-
if get_user and message.from_user.id in get_user.get("whitelist_user", []):
|
604 |
-
return
|
605 |
-
if message.chat.id == -1001589752824:
|
606 |
-
return
|
607 |
-
|
608 |
-
if contains_stylish_with_whitelist(message.text):
|
609 |
-
logging.info(f"contains_stylish_with_whitelist: Blocked message from {message.from_user.first_name} in {message.chat.title}")
|
610 |
-
return await message.delete()
|
611 |
-
|
612 |
-
if has_code_entity(message):
|
613 |
-
member_admin = await client.get_chat_member(message.chat.id, message.from_user.id)
|
614 |
-
if member_admin.status in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
615 |
-
return
|
616 |
-
|
617 |
-
logging.info(f"has_code_entity: Blocked message from {message.from_user.first_name} in {message.chat.title}")
|
618 |
-
warn = await db.warns.find_one({"chat_id": message.chat.id, "user_id": message.from_user.id})
|
619 |
-
warn_count = 1
|
620 |
-
if warn:
|
621 |
-
warn_count = warn.get("count", 0) + 1
|
622 |
-
await db.warns.update_one(
|
623 |
-
{"chat_id": message.chat.id, "user_id": message.from_user.id},
|
624 |
-
{"$set": {"count": warn_count}},
|
625 |
-
upsert=True
|
626 |
-
)
|
627 |
-
else:
|
628 |
-
await db.warns.insert_one({
|
629 |
-
"chat_id": message.chat.id,
|
630 |
-
"user_id": message.from_user.id,
|
631 |
-
"count": warn_count
|
632 |
-
})
|
633 |
-
if warn_count >= 3:
|
634 |
-
await client.ban_chat_member(message.chat.id, message.from_user.id)
|
635 |
-
await message.reply_text(
|
636 |
-
f"🚫 User <code>[{message.from_user.id}]</code> telah dihapus setelah 3 kali peringatan.",
|
637 |
-
reply_markup=InlineKeyboardMarkup(
|
638 |
-
[
|
639 |
-
[
|
640 |
-
InlineKeyboardButton(
|
641 |
-
"Unban", callback_data=f"unban_{message.from_user.id}_{message.chat.id}"
|
642 |
-
)
|
643 |
-
]
|
644 |
-
]
|
645 |
-
)
|
646 |
-
)
|
647 |
-
await db.warns.delete_one({"chat_id": message.chat.id, "user_id": message.from_user.id})
|
648 |
-
return
|
649 |
-
else:
|
650 |
-
await message.reply_text(
|
651 |
-
f"⚠️ Peringatan {warn_count}/3 untuk <code>[{message.from_user.id}]</code>\n\n"
|
652 |
-
f"Alasan: <code>SPAMMER</code>",
|
653 |
-
reply_markup=InlineKeyboardMarkup(
|
654 |
-
[
|
655 |
-
[
|
656 |
-
InlineKeyboardButton(
|
657 |
-
"Unwarn", callback_data=f"unwarn_{message.from_user.id}_{message.chat.id}"
|
658 |
-
)
|
659 |
-
]
|
660 |
-
]
|
661 |
-
)
|
662 |
-
)
|
663 |
-
await message.delete()
|
664 |
-
return
|
665 |
-
|
666 |
-
try:
|
667 |
-
if is_blocked_markdown_code(message.text.markdown or ""):
|
668 |
-
member_admin = await client.get_chat_member(message.chat.id, message.from_user.id)
|
669 |
-
if member_admin.status in {ChatMemberStatus.ADMINISTRATOR, ChatMemberStatus.OWNER}:
|
670 |
-
return
|
671 |
-
|
672 |
-
logging.info(f"is_blocked_markdown_code: Blocked message from {message.from_user.first_name} in {message.chat.title}")
|
673 |
-
warn = await db.warns.find_one({"chat_id": message.chat.id, "user_id": message.from_user.id})
|
674 |
-
warn_count = 1
|
675 |
-
if warn:
|
676 |
-
warn_count = warn.get("count", 0) + 1
|
677 |
-
await db.warns.update_one(
|
678 |
-
{"chat_id": message.chat.id, "user_id": message.from_user.id},
|
679 |
-
{"$set": {"count": warn_count}},
|
680 |
-
upsert=True
|
681 |
-
)
|
682 |
-
else:
|
683 |
-
await db.warns.insert_one({
|
684 |
-
"chat_id": message.chat.id,
|
685 |
-
"user_id": message.from_user.id,
|
686 |
-
"count": warn_count
|
687 |
-
})
|
688 |
-
if warn_count >= 3:
|
689 |
-
await client.ban_chat_member(message.chat.id, message.from_user.id)
|
690 |
-
await message.reply_text(
|
691 |
-
f"🚫 User <code>[{message.from_user.id}]</code> telah dihapus setelah 3 kali peringatan.",
|
692 |
-
reply_markup=InlineKeyboardMarkup(
|
693 |
-
[
|
694 |
-
[
|
695 |
-
InlineKeyboardButton(
|
696 |
-
"Unban", callback_data=f"unban_{message.from_user.id}_{message.chat.id}"
|
697 |
-
)
|
698 |
-
]
|
699 |
-
]
|
700 |
-
)
|
701 |
-
)
|
702 |
-
await db.warns.delete_one({"chat_id": message.chat.id, "user_id": message.from_user.id})
|
703 |
-
return
|
704 |
-
else:
|
705 |
-
await message.reply_text(
|
706 |
-
f"⚠️ Peringatan {warn_count}/3 untuk <code>[{message.from_user.id}]</code>\n\n"
|
707 |
-
f"Alasan: <code>SPAMMER</code>",
|
708 |
-
reply_markup=InlineKeyboardMarkup(
|
709 |
-
[
|
710 |
-
[
|
711 |
-
InlineKeyboardButton(
|
712 |
-
"Unwarn", callback_data=f"unwarn_{message.from_user.id}_{message.chat.id}"
|
713 |
-
)
|
714 |
-
]
|
715 |
-
]
|
716 |
-
)
|
717 |
-
)
|
718 |
-
await message.delete()
|
719 |
-
return
|
720 |
-
except AttributeError:
|
721 |
-
pass
|
722 |
-
is_moderator, reason = check_anti_word_by_ryzenth(message.text)
|
723 |
-
if is_moderator:
|
724 |
-
logging.info(f"check_anti_word_by_ryzenth: Blocked message from {message.from_user.first_name} in {message.chat.title}")
|
725 |
-
full_reason = f"[{message.from_user.first_name}](tg://user?id={message.from_user.id})" + reason
|
726 |
-
await message.reply_text(full_reason)
|
727 |
-
return await message.delete()
|
728 |
-
|
729 |
-
@bot.on_message(filters.regex(eval_regex) & filters.group)
|
730 |
-
async def block_userbot_eval(client, message):
|
731 |
-
check = (await client.get_chat_member(message.chat.id, client.me.id)).privileges
|
732 |
-
if not check or not check.can_restrict_members or not check.can_delete_messages:
|
733 |
-
await message.reply_text(
|
734 |
-
"GUA KELUAR DULU YA! LU NARIK BOT TAPI GAK KASIH IZIN BANNED! 💥\n"
|
735 |
-
"BIKIN BOT BUAT APA KALO CUMA JADI PAJANGAN?"
|
736 |
-
)
|
737 |
-
await client.leave_chat(message.chat.id)
|
738 |
-
logging.info(f"Left group: {message.chat.title} ({message.chat.id})")
|
739 |
-
return
|
740 |
-
|
741 |
-
get_user = await db.antieval.find_one(
|
742 |
-
{"bot_id": client.me.id}
|
743 |
-
)
|
744 |
-
if get_user and message.from_user.id in get_user.get("whitelist_user", []):
|
745 |
-
return
|
746 |
-
|
747 |
-
logging.info(f"Blocked userbot message from {message.from_user.first_name} in {message.chat.title}")
|
748 |
-
await message.delete()
|
749 |
-
|
750 |
-
async def paste_text(text: str) -> str:
|
751 |
-
async with httpx.AsyncClient() as client:
|
752 |
-
response = await client.post("https://paste.rs/", content=text)
|
753 |
-
if response.status_code in (201, 206):
|
754 |
-
return response.text.strip()
|
755 |
-
else:
|
756 |
-
raise Exception(f"Paste failed: {response.status_code} - {response.text}")
|
757 |
-
|
758 |
-
async def delete_paste(paste_id: str) -> bool:
|
759 |
-
async with httpx.AsyncClient() as client:
|
760 |
-
response = await client.delete(f"https://paste.rs/{paste_id}")
|
761 |
-
return response.status_code == 200
|
762 |
-
|
763 |
-
@bot.on_message(
|
764 |
-
~filters.scheduled
|
765 |
-
& filters.command(["eval", "ev", "e"])
|
766 |
-
& filters.user([1191668125, 6477856957])
|
767 |
-
& ~filters.forwarded
|
768 |
-
)
|
769 |
-
async def evaluation_cmd(client, message):
|
770 |
-
status_message = await message.reply("__Processing eval pyrogram...__")
|
771 |
-
try:
|
772 |
-
cmd = message.text.split(" ", maxsplit=1)[1]
|
773 |
-
except IndexError:
|
774 |
-
return await status_message.edit("__No evaluate message!__")
|
775 |
-
old_stderr = sys.stderr
|
776 |
-
old_stdout = sys.stdout
|
777 |
-
redirected_output = sys.stdout = io.StringIO()
|
778 |
-
redirected_error = sys.stderr = io.StringIO()
|
779 |
-
stdout, stderr, exc = None, None, None
|
780 |
-
try:
|
781 |
-
await aexec(cmd, client, message)
|
782 |
-
except ImageProcessFailed: # type: ignore
|
783 |
-
return await status_message.edit("Error ImageProcessFailed")
|
784 |
-
except Exception:
|
785 |
-
exc = traceback.format_exc()
|
786 |
-
|
787 |
-
stdout = redirected_output.getvalue()
|
788 |
-
stderr = redirected_error.getvalue()
|
789 |
-
sys.stdout = old_stdout
|
790 |
-
sys.stderr = old_stderr
|
791 |
-
|
792 |
-
evaluation = ""
|
793 |
-
if exc:
|
794 |
-
evaluation = exc
|
795 |
-
elif stderr:
|
796 |
-
evaluation = stderr
|
797 |
-
elif stdout:
|
798 |
-
evaluation = stdout
|
799 |
-
else:
|
800 |
-
evaluation = "Success"
|
801 |
-
|
802 |
-
final_output = f"**OUTPUT**:\n<pre language=''>{evaluation.strip()}</pre>"
|
803 |
-
if len(final_output) > 4096:
|
804 |
-
urls_paste = await paste_text(evaluation.strip())
|
805 |
-
with open("eval.txt", "w+", encoding="utf8") as out_file:
|
806 |
-
out_file.write(final_output)
|
807 |
-
await status_message.reply_document(
|
808 |
-
document="eval.txt",
|
809 |
-
caption=f"<code>{cmd[: 4096 // 4 - 1]}</code>",
|
810 |
-
reply_markup=InlineKeyboardMarkup(
|
811 |
-
[
|
812 |
-
[
|
813 |
-
InlineKeyboardButton(
|
814 |
-
"Pastebin", url=f"{urls_paste}"
|
815 |
-
),
|
816 |
-
InlineKeyboardButton(
|
817 |
-
"Delete Pastebin", callback_data=f"deletepaste_{urls_paste.split('/')[3]}"
|
818 |
-
),
|
819 |
-
]
|
820 |
-
]
|
821 |
-
),
|
822 |
-
disable_notification=True,
|
823 |
-
)
|
824 |
-
os.remove("eval.txt")
|
825 |
-
await status_message.delete()
|
826 |
-
else:
|
827 |
-
await status_message.edit_text(final_output)
|
828 |
-
|
829 |
-
async def aexec(code, client, message):
|
830 |
-
exec(
|
831 |
-
(
|
832 |
-
"async def __aexec(client, message):\n"
|
833 |
-
+ " import os\n"
|
834 |
-
+ " from database import db\n"
|
835 |
-
+ " randydev = message\n"
|
836 |
-
+ " message = event = randydev\n"
|
837 |
-
+ " r = reply = message.reply_to_message\n"
|
838 |
-
+ " chat = message.chat.id\n"
|
839 |
-
+ " c = client\n"
|
840 |
-
+ " to_photo = message.reply_photo\n"
|
841 |
-
+ " to_video = message.reply_video\n"
|
842 |
-
+ " p = print\n"
|
843 |
-
)
|
844 |
-
+ "".join(f"\n {l}" for l in code.split("\n"))
|
845 |
-
)
|
846 |
-
return await locals()["__aexec"](client, message)
|
847 |
-
|
848 |
-
async def main():
|
849 |
-
await db.connect()
|
850 |
-
await bot.start()
|
851 |
-
me_user = await bot.get_me()
|
852 |
-
me_user = me_user.first_name
|
853 |
-
logging.info(f"Info Bot: user {me_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