VK bot to delete groups. General information about the VKBot program

Unfortunately, at the moment there are no good Python2 libraries in order to quickly create a chatbot. Below I will show how easy it is to write a primitive chat bot for VK using the VK API.


The article is written for beginners to show that there is nothing difficult in writing bots in Python.

Authorization

We need the vk_api library. You can log in to VK in two ways:
- As a user
- Like a community


In the first case, you will need to enter a username and password. In the second case, you need to enable "Community Posts" in the group and create an API access key:





import time import vk_api vk = vk_api.VkApi(login = "login", password = "password") #vk_api.VkApi(token = "a02d...e83fd") #Log in as community vk.auth()

Sending messages

Now let's write a short function that sends a message to the selected person.


P.S. The community can only send messages to previously posted users.


def write_msg(user_id, s): vk.method("messages.send", ("user_id":user_id,"message":s))

In vk.method we can call any method from VK API and pass parameters as a dictionary.


In this case, we call the method messages.send and as parameters we pass the user id and the text of the message.

Receiving messages

Fine! We learned how to send messages, it remains to learn how to receive them. For this we need a method messages.get.


A few parameters to pay attention to:


1) out - if this parameter is equal to 1, the server will return outgoing messages.
2) count - the number of messages to be received.
3) time_offset - the maximum time elapsed from the moment the message was sent to the current moment in seconds.
4) last_message_id - identifier of the message received before the one to be returned last (assuming that no more than count messages were received after it)


values ​​= ("out": 0,"count": 100,"time_offset": 60) vk.method("messages.get", values)

In our case, this method will return all received messages for the last 60 seconds, if there were less than 100 of course, and if more, then the last 100.


As a result, we get a list of items:


(u"count": 3441, u"items": [(u"body": u"\u041f\u0438\u0448\u0435\u043c \u0431\u043e\u0442\u0430 \u0434\u043b\u044f \u0432\u043a !", u"date": 1491934484, u"id": 7387, u"out": 0, u"read_state": 0, u"title": u" ... ", u"user_id": 23107592) , (u"body": u"\u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440!", u"date": 1491934479, u"id": 7386, u"out" : 0, u"read_state": 0, u"title": u" ... ", u"user_id": 23107592)])

In simple terms, items are what can be highlighted in the dialog.



The final chord, we make an eternal cycle, where we will answer each message "Hi, Habr!".


while True: response = vk.method("messages.get", values) if response["items"]: values["last_message_id"] = response["items"]["id"] for item in response["items "]: write_msg(item,u"Hello Habr!") time.sleep(1)

The chatbot is ready.


P.S. We remember the last_message_id parameter in order to process only new messages next time.


Full code

# -*- coding: utf-8 -*- import time import vk_api vk = vk_api.VkApi(login = "login", password = "password") #vk_api.VkApi(token = "a02d...e83fd") # Login as community vk.auth() values ​​= ("out": 0,"count": 100,"time_offset": 60) def write_msg(user_id, s): vk.method("messages.send", ("user_id ":user_id,"message":s)) while True: response = vk.method("messages.get", values) if response["items"]: values["last_message_id"] = response["items"][ "id"] for item in response["items"]: write_msg(item,u"Hello Habr!") time.sleep(1)


It turned out 17 lines of code. Good luck!


UPD 09/17/18:
Unfortunately, in the new version (5.80) of the VK API, the "messages.get" method was removed and this article has lost its relevance. Now use the longpoll system to create bots. You can find an example on the vk_api module for Python.

Often the owners of VKontakte groups and publics turn to me with the question: “How can I quickly and cheaply recruit subscribers to a group?” They also ask about who the bots and VKontakte offers are. I answer that about “quickly and cheaply” this is not for me, since I work with groups of my customers using exclusively white methods using paid promotion methods.

Who are bots?

Working in social networks and in particular VKontakte is a lot of work that requires a serious investment of time, effort and money. Often, entrepreneurs go to social networks without understanding how everything works here. That is why people "peck" on dubious offers, where they are offered "real live subscribers" for very modest money. Let's try to figure out what kind of "live" subscribers are and where they come from.

Do you know what bots are and how they differ from offers?

Bots are such personal VKontakte pages filled with false information and performing automatic tasks. Who creates these same bots? There are special programs that either create such pages or hack the pages of real people.

Who are the offers?

A few years ago, bots were actively used by Vkontakte, but today they have been almost completely replaced by offers. The social network Vkontakte has a negative attitude towards non-living accounts, and if you manage to fill your group with bots, then it will simply be blocked. You will then communicate long and hard with the administration and explain where you got these same bots.

Offers, unlike bots, are real people who are ready to join a certain VKontakte group and perform certain actions in it, for example, like, repost, or write some kind of comment. Why do they do it? Of course, for a fee.

Before you is just a screen from a site where people are invited to make money on VKontakte by performing certain targeted actions.

How much do offers cost

Offer prices vary. To be honest, I myself have never used services for recruiting offers into a group, but finding them on the net is not difficult at all. Go to the search engine and set the search query "Buy VKontakte offers" and get acquainted with the prices. Here is a screen that I made by looking at one of the sites that provide such services.


But I want to warn you right away, when ordering offers, you are drawing to be in the same situation as the author of this post in the discussion thread on the forum. That is, after joining your community, people will hang there as an absolutely dead audience, and this is even at best. And at worst, they will begin to unsubscribe en masse and turn into "dogs".


Why bots and offers are useless for business

Why it happens? The answer is simple - these people are absolutely not interested in your group and your business. They got their reward and happily forgot about you. And even if the cost of one such subscriber is much cheaper than the target one received when launching paid advertising, the question arises: why do you need these offers at all?

Some authors of VKontakte projects believe that they join a group with several thousand subscribers much better than an empty one. But the whole problem is that in order to powder people's brains, you will also have to imitate at least minimal, but activity in your group. And you will also have to pay for this ... And again, this activity will be fake. That's why I never buy offers anywhere and I do not advise you.

Why buy offers

If you want your Vkontakte business to develop and make a profit, you need to learn not to buy offers, but to work competently in this social network. Make your group interesting to your subscribers and learn how to attract a real live target audience.

Some owners of VKontakte groups want to buy offers in order to get into the TOP of results in the internal search of VKontakte. On this occasion, I will say the following. If in order to reach the TOP you need to recruit up to 10 thousand subscribers to the group, then it is quite possible to cope with this task without any offers, and in a fairly short time (if, of course, you have a certain budget).

For example, the group "SECRETS OF CHINESE MEDICINE" is in the top three in the search results for the internal search of VKontakte among 410 communities. And they recruited this group exclusively by white methods.

If, in order to get into the TOP, you need to gain 100 thousand subscribers or more, recruiting offers is generally a thankless task. Why? Yes, because the lack of activity in a group with such a serious number of subscribers will rather work against you.

People will have a question: why in such a large group no one is interested in the product, does not ask questions, does not leave reviews. Will you imitate the “movement” in your group yourself? Maybe then you will buy from yourself?

Yes, and such a picture in the subscribers of your community will also not work to build trust in you and your business:

However, about the owner of the group too, he only had to keep a straight face, because he was guaranteed entry and that's it. So they entered, even more than what was bought.

To answer

This site uses Akismet to fight spam. .

This program allows you to simplify the work with the Vkontakte website and speed up the performance of the same type of actions. With its help, you can automate the process of downloading audio tracks and videos, simplify sending requests to friends and invitations to a meeting or group. This program is indispensable for public administrators, as well as organizers of meetings in this social network. VKBot makes it easy to send mass messages to friends, helps you quickly tag people in photos and videos. With this software, it is easy to clear the wall and personal correspondence, if necessary, delete friends.

Using the program is very simple, it has a clear interface and can perform many functions without loading the computer's RAM. VKBot developers constantly monitor the updates of the Vkontakte website and supplement their own product in time, so the program always works accurately and remains one of the best multifunctional programs for working with this site. There is an extended paid version of the program, which has more functions, the cost of activating VKBotPro is 400 rubles. for 1 month of use.

System Requirements
Operating system: Windows XP/Windows Vista/Windows 7/Windows 8.

How to work with the VKBot program

This program does not require installation. After downloading the VKBot.exe file, you need to run it by double-clicking the mouse. A window will appear asking you to enter your username and password. These data are needed to access your account on a social network. The same information is entered in both fields as when entering the Vkontakte website.


Rice. 1 - Entering a login and password to start the program

After starting the program, a window will appear on the right side of the screen where you can directly control the functions of VKBot. The window can be easily dragged to any convenient part. At the top of the program window is the number of the current version, as well as the name and surname of the profile for which the login was made. VKBot is always on top of other windows, but it can be minimized, and then the program will remain only in the tray.


Rice. 2 - Program window

Each menu has many sub-items, among which it is easy to find the right one. All submenus work in much the same way. You need to click on the button and a dialog box will appear where you need to enter the necessary information - a link to a video, group or meeting - or tick off the necessary items (lists of friends, albums, etc.).

Consider the most popular functions of VKBot

The first button "Profile" allows you to automate some processes, clear the wall or personal correspondence from records, audio files. When you click on one or another button, a detailed menu pops up, where you can select the desired action.


Rice. 3 - Functions of the "Profile" tab

Automation allows you to approve or reject friend requests, as well as be marked on videos and photos automatically. There is also the "Eternal Online" function, thanks to which the account will always be "Online" when the program is running. The "Autostatus" function allows you to automatically place posts on the wall or in the status, you can configure the export of quotes from other resources, post audio tracks and much more. In order for the selected functions to work, you must click "Apply" before exiting the dialog box.



Rice. 4 - Profile automation window

With the help of the submenu "Cleaning" you can perform many actions. The "Manage private messages" button allows you to delete entire conversations, delete messages from those who are not friends. "News Management" allows you to unsubscribe from comments, hide or show all friends in the feed. Using the next button, you can delete audio and video recordings according to the required criteria (no album, no views, duplicates), remove profile marks on photos and videos. When you click on the desired button, a window appears where you can clarify the information and tick the required fields.


Rice. 5 - Submenu "Cleaning"

The next submenu allows you to recover deleted recordings from the wall (valid for 1 hour).


Rice. 6 - Submenu "Restore"

In the group management menu, you can configure mass entry into communities from the search or exit from them.


Rice. 7 - Submenu "Groups"

Meetings can be managed using the following menu. Here it is possible to remove participants and invitations, exit past events.


Rice. 8 - Submenu "Meetings"

It is possible to export correspondence, lists of meeting participants, friends, etc. using the Export menu.


Rice. 9 - Submenu "Export"

You can manage your friend requests, subscriptions, and the People of Interest feature from the Friends menu. There are many criteria by which you can thin out your list of friends. The next menu allows you to manage subscribers and remove them.


Rice. 10 - Submenu "Friends"

Rice. 11 - Submenu "Subscriptions"

One of the important functions is the management of the "black list". To add a user, you must specify a link to his page.


Rice. 12 - Blacklist

The next tab is "Media" from the main menu.

Rice. 13 - Media tab
The "Player" button allows you to listen to and broadcast audio recordings in the status without going to the site. The program provides the ability to download files from the site - you can download music from the wall, download the entire albums you need.


Rice. 14 - Submenu "Download", tab "Media"

The program allows not only to save, but also to load elements: graffiti, documents, pictures.


Rice. 15 - Submenu "Download"

In addition to downloading and uploading, VKBot allows you to copy your favorite videos, audios and pictures to your profile. To do this, you only need to provide a link to the material.


Rice. 16 - Copying with the program

The next menu allows you to edit the added documents (privacy, description) as well as organize the audio. Here you can also manage the movement of photos and videos, add them to a particular album.


Rice. 17 - Editing with the program

Rice. 18 - Submenu "Move"

To quickly mark friends in a photo or video, there is a separate button. When pressed, a menu appears where you can select the photo itself, as well as information about which friends you need to mark (from the same city, same gender, etc.).

Inviting friends to groups and meetings with VKBot is very simple. You just need to select the desired item in the "Inviting" menu. Friends are selected according to any desired criteria (age, location, gender).


Rice. 19 - Contents of the "Inviting" menu

The program can be customized, for example, so that it turns on when Windows starts, it is immediately minimized to tray. All the necessary items can be checked in the "Settings".


Rice. 20 - Program settings

The "Hide" button minimizes VKBot to tray. To expand it, double-click on the icon. The program can be controlled directly from the tray by right-clicking on the icon and selecting the desired menu. You can also log out of VKBot there.


Rice. 21 - Program control from tray

Since the program does not require installation, you can remove it simply by moving the exe file to the trash.

The massive use and popularization of bots in the VK social network will inspire every administrator of any social network to desire to use a similar bot program in their public. At the same time, not everyone knows how to install it, and even after reading a lot of materials in order to find explanations for the implementation of what they want, not everyone will immediately understand the sequence of necessary actions in order to create a VK bot. In this review, all administrators will find ways for themselves to create a bot in VK groups, and learn how to use the appropriate tools.

Quick navigation:

How to make a VK bot

If you are engaged in VK groups, then you probably know that a VK bot is a program that helps you automate any manipulations. In our case, we will consider a bot connected to the Vkontakte community, which will send identical mailings and respond to visitors' messages. In addition, you can play various interactive games with him, he will give recommendations regarding music or video, cheer you up with a joke, and so on. In the following sections, we will consider how you can create a bot for publics of various topics in one of the currently popular social networks Vkontakte.

What is a bot in VK

First of all, you should consider what a bot is. This section is dedicated to the very characteristics of the bot. Working in social networks, including VKontakte, is hard work that requires serious investments of money, time and effort. Nowadays, almost every entrepreneur goes to social networks without realizing how everything works there, but, after all, it is precisely due to well-organized and well-planned actions in groups that people “peck” at all kinds of offers. Let's figure out with you how the bot for the VK group will help us in such a difficult task as promoting the community.

In fact, it is very simple to explain what a “Bot” is. In social networks, a bot is a non-existent person who in fact simply does not exist. Bot can be considered. It is also customary to call them "dead souls", just like in Gogol's famous story, non-existent people who are listed in some structures. In our case, fakes in the VK social network will be investigated. "Live" display of the "bot"

It is possible to present in the form of a questionnaire those citizens who actually do not exist, or these are long-abandoned pages of ordinary VK users, and perhaps even real copies that the real owners do not even know about. What can a bot do? To be honest, almost nothing, it just exists and that's it. He does not know how to write or read, and in general, nothing that ordinary visitors to Vkontakte do. Next, we will consider the question: how to make a bot in VK so that it becomes a real assistant in the promotion of the group.

How to make a bot in VK for a group

It is important to understand that there are several ways to create bots in VK. The first of the bots that will be discussed is "Robochat". This bot has a fairly easy and understandable functionality, while it is also simple and understandable in setting up. To install it, you need to go to the robochat.io website, and click on the "Create a bot" button (if necessary, you need to go through the procedure through your e-mail).

Thus, you will go to the bot settings section, where you will need to connect the bot to the required community. With one click on the "Connect Now" button, from the list that appears, select "Vkontakte Community" and click on the "Connect" button on the right. As we can see, creating or downloading a VK bot is not at all difficult.

The application will make a request to access your personal VK account. It is important to know that this account must have administrator rights in the Vkontakte public you need). Click on "Allow"

This will take you to the list of adding Vkontakte groups in which you are an administrator. Click on "Connect" to the right of the required community, and then click on "Allow" to allow the bot to access the group's messages, photos, and videos. Now return to your account on the Robochat.io website, go to the “Chatbot” section on the left, in which there will be three sub-tabs (“General”, “VK Messages”, “Keywords”). We are directly interested in the "Basic" sub-tab, where you will be able to customize your bot's responses to all kinds of user requests, including using the "Keywords" sub-tab. To edit with a certain option, there is an "Edit" button, which is located next to each of the items. Once you've finished setting up template responses, your bot is ready to go. In order to activate it, the user needs to click on the "Write messages" button in your community, and the bot will give an answer to the user in accordance with the setting you specified.

The second way to make a bot for a VK group

It can be attributed to the next method. Bot "BotVK", which implies automated responses to incoming messages from public users. The installation of such a bot in VK from the site bot-vk.ru is identical in its algorithm to the installation of the previous “Robochat” program. The VK bot script is built into the program itself, which makes it easier to use. At the same time, setting up BotVK is also intuitively simple, and does not require any special programming knowledge from the user. To start working with this bot, go to the site bot-vk.ru, and click on the "Create a bot" button.

Then you need to click on the "Login or create an account" button, and click on "Allow" on the bottom right to grant the application permission to access your account. So you can go to the control panel of the bot you created. Click on the "Connect Group" button to start working with your group, you need to mark your group in the list, and click on "Connect" and then on "Allow". On the right, there will be a menu for managing the created bot.

There you need to go to the "List of bots" tab, and then click on the name of your bot in the group located on the right. The settings of your VK bot will appear, in which you will have the opportunity to make a fairly extensive list of settings for its functionality, and then click on "Save" at the bottom in order to commit the changes.

The third way - Creating Chatbots on the site bots.hsstore.ru

You can safely use paid-based bots on the site bots.hsstore.ru. Here are a lot of paid bots for the VK site, the functionality of which can be connected for a monthly fee of 990 rubles. Among them, there is a Wikipedia bot (sends articles from Wikipedia at your request), a bot suitable for communication (has the ability to connect you anonymously with other unknown users), a horoscope bot, and so on.

The installation of the bots described above is similar to the installation in the options already considered, while it is important to know that here you are also required to invest for paid functionality. Given that the two previous bots "Robochat" and "BotVK" are completely free, installing paid bot instances looks like a rather dubious decision.

In this section, we examined several methods to make a bot in a VK group in a short time to send messages to them. Installing this kind of bot implies that you have administrative rights in your account to manage the group, as well as granting the rights to the connected bot to directly work with your

community. By setting up the bot in the right way, you will have convenient auxiliary functionality that can make it easier to work with a large number of subscribers to your VK group.

How to create a bot in VK via Android

"Android" is an operating system designed for electronic devices. It operates on the Linux kernel and makes it possible to create applications controlled by the device through the libraries of the Google system. How to create a VK bot through a smartphone? "Android" fully supports many programs for creating bots through a smartphone. In order to make it yourself, an excellent knowledge of the programming language will help you, including an understanding of what the concept of “bot code” means. If there are difficulties with this, you can also use an automatic device or services. Let's say Abot is able to create its own virtual assistant. He will answer messages and all sorts of questions from customers. This is a fairly convenient thing to control and conduct business through a smartphone.

VK bot constructor

Before undertaking this business, it is necessary to determine what it is for. Its creation, not always, requires programming skills and any super knowledge. Bot constructors will help you to cope with this task perfectly (one of the most popular is Chatfuel). Constructors allow you to create a bot using a user-friendly interface. Serious companies and firms are satisfied with such assistants. Demanded and popular designers today can be considered: Api.ai, Meya, Pandarabots, Manybot. These services are used to build chatbots in various social networks.

How to create a chat bot

A modern visitor to social networks undoubtedly needs an active assistant. The lack of time to carry out the full activities of VK is the starting point for creating robots that will respond to messages and perform other tasks. A chatbot is a program through which a user can communicate.

There are four types of chatbots:

Helpers. They are always nearby, find the information necessary for the user, set an alarm, carry out organizational tasks, such as ordering food to the office or home, booking a hotel room, buying tickets.

· Artificial intelligence. Modern developments lead to the fact that chatbots perform tasks that require a lot of time from a person. Robots are able to answer any questions of the interlocutor.

· Business bots. They are provided in order to increase efficiency and take part in business optimization. Here a bot for the VK group is a necessity. Let's say the SpyCat 2.0 service sends a notification to the user about received comments on the VK network, while having an auto-responder function. Business bots reduce costs, automate all work processes (send messages to customers and employees).

· Gaming. A program that controls a computer. She imitates partners in an online team game. Such bots are based on artificial intelligence and are fully adapted to the features of a particular game.

How to create a chat bot in VK? - this is a very popular question from those who intend to develop their business by attracting customers through the VK bot. To do this is quite simple. Before you start this business, you must meet the following criteria: continuous access to the Internet and the availability of free time. You also need to download a free chatbot, run it and add an account. Next, you need to enter the login and password of the personal page in VK. Then the instruction will open, it must be read and followed to the "Messages" tab. On the community wall of your account, you need to write “Bot, hello!”. Thirty seconds later, he should give an answer. In the tabs of the program "Account", "Teams" you can change and configure the functions of the VK bot.

Download ready-made bot for VK

In this section, we will take a closer look at how and where you can download the VK bot. In fact, downloading a bot is an absolutely simple task that absolutely anyone who has the skills to use a PC can handle. You can download the VK Bot on the vk-robot website. or on other sites. All of them are united by one thing, namely: the risk of downloading a virus, downloading an outdated program that will not only not be useful to you, but will contribute to a quick ban and all sorts of other troubles. By downloading programs on the network, you are at great risk.

All you have left is the right to choose. In order to make the right choice, you need to qualitatively evaluate the functions of the bot that are necessary specifically for your activity. You can easily find a description of the functions on each site that offers downloading the bot.

But if common sense tells you that you don’t need to download anything ** but from the Internet, then there is a reliable service that is not only free, but will not bring trouble, even to your personal page - BossLike.ru

Bosslike has many features that Vkontakte users want to get:, Subscribers, comments ...

How to write a bot for VK yourself

This section will be useful for those who want to get to know the structure of the bot in more detail and create a bot for VK for free and on their own.

· In any search engine we find the registration form in "VK". In the line "name" enter any name. In the line "surname", it is best to enter a common, surname. We click "register".

· Then you need to enter the phone number and click "get code".

· After confirmation of registration, a blank page will be generated, which must be filled out. Now let's move on to the main question, namely "How to create a bot in VK yourself?". In the new user account, all required fields must be completed. Namely the following:

Step by step:

1. Basic: first and last name are already filled in. So, you should indicate gender, marital status, birth data, city, language. Then - grandfathers, grandmothers, brothers, sisters, parents, children, grandchildren - add as you wish. Click "save". It is important to understand that the data will reflect the personality, so your VKontakte bot should look real.

2. Contacts: you need to add a country, Skype, a link to a personal site. The last paragraphs may or may not be added.

3. Interests: it is important to write down the activity. Indicate a large number of interests (travel, books, humor, etc.). Next, enter - your favorite music, then movies, books, TV shows, games, quotes and mark something "about yourself", and then save.

4. Next - education, mark the school, educational institutions and save.

5. Career: you need to enter the place of study and activity, you can even have several, and also save.

6. Service: you need to specify only, as a rule, the male sex.

7. Life position: should be filled in - political preferences, the main thing in life, worldview, the main thing in people, attitudes towards smoking and alcohol, sources of inspiration, and save all this as well.

So, now follows the second stage of resolving the question “How to create a VK bot on your own? Now you need to add an avatar and a photo.

1. We find on the Internet in search of a “picture” of a photograph of a person. Download them to your computer and save.

2. It is advisable to find several pieces of photographs of the same person. In this case, the appearance of a "real user" is created.

3. The photo for the avatar should be selected in medium size, it should clearly reflect the face of our "bot". Do not take animals or various extravagant pictures. Everything must be

as close to reality as possible. Upload the photo to the VK page and save it.

4. Next, add the rest of the photos, the more there are, the better. They can be varied. “Bot VK” can be on them both in the singular, and in a company or with a group of people. You need to upload at least 4-5 photos to your account. Let's move on to the third stage and learn how to create a "bot" in VK.

Next step…

The third stage of solving the problem: How to create a "Vkontakte bot for groups"? The next stage should be full of the most active actions. On the new page, you need to upload several videos, and any audio recordings. And also provide an account with friends. How to create a "bot" in "VK" without programs, so to speak, in manual mode? This way of creating a "manual" bot will require your time. The fact is that friends will need to be added manually. You will have to create friend requests and accept them daily. To make the fake user look even more alive, they need to communicate.

So, in conclusion, we can summarize that there are two ways to create a VK 2018 bot: install a special program or write daily in a chat and communicate with other users on its behalf. As you can see for yourself, there is nothing complicated. However, it is worth taking into account that in order to create a full-fledged "bot", you need to spend your free time.