async def add_token(message: Message, token: str) -> Optional[str]: if not check_access(message.from_id): return config = read_config() config['tokens'].append(token) write_config(config) return "Токен добавлен"
async def add_account(message: Message, login: str, password: str) -> Optional[str]: if not check_access(message.from_id): return config = read_config() config['log_pass'].append({'login': login, 'password': password}) write_config(config) return "Логин и пароль добавлен"
async def wrapper(message: Message): if not check_access(message.from_id): return text = "" apis = await get_spam_apis() text += f"Всего {len(apis)} аккаунтов:\n" for api in apis: spam_user = (await api.users.get())[0] text += f"[id{spam_user.id}|{spam_user.first_name} {spam_user.last_name}]\n" return text
async def wrapper(message: Message, link: str) -> Optional[str]: if not check_access(message.from_id): return spam_database = [] CHAT_SPAM_STATE.update({'working': True}) for api in await get_spam_apis(): try: spam_database.append(( api, (await api.messages.join_chat_by_invite_link(link=link )).chat_id + 2e9, )) except VKError: pass return "Вход выполнен мой господин начинаем ебать их "
async def wrapper(message: Message): if not check_access(message.from_id): return config = read_config() text = "Проверка акаунтов:\n" for i in range(0, len(config['log_pass'])): log_pass = config['log_pass'][i] api = API(await get_tokens(log_pass['login'], log_pass['password'])) try: _tuser = (await api.users.get())[0] text += f"{i}. Аккаунт [id{_tuser.id}|{_tuser.first_name} {_tuser.last_name}] проверен\n" except VKError: text += f"{i}. Токен поврежден" config['tokens'][i] = None config['tokens'] = list( [token for token in config['tokens'] if token is not None]) write_config(config) return text
async def wrapper(message: Message): if not check_access(message.from_id): return config = read_config() text = "токены:\n" for i in range(0, len(config['tokens'])): token = config['tokens'][i] api = API(token) try: _tuser = (await api.users.get())[0] text += f"{i}. Токен [id{_tuser.id}|{_tuser.first_name} {_tuser.last_name}] проверен\n" except VKError: text += f"{i}. Токен поврежден" config['tokens'][i] = None config['tokens'] = list( [token for token in config['tokens'] if token is not None]) write_config(config) return text
async def run_spam_handler(message: Message, user_id: int, text: str, **kwargs) -> Optional[str]: if not check_access(message.from_id): return global loop target_user = (await message.api.users.get(user_ids=user_id))[0] apis = await get_spam_apis() if loop.is_closed(): loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) SPAM_STATE.update({"working": True}) for api in apis: loop.create_task( spammer(api, target_user.id, text, lambda: get_state())) if not loop.is_running(): loop.run_forever() return f"наначали ебать " \ f"[id{target_user.id}|{target_user.first_name} {target_user.last_name}]"
async def wrapper(message: Message, link: str, text: str) -> Optional[str]: if not check_access(message.from_id): return spam_database = [] CHAT_SPAM_STATE.update({'working': True}) for api in await get_spam_apis(): try: spam_database.append(( api, (await api.messages.join_chat_by_invite_link(link=link )).chat_id + 2e9, )) except VKError: pass for account_info in spam_database: loop.create_task( spammer(account_info[0], account_info[1], text, lambda: get_state())) return "Расчет придурков окончен"
async def stop_spam_handler(message: Message): if not check_access(message.from_id): return SPAM_STATE.update({'working': False}) return "выебал"
async def wrapper(message: Message): if not check_access(message.from_id): return CHAT_SPAM_STATE.update({'working': False})