P
P
py1love2019-08-21 01:40:10
Python
py1love, 2019-08-21 01:40:10

How to make a cycle for incoming telebot, qiwi api payments?

There is a telegram bot (Telebot (pyTelegramBotApi)), with QIWI API.
You need to create a loop that will check the incoming payment for qiwi once every 1 hour, with the condition - if the comment to the payment = user ID (current), then print (1).
The bottom line is that the bot reacts to replenishment with a comment in the form of a user ID
P.S. With the while loop, the bot does not respond to commands, only the loop for checking incoming payments works.
I'm new, just started learning, please explain in more detail with:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DarkGa, 2019-08-25
@DarkGa

It's pretty simple, loop the timers.
Here's an example:

from threading import Timer
def donat():
    print("complete")
    t=Timer(60*60, donat)
    t.start()
t=Timer(60*60, donat)
t.start()

As you understand, every 60 minutes it will print complete, it remains only to replace print with your code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question