K
K
Kozlov2018-03-19 13:14:25
PHP
Kozlov, 2018-03-19 13:14:25

Is VK Bot in php possible without cron?

There is a simple php bot that sends all incoming messages to me in telegram. Now it all works on the crown with a minute launch. The question actually is, can I do without krone? Maybe VK has a server that runs a script when it comes in?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vitaly, 2018-03-19
@romandkoz

vk-io (running node) has a long pull and event processing system. PHP is not the best choice for bots

W
WTERH, 2018-03-19
@Expany

Use php-deamon (infinite loop)

A
Alexander, 2018-03-23
@SilimAl

Roman , why cron has a much easier solution. If you need to be notified when there are new events in a group, the solution is to handle those events. For each event type message_new, wall_post_new, etc. write a call to the telegram api to send you a message.

$TGMtoken = '111111:000000000000';
$TGMapi = 'https://api.telegram.org/bot'.$TGMtoken.'/';
file_get_contents($TGMapi . 'sendMessage?chat_id=000(ваш телеграм)&text=Сообщение от пользователя в группе);

A
Axiell, 2019-07-16
@Sonik0

https://github.com/Xizezs/ZeroBot - Longpoll bot in php, no skip events for communities.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question