M
M
mitra_mc2018-03-17 17:07:02
PHP
mitra_mc, 2018-03-17 17:07:02

Why is the VKontakte bot responding slowly and sending two messages each?

Developed two bots on VKontakte: one parses the college page and sends a link to the schedule, the second one simply replies to messages (it can also respond with stickers, videos and photos). Both bots are written in PHP and hosted on Heroku.
Such a question: does the bot respond for a long time and / or two messages per request due to bad code or weak hosting?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Tolmachev, 2018-03-17
@mitra_mc

How long, how long is that?
3-5 minutes? Seconds? Everyone has their own concept of long.
If you want to look at the server response time, take the message that VK sends you in json format, and insert it into Postman, for example, and request the bot address through it. This way you can get the approximate response time of your script to a message. Well, then, already optimization. Naturally, if you have hosting, and not VPS, then the speeds will not be so hot at all.
PS two messages each, most likely due to a timeout or error. Are you using Callback API?

P
Puma Thailand, 2018-03-17
@opium

If the cheapest Heroku is, then there Instances fall asleep and wake up when there is activity

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question