Exemple #1
0
async def gb(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н гб" in command:
        msg_1 = "🖐ᅠ  ᅠ    ᅠ ᅠ ᅠ🍺 Го бухать"
        msg_2 = "🖐ᅠ  ᅠ    ᅠ ᅠ🍺 Го бухать"
        msg_3 = "🖐ᅠ  ᅠ    ᅠ  🍺 Го бухать"
        msg_4 = "🖐ᅠ  ᅠ🍺Го бухать"
        msg_5 = "🖐 ᅠ 🍺 Го бухать"
        msg_6 = "🖐🍺Го бухать"
        msg_7 = "🖐🍺Го бухать"

        messages.write_msg(peer_id, msg_1)
        msg_id = vk_info.info_msg_id(peer_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_2, msg_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_3, msg_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_4, msg_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_5, msg_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_6, msg_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_7, msg_id)
Exemple #2
0
async def score(delay, peer_id, command):
    global onl
    await asyncio.sleep(delay)
    if "!н счетскик" in command or "!н счет" in command or "!н сч" in command or "!н счёт" in command:
        if peer_id > 2000000000:
            history = vk.method('messages.getConversationsById',
                                {'peer_ids': peer_id})
            name = history['items'][0]['chat_settings']['title']
        else:
            user = vk.method('users.get', {
                'user_ids': peer_id,
                'fields': 'friend_status'
            })
            fname = user[0]['first_name']
            lname = user[0]['last_name']
            name = str(fname) + " " + str(lname)

        historys = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        count = historys['count']

        msg_1 = f"""
        Кол-во сообщений: {count}
        """.replace('    ', '')

        messages.write_msg(peer_id, msg_1)
Exemple #3
0
async def add_vsms(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н влс" in command:
        history = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        msg_text = history['items'][0]['text']
        to = history['items'][0]['reply_message']['from_id']
        regexp: str = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args: list = re.findall(regexp, msg_text)
        args = []
        payload = ""
        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        msg_1 = ''.join(payload)

        messages.write_msg(to, msg_1)

        messages.write_msg(peer_id, "✅ Сообщение отправленно в лс!")
Exemple #4
0
async def autodr_off(delay, peer_id, command):
    global start
    await asyncio.sleep(delay)
    if "!н -адр" in command:
        start = False
        messages.write_msg(peer_id,
                           "✅ Автоматическая смена дня рождения выключена")
Exemple #5
0
async def auto_add_friends(delay, peer_id, command):
    await asyncio.sleep(delay)
    global start
    if "!н +адвд" in command:
        messages.write_msg(peer_id, "✅ Автодобавление в друзья включенно")
        while start:
            data: dict = vk.method(
                'friends.getRequests', {
                    'offset': 0,
                    'count': 1000,
                    'extended': 0,
                    'need_mutual': 0,
                    'out': 0,
                    'need_viewed': 1
                })['items']
            print(data)
            users: dict = vk.method(
                'users.get', {'user_ids': ",".join([str(i) for i in data])})
            for user in users:
                if None != user.get('deactivated', None):
                    print(
                        "Невозможно добавить забаненого пользователя в друзья")
                    continue
                try:
                    vk.method("friends.add", {'user_id': user['id']})
                    print("Добавлен: " + str(user['id']))
                except:
                    print("Ошибка при добавлении в друзья")
                time.sleep(5)
            time.sleep(300)
Exemple #6
0
async def read_off(delay, peer_id, command):
    await asyncio.sleep(delay)
    global finished
    if command == "!н спч":
        messages.write_msg(
            peer_id, "✅ Авточиталка сообщений в специальных чатах выключена!")
        finished = True
Exemple #7
0
async def execute(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н апи" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_id = history['items'][0]['conversation_message_id']
        msg_text = history['items'][0]['text']
        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""

        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            commands = args[0].lower()
            argss = None

            print(payload)
            test = str(eval(payload))
            messages.write_msg(peer_id, test)
        else:
            commands = args[0].lower()
            argss = args[1:]

            print(payload)
            test = str(eval(payload))
            messages.write_msg(peer_id, "Ответ вк: " + str(test))


        '''
Exemple #8
0
async def info_msg(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н дебаг" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_id = history['items'][0]['reply_message']['id']
        info = vk.method('messages.getById', {'message_ids': msg_id})
        messages.write_msg(peer_id, f"{info}")
Exemple #9
0
async def bind(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н связать" in command:
        history = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        user_id = history['items'][0]['from_id']
        user = vk.method('users.get', {
            'user_ids': user_id,
            'fields': 'friend_status, city, sex'
        })
        sex = user[0]['sex']
        sex_status = 'дурак' if sex == 2 else 'дура'

        msg_1 = f"""
        Ты шо {sex_status}?
        Беседа не связана, это тебе не дежурный ирис, связавать нечего
        """.replace('    ', '')

        messages.write_msg(peer_id, msg_1)
    elif "!гей связать" in command:

        msg_1 = f"""
        ✅ Гей клуб связан с беседой!
        """.replace('    ', '')

        messages.write_msg(peer_id, msg_1)
Exemple #10
0
async def ping_info(delay, peer_id, command):
    await asyncio.sleep(delay)
    if command == "!н пинг" or command == "!н пиу" or command == "!н кинг" or command == "!н п" or command == "!лгбт " \
                                                                                                              "пинг" \
            or command == "!гей пинг":
        delta: Union[float, Any] = vk_info.info_msg_date(peer_id)
        # c_time_str = str(datetime.fromtimestamp(round(c_time)))
        # v_time_str = str(datetime.fromtimestamp(round(event.msg['date'])))

        r_type = 'ПОНГ' if command == "!н пинг" else "ПАУ" if command == "!н пиу" else 'PONG' if command == "!н п" else\
            "ЛГБТ" if command == "!лгбт пинг" else "КТО ПРОЧИТАЛ ТОТ ГЕЙ" if command == "!гей пинг" else "КОНГ "

        if delta > 15:
            r_type += "\nlongpoll дежурный отвечает слишком долго!"
        elif delta > 10:
            r_type += "\nlongpoll дежурный работает с большой задержкой."
        elif delta > 5:
            r_type += "\nlongpoll дежурный работает не стабильно."
        else:
            r_type += "\nlongpoll дежурный работает"

        msg_1 = f"""{r_type}
        Ответ через: {delta} с.
        """.replace('    ', '')

        messages.write_msg(peer_id, msg_1)
Exemple #11
0
async def online(delay, peer_id, command):
    await asyncio.sleep(delay)
    global finished
    if "!н +онлайн" in command:
        messages.write_msg(peer_id, "✅ Вечный онлайн включён")
        while not finished:
            print("Авто онлайн работает: " +
                  str(vk.method('account.setOnline', {'voip': 0})))
            time.sleep(180)
Exemple #12
0
async def chats_name(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н чз" in command:
        chat_id = peer_id - 2000000000
        history = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        msg_id = history['items'][0]['conversation_message_id']
        msg_text = history['items'][0]['text']
        chat = vk.method('messages.getChat', {'chat_id': chat_id})
        chat_name = chat['title']
        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""

        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            commands = args[0].lower()
            argss = None

            messages.write_msg(peer_id, "Укажите название беседы!")
        else:
            commands = args[0].lower()
            argss = args[1:]

            name = ''.join(argss)

            i = 1
            while i >= 0:
                history = vk.method('messages.getHistory', {
                    'count': 1,
                    'peer_id': peer_id,
                    'rev': 0
                })
                msg_text = history['items'][0]['text']
                chat = vk.method('messages.getChat', {'chat_id': chat_id})
                chat_name = chat['title']
                if chat_name == name:
                    print('ok')
                if "!н счз" in msg_text:
                    i = -1
                    print("Автоизменение названия беседы отключенно")
                if chat_name != name:
                    vk.method('messages.editChat', {
                        'chat_id': chat_id,
                        'title': name
                    })
                    print("Название изменено")
Exemple #13
0
async def read(delay, peer_id, command):
    await asyncio.sleep(delay)
    global finished
    if command == "!н стч":
        messages.write_msg(peer_id, "✅ Авточиталка сообщений в специальных чатах включена!")
        with open("main/database/database_lp.json", "r", encoding="utf-8") as file:
                   data = json.loads(file.read())
        data_chats = data['chats']
        while finished == False:
            for i in range(len(data_chats)):
                print(vk.method("messages.markAsRead", {'peer_id': data_chats[i]}))
Exemple #14
0
async def red_dtemplates(delay, peer_id, command) -> str:
    await asyncio.sleep(delay)
    if "!н рдш" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_id = history['items'][0]['id']
        msg_text = history['items'][0]['text']
        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""

        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            commands = args[0].lower()
            argss = None
            messages.write_msg(peer_id, "❗ Нет данных")

        else:
            commands = args[0].lower()
            argss = args[1:]

            name = " ".join(argss)
            data_msg = payload
            prov = 1

            if name == "" or data_msg == "":
                messages.write_msg(peer_id, "❗ Нет данных")
                prov = 0

            if prov == 1:
                with open("main/database/database_lp_dtemp.json", "r", encoding="utf-8") as file:
                    data = json.loads(file.read())
                data_temp = data['templates']

                prov = 0
                for temp in data_temp:
                    if temp['name'] in name:
                        name_int = name.replace(str(temp['name']) + ' ', '')
                        print(name)
                        name_int = int(name_int)
                        name_int = name_int - 1
                        temp['payload'].insert(name_int, data_msg)
                        name_in = name_int + 1
                        temp['payload'].pop(name_in)
                        print(data_temp)
                        data = {"templates": data_temp}
                        with open("main/database/database_lp_dtemp.json", "w", encoding="utf-8") as file:
                            file.write(json.dumps(data, ensure_ascii=False, indent=4))

                        messages.write_msg(peer_id, f"""✅ В дшаб "{temp['name']}" был изменён элемент. """)
                        prov = 1
                        break

                if prov == 0:
                    messages.write_msg(peer_id, f"""❗ Элемент не был найден!""")
Exemple #15
0
async def templates(delay, peer_id, command) -> str:
    await asyncio.sleep(delay)
    if "!н мш" in command:
        with open("main/database/database_lp_temp.json", "r", encoding="utf-8") as file:
            data = json.loads(file.read())
        data_temp = data['templates']

        _message = "📃Шаблоны дежурного:"
        itr = 0
        for temp in data_temp:
            itr += 1
            _message += f"\n{itr}. {temp['name']}"

        messages.write_msg(peer_id, _message)
Exemple #16
0
async def chats_del(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н -чат" in command:
        with open("main/database/database_lp.json", "r", encoding="utf-8") as file:
               data = json.loads(file.read())
        data_chats = data['chats']
        print(data_chats)
        data_chats.remove(str(peer_id))
        print(data_chats)
        data = {"chats": data_chats}
        print(data)
        with open("main/database/database_lp.json", "w", encoding="utf-8") as file:
            file.write(json.dumps(data, ensure_ascii=False, indent=4))
        messages.write_msg(peer_id, "Чат отвязан!")
Exemple #17
0
async def add_friends_conversations(delay, peer_id, command):
    user_id = vk.method('users.get', {})
    user_id = user_id[0]['id']
    await asyncio.sleep(delay)
    if "!н +дрв" in command:
        msg_text = vk_info.info_msg_text(peer_id)
        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""

        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            commands = args[0].lower()
            argss = None
            messages.write_msg(
                peer_id, "❗Укажите кол-во секунд перед добавлением в друзья")
        else:
            commands = args[0].lower()
            argss = args[1:]

            count = ''.join(argss)
            count = int(count)
            count_1 = count + 2
            count_2 = count - 2
            count_3 = count + 3
            count_4 = count - 3
            counts = [count, count_1, count_2, count_3, count_4]
            messages.write_msg(peer_id,
                               "...Начинаю добавлять всю беседу в друзья...")
            members_friend = []
            for members in vk_info.all_members(peer_id):
                if members['member_id'] < 0:
                    print("Невозможно добавить группу в др")
                elif members['member_id'] == user_id:
                    print("Невозможно добавить себя в др")
                elif members['member_id'] > 0:
                    members_friend.append(str(members['member_id']))
            for i in range(len(members_friend)):
                try:
                    print(members_friend[i])
                    add_friend(members_friend[i])
                    time.sleep(random.choice(counts))
                    if command == "!н -дрв":
                        messages.write_msg(
                            peer_id,
                            "✅ Добавление всей беседы в друзья отключенно")
                        continue
                except:
                    print("Пользователь заморожен")

            messages.write_msg(peer_id, "✅ Все участники беседы добавленны!")
Exemple #18
0
async def add_user(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н добавить" in command or "!н вернуть" in command:
        history = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        msg_id = history['items'][0]['conversation_message_id']
        msg_text = history['items'][0]['text']
        peer_id = peer_id
        chat_id = peer_id - 2000000000

        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""
        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            commands = args[0].lower()
            argss = None
            messages.write_msg(peer_id, "Ссылка на пользователя не указана!")
        else:
            commands = args[0].lower()
            argss = args[1:]

            users_id = ''.join(argss).replace('https://vk.com/', '')
            user = vk.method('users.get', {
                'user_ids': users_id,
                'fields': 'friend_status'
            })
            name = user[0]['first_name']
            user_id = user[0]['id']
            user_id = int(user_id)

            vk.method('messages.addChatUser', {
                'chat_id': chat_id,
                'user_id': user_id
            })
            messages.write_msg(peer_id,
                               f"Пользователь @id{user_id}({name}) добавлен!")
Exemple #19
0
async def convert(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н конв" in command:
        msg_text = vk_info.info_msg_text(peer_id)
        _eng_chars = u"~!@#$%^&qwertyuiop[]asdfghjkl;'zxcvbnm,./QWERTYUIOP{}ASDFGHJKL:\"|ZXCVBNM<>?"
        _rus_chars = u"ё!\"№;%:?йцукенгшщзхъфывапролджэячсмитьбю.ЙЦУКЕНГШЩЗХЪФЫВАПРОЛДЖЭ/ЯЧСМИТЬБЮ,"
        _trans_table = dict(zip(_eng_chars, _rus_chars))

        s = ''
        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""
        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            commands = args[0].lower()
            argss = None
            try:
                history = vk.method('messages.getHistory', {
                    'count': 1,
                    'peer_id': peer_id,
                    'rev': 0
                })
                reply_message = history['items'][0]['reply_message']['text']
                s = s + '\n' + reply_message
            except:
                print("Данных не обноруженно!")
        else:
            commands = args[0].lower()
            argss = args[1:]

            if bool(argss):
                s = " ".join(argss)
            if bool(payload):
                s = s + '\n' + payload
        if s == "":
            messages.write_msg(peer_id, 'Нет данных 🤦')
        else:
            msg = u''.join([_trans_table.get(c, c) for c in s])
            messages.write_msg(peer_id, msg)
Exemple #20
0
async def xz(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н хз" in command:
        msg_1 = "Что мне написать?"
        msg_2 = "&#4448;\nЧто мне написать?"
        msg_3 = "&#4448;\n&#4448;\nЧто мне написать?"
        msg_4 = "&#4448;\n&#4448;\n&#4448;\nЧто мне написать?"
        msg_5 = "Что мне написать?\nЧто мне написать?\nЧто мне написать?\nЧто мне написать?"

        messages.write_msg(peer_id, msg_1)
        msg_id = vk_info.info_msg_id(peer_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_2, msg_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_3, msg_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_4, msg_id)
        time.sleep(1)
        messages.edit_msg(peer_id, msg_5, msg_id)
Exemple #21
0
async def dtemplate(delay, peer_id, command) -> str:
    await asyncio.sleep(delay)
    if "!н дш" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_id = history['items'][0]['id']
        msg_text = history['items'][0]['text']
        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""

        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            commands = args[0].lower()
            argss = None
            messages.write_msg(peer_id, "❗ Нет данных")

        else:
            commands = args[0].lower()
            argss = args[1:]

            name = " ".join(argss)
            prov = 1

            if name == "":
                messages.write_msg(peer_id, "❗ Нет данных")
                prov = 0

            if prov == 1:
                with open("main/database/database_lp_dtemp.json", "r", encoding="utf-8") as file:
                    data = json.loads(file.read())
                data_temp = data['templates']

                for temp in data_temp:
                    if temp['name'] == name:
                        for i in range(len(temp['payload'])):
                            messages.edit_msg(peer_id, temp['payload'][i], msg_id)
                            time.sleep(1)
Exemple #22
0
async def fonts(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н шрифты" in command:
        messages.write_msg(
            peer_id, """
1. 𝕠𝕦𝕥𝕝𝕚𝕟𝕖 (outline)
2. 𝚝𝚢𝚙𝚎𝚠𝚛𝚒𝚝𝚎𝚛 (typewriter)
3. 𝓈𝒸𝓇𝒾𝓅𝓉 (script)
4. 𝓼𝓬𝓻𝓲𝓹𝓽_𝓫𝓸𝓵𝓭 (script_bold)
5. zɾƃlɟq_ɟʞuʍ (upside_down)
6. ᴛɪɴʏ_ᴄᴀᴘs (tiny_caps)
7. ᑕOᗰIᑕ (comic)
8. 𝐬𝐞𝐫𝐢𝐟_𝐛 (serif_b)
9. 𝑠𝑒𝑟𝑖𝑓_𝑖 (serif_i)
10. 𝒔𝒆𝒓𝒊𝒇_𝒃𝒊 (serif_bi)
11. ⒸⒾⓇⒸⓁⒺⓈ (circles)
12. 🅒🅘🅡🅒🅛🅔🅢_🅑 (circles_b)
13. 🅂🅀🅄🄰🅁🄴🅂 (squares)
14. 𝔤𝔬𝔱𝔥𝔦𝔠 (gothic)
15. 𝖌𝖔𝖙𝖍𝖎𝖈_𝖇 (gothic_b)""")
Exemple #23
0
async def del_sms_from_user(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н -фс" in command or "!банхаммер" in command:
        history = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        msg_id = history['items'][0]['conversation_message_id']
        msg_text = history['items'][0]['text']
        peer_id = peer_id
        history = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        user_id = history['items'][0]['reply_message']['from_id']

        messages.write_msg(peer_id,
                           "... удаляю сообщения ...\nРейда не будет!")

        msg_ids = []
        for mmsg in vk_info.get_all_history_gens(peer_id):
            if datetime.now().timestamp() - mmsg['date'] > 86400:
                break
            if mmsg['from_id'] == user_id and mmsg.get('action', None) == None:
                msg_ids.append(str(mmsg['id']))
        message_id = 0
        try:
            vk.method("messages.delete", {
                'message_ids': ",".join(msg_ids),
                'delete_for_all': 1
            })
            message_id = messages.write_msg(
                peer_id, "✅ Сообщения удалены\nРейдеры повержены!")
        except:
            message_id = messages.write_msg(
                peer_id, f"❗ Не удалось удалить сообщения.")

        t = Timer(2, delete_msg(msg_ids), message_id)
        t.start()
Exemple #24
0
async def delete_dtemplates(delay, peer_id, command) -> str:
    await asyncio.sleep(delay)
    if "!н -дш" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_text = history['items'][0]['text']
        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""

        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            commands = args[0].lower()
            argss = None
            messages.write_msg(peer_id, "❗ Нет данных")

        else:
            commands = args[0].lower()
            argss = args[1:]

            name = " ".join(argss)
            prov = 1

            if name == "":
                messages.write_msg(peer_id, "❗ Нет данных")
                prov = 0

            if prov == 1:
                with open("main/database/database_lp_dtemp.json", "r", encoding="utf-8") as file:
                    data = json.loads(file.read())
                data_temp = data['templates']

                for temp in data_temp:
                    if temp['name'] == name:
                        data_temp.remove(temp)

                        data = {"templates": data_temp}
                        with open("main/database/database_lp_dtemp.json", "w", encoding="utf-8") as file:
                            file.write(json.dumps(data, ensure_ascii=False, indent=4))

                        messages.write_msg(peer_id, f"""✅ Шаблон "{name}" удалён. """)
                        prov = 1
                        continue

                if prov == 0:
                    messages.write_msg(peer_id, f'''❗ шаблон "{name}" не найден''')
Exemple #25
0
async def status(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н статус" in command:
        history: Optional[Any] = vk.method('messages.getHistory',
                                           {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_text: object = history['items'][0]['text']
        regexp: str = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args: List[Any] = re.findall(str(regexp), str(msg_text))
        args: List[Any] = []
        payload: str = ""
        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]
        argss = args[1:]
        payload = "".join(payload)
        if payload == "":
            messages.write_msg(peer_id, "❗ Укажите текст нового статуса (со второй строки)")
            pass
        elif payload != "":
            try:
                vk.method("status.set", {'text': payload})
                messages.write_msg(peer_id, "✅ Статус успешно изменён")
            except:
                msg = "❗ Ошибка при выполнении смены статуса"
                messages.write_msg(peer_id, msg)
Exemple #26
0
async def add_spam(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н спам" in command:
        history = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        msg_text: object = history['items'][0]['text']
        regexp: str = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args: List[Any] = re.findall(str(regexp), str(msg_text))
        args: List[Any] = []
        payload: str = ""
        arg: list
        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]
        if len(args) == 1:
            argss: list = []
        else:
            argss: list = args[1:]

        count = ''.join(argss)
        count = float(count)
        msg_1 = ''.join(payload)

        messages.write_msg(peer_id, "...Отправляю сообщения...")
        i = 1
        while i >= 0:
            messages.write_msg(peer_id, msg_1)
            time.sleep(count)

        messages.write_msg(peer_id, "✅ Сообщения отправленны!")
Exemple #27
0
async def idm(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н идм" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_id = history['items'][0]['id']

        msg_1 = f"""
        +api MAVKantispam https://lordral.ru/callback/
        """.replace('    ', '')

        messages.write_msg(-174105461, msg_1)

        messages.edit_msg(peer_id, "Переключён на платный IDM", msg_id)
    elif "!н мой идм" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_id = history['items'][0]['id']

        msg_1 = f"""
        +api mavkantispam https://NikitolIrisDev.pythonanywhere.com/callback
        """.replace('    ', '')

        messages.write_msg(-174105461, msg_1)

        messages.edit_msg(peer_id, "Переключён на мой IDM", msg_id)
    elif "!н мди" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_id = history['items'][0]['id']

        msg_1 = f"""
        +api mavkantispam https://belikanov.online/iris/callback.php
        """.replace('    ', '')

        messages.write_msg(-174105461, msg_1)

        messages.edit_msg(peer_id, "Переключён на MDI", msg_id)
Exemple #28
0
async def dr(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н дата" in command:
        history: Optional[Any] = vk.method('messages.getHistory',
                                           {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_text: object = history['items'][0]['text']
        regexp: str = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args: List[Any] = re.findall(str(regexp), str(msg_text))
        args: List[Any] = []
        payload: str = ""
        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            argss = None
            messages.write_msg(peer_id, "❗ Укажите дату, которую хотите поставить на своё день рождения")
        else:
            argss = args[1:]
            datadr = ''.join(argss)
            try:
                vk.method("account.saveProfileInfo", {'bdate': datadr})
                messages.write_msg(peer_id, "✅ Дата дня рождения успешно изменена")
            except:
                msg = "❗ Дата рождения пользователя должна в формате DD.MM.YYYY, например \"15.11.1984\""
                messages.write_msg(peer_id, msg)
Exemple #29
0
async def autostatus(delay, peer_id, command):
    global finish
    await asyncio.sleep(delay)
    if "!н +аст" in command:
        history: Optional[Any] = vk.method('messages.getHistory', {
            'count': 1,
            'peer_id': peer_id,
            'rev': 0
        })
        msg_text: object = history['items'][0]['text']
        regexp: str = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args: List[Any] = re.findall(str(regexp), str(msg_text))
        args: List[Any] = []
        payload: str = ""
        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            argss = None
            messages.write_msg(
                peer_id,
                "❗ Укажите ваш часовой пояс (разница от UTC (для моск. время - \"3\"))"
            )
        else:
            argss = args[1:]
            hours = ''.join(argss)
            try:
                hours = int(hours)
            except:
                messages.write_msg(
                    peer_id, "❗ Часовой пояс должен быть в числовом формате.")

            messages.write_msg(peer_id, "✅ Автостатус запущен")
            while not finish:  # Запускаем бесконечный цикл
                delta = datetime.timedelta(hours=hours, minutes=0)
                t = (datetime.datetime.now(datetime.timezone.utc) + delta
                     )  # Присваиваем дату и время переменной «t»
                nowtime = t.strftime("%H:%M")  # текущее время
                nowdate = t.strftime("%d.%m.%Y")  # текущее дата
                on = vk.method(
                    "friends.getOnline")  # получаем список id друзей онлайн
                counted = len(on)  # подсчет кол-ва друзей
                vk.method(
                    "status.set", {
                        "text":
                        nowtime + " ● " + nowdate + " ● " + "Друзей онлайн: " +
                        str(counted)
                    })
                time.sleep(
                    30)  # анти-каптча. Погружает скрипт в «сон» на 30 секун
Exemple #30
0
async def create_templates(delay, peer_id, command):
    await asyncio.sleep(delay)
    if "!н +ш" in command:
        history = vk.method('messages.getHistory', {'count': 1, 'peer_id': peer_id, 'rev': 0})
        msg_text = history['items'][0]['text']
        regexp = r"(^[\S]+)|([\S]+)|(\n[\s\S \n]+)"
        _args = re.findall(regexp, msg_text)
        args = []
        payload = ""

        for arg in _args:
            if arg[1] != '':
                args.append(arg[1])
            if arg[2] != '':
                payload = arg[2][1:]

        if len(args) == 1:
            messages.write_msg(peer_id, "❗ Нет данных")

        else:
            argss = args[1:]

            name = " ".join(argss)
            data_msg = payload
            attachment = attachments(peer_id)
            prov = 1

            if data_msg == "" and attachment == []:
                messages.write_msg(peer_id, "❗ Нет данных")
                prov = 0

            if prov == 1:
                with open("main/database/database_lp_temp.json", "r", encoding="utf-8") as file:
                    data = json.loads(file.read())
                data_temp = data['templates']
                print(data_temp)
                data_templ = {
                    "name": name,
                    "payload": data_msg,
                    "attachments": attachment
                }
                print(data_temp)
                data_temp.append(data_templ)
                print(data)
                data = {"templates": data_temp}
                with open("main/database/database_lp_temp.json", "w", encoding="utf-8") as file:
                    file.write(json.dumps(data, ensure_ascii=False, indent=4))

                messages.write_msg(peer_id, f"""✅ Шаблон "{name}" сохранен. """)