M
M
marshadow2020-08-31 11:25:35
Bots
marshadow, 2020-08-31 11:25:35

How to make a notification that you have visited the site in a telegram bot?

A bot on telebot, there is a site in php, where all user actions are logged into the database. That is, when a person enters the page, a record is immediately saved in the database. How can I make sure that after a person goes to the site, I receive a notification about this? Both the php site and telebot use the same mySQL database. I had the option to run an asynchronous loop in parallel with the bots, which checks the database every second for new records and, if so, sends a message in the telegram, but it seems to me that this is not the best option. What is the best way to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Kudrin, 2020-08-31
@HepkaPlay

In the bot, give an individual user link and link it to the site, when you click on the link, for example: https://site.com/index.php?tuser=123123
send this data to the bot and voila.
UPD: I didn’t read the question so much, you just need the bot to save the values ​​\u200b\u200bfrom the database and write to you when it changes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question