L
L
Ly2017-03-31 01:06:17
In contact with
Ly, 2017-03-31 01:06:17

How to write a VK bot?

How to write a VK bot to process many requests at once through CallBack? There is a small bot you need already with such a VK, it swears at too frequent requests to send (error 6 and 9).
How big bots work? They respond instantly and are used by hundreds of users at the same time.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
danis_2014, 2017-04-01
@LyoSU

You can use, for example, 3 VK applications that will work from different tokens and from different ip, it turns out that the pause between requests will decrease to 1/9 of a second. Also use asynchronous execution, one thread (program) will receive messages and partially process and already transfer information to the second thread (program) that will prepare the answer, this is necessary so that the bot receives messages even while preparing a response to another message. You can use a queue to have the first thread receive messages, add them to the queue, receive messages, and so on. And the second thread, if it finds something in the queue, then processes it, prepares a response, sends it, looks at the queue, and also in a circle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question