Answer the question
In order to leave comments, you need to log in
How to make a command on time?
Good afternoon, how can I make a command on time? That is, someone enters a command and the next time can be used only after 10 minutes.
Answer the question
In order to leave comments, you need to log in
Create a sqlite database, for example, 2 columns, 1 column - user ID, 2 column - the time when the command was last used, when the user entered the command, compare whether 10 minutes have passed.
If the project uses caching, then put some label in the variable in the cache with a lifetime of 10 minutes.
If there is a label in the cache - failure. If there is no label, then we put the label in the cache for 10 minutes, and execute the command.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question