Send messages Telegram bot without human intervention. How?

Good day!

Rummaged half of Internet in search example, but did not understand.
Describe bots everywhere who need something to write. However, I have to, I could get from the bot messages at any event.

I have written a php script which invokes in his call to the API to third-party service.
API gives 10 products. If there is a new 11 (last in the query changes) it is necessary that the bot sent me a message.

Don't understand how to implement. Saw the options with an infinite loop, seen the variants with Crohn's disease.
Do I have webhook or is it for another? I would be grateful if someone will give a smoke similar to the code of the bot.
April 19th 20 at 12:46
3 answers
April 19th 20 at 12:48
Webhook not needed here. Create a bot in the cart, drive the bot name in search, find it, write to him any message, otherwise the bot may not be the first to send a message to the user. From your script pull the url:
https://api.telegram.org/bot<Tokenbase>/sendMessage?chat_id=<Твой_ID>&text="new item"
And as if all.

Webhook not needed here. Create a bot in the cart, drive the bot name in search, find it, write to him any message, otherwise the bot may not be the first to send a message to the users


It's clear you know what you're saying, yeah. - glenna commented on April 19th 20 at 12:51
@glenna, I did Not understand, the question is, what then? - Terry.West commented on April 19th 20 at 12:54
April 19th 20 at 12:50
Judging by the description, you don't need a bot, just a new.
in the closed channel also need to post, but how is not clear. - alvis_Stark commented on April 19th 20 at 12:53
April 19th 20 at 12:52
How to learn something?

To ask

To wait to tell


API and then it doesn't tell

Find more questions by tags TelegramBotsPHP