Y
Y
y_o_l_k_i_n___e_g_o_r2021-01-14 20:05:25
Python
y_o_l_k_i_n___e_g_o_r, 2021-01-14 20:05:25

How to check the date in the user's database every 24 hours, and if it is equal to today, disable his privileges?

My telegram bot has a paid subscription, but do I need to somehow keep track of the subscription date?
this is the crux of the matter!
since there are many commands in the bot that require an asset, time.sleep() is not suitable, and a lot of users need to check.

how to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Shitskov, 2021-01-14
@y_o_l_k_i_n___e_g_o_r

When a user receives or renews a subscription, set the end date in the database.
For any operations performed on a subscription, check that the user has this date greater than the current one. Enough condition for the select.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question