P
P
Pavel2018-01-23 22:35:45
ruby
Pavel, 2018-01-23 22:35:45

Infinite program execution. How?

Wrote a program for VK. Receives data from the conversation and sends a response. In short, a bot that can chat.
But the problem is that I don’t know how to correctly make this bot constantly parse the necessary data. 24 hours a day. I put in recursion. Caused an infinite loop with a delay of 2 seconds. But the program hangs for 2-3 minutes, executes conditionally 50 requests and crashes. Have to restart.
In general, I encountered ruby ​​a current a week ago. Bots never wrote. Please do not use swear words. I am using Linux mint OS.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Blokhin, 2018-01-23
@TITnet

Read carefully https://vk.com/dev/bots_docs
In short, your bot should not "knock" on the VK server.
This VK will pull your bot when a new event (message) appears.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question