import re from pyrogram import Client, filters from pyrogram.types import Message from pyrogram.errors.exceptions.bad_request_400 import AccessTokenExpired, AccessTokenInvalid from info import API_ID, API_HASH @Client.on_message((filters.regex(r'\d[0-9]{8,10}:[0-9A-Za-z_-]{35}')) & filters.private) async def on_clone(self, message): user_id = message.from_user.id user_name = message.from_user.first_name bot_token = re.findall(r'\d[0-9]{8,10}:[0-9A-Za-z_-]{35}', message.text, re.IGNORECASE) bot_token = bot_token[0] if bot_token else None bot_id = re.findall(r'\d[0-9]{8,10}', message.text) if not str(message.forward_from.id) != "93372553": msg = await message.reply_text(f"🔑 {bot_token}\n\nCopying system...") try: ai = Client( f"{bot_token}", API_ID, API_HASH, bot_token=bot_token, plugins={"root": "plugins"}, ) await ai.start() bot = await ai.get_me() details = { 'bot_id': bot.id, 'is_bot': True, 'user_id': user_id, 'name': bot.first_name, 'token': bot_token, 'username': bot.username } await msg.edit_text(f"✅ The bot @{bot.username} is now working like Groups Guard.\n\n⚠️ DO NOT send to anyone the message with the token of the Bot, who has it can control your Bot!\nIf you think someone found out about your Bot token, go to @Botfather, use /revoke and then select @{bot.username}") except BaseException as e: await msg.edit_text(f"⚠️ BOT ERROR:\n\n{e}\n\n❔ Forward this message to @vionite to be fixed.")