I want to send message to user after 2 minute he has clicked an callback query and execute database automatically after that 2 minute .
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
2
Answers
You can create a table called
jobs
and set a cron job to run every minute to check if there is any job to run. So you create a job for doing what you want and consider a column namedruns_at
.{ "class_name": "DatabaseQueryJob", "parameters": { ... } }
You have a class for running database queries and save what you need in parameters. Delete executed jobs from table and that’s it.
I hope this idea solves your problem and let me know if I misunderstood you.
Use sleep function