Answer the question
In order to leave comments, you need to log in
How to check payment status every 5 minutes in python in telegram bot?
How to check payment status every 5 minutes in python in telegram bot, but without time.sleep(), because the whole bot stops
Answer the question
In order to leave comments, you need to log in
The easiest way is to run the check function in a separate thread. Flow examples here .
If you have a loop where you check for updates in your telegram bot via getUpdates , then you can add this.
import time
check_time = int(time.time())
while True:
if int(time.time()) - check_time >= 5:
check_time = int(time.time())
print('проверяем статус платежа каждые 5 секунд')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question