B
B
batraider2016-07-15 13:45:23
PHP
batraider, 2016-07-15 13:45:23

How to get a request without refreshing the page?

I am writing my first bot for VK, its task at the moment is to respond to an incoming message.
I use the messages.get method (returns a list of incoming or outgoing personal messages of the current user), I find a message in it, and I answer using the messages.send method. But the trouble is that when I try to find out if a new message has arrived, I have to refresh the page.
Question: how to find out about an incoming message without refreshing the page? Here it came to me in VK, the bot immediately processed and answered.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nelolka, 2016-07-15
@DevartNigga

Yuzai longpoll, for this it was created

I
IceJOKER, 2016-07-15
@IceJOKER

cron?
js &&setInterval();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question